beforeMCPExecution hook payload command field sends the config key name instead of the actual MCP server URL or command line

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The beforeMCPExecution hook payload sends the user-defined config key name instead of the actual value. For remote MCP servers, command field is populated with the key name (e.g. my-mcp) instead of url being populated with the actual remote URL (e.g. https://mcp.notion.com/mcp).
For stdio MCP servers, command contains the key name instead of the actual command line.

This breaks automation we have built on top of hooks that relies on reliably identifying which MCP server is being invoked.

Steps to Reproduce

Remote MCP:

  1. Configure a remote MCP server in Cursor (e.g. Notion MCP at https://mcp.notion.com/mcp) with key name notion
  2. Set up a beforeMCPExecution hook
  3. Invoke any MCP tool
  4. Inspect the hook payload — command is notion instead of url being https://mcp.notion.com/mcp

Faulty payload:

{
  "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "generation_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "model": "claude-opus-4-6",
  "tool_name": "notion-search",
  "tool_input": "{\"query\":\"main page\",\"query_type\":\"internal\",\"filters\":{},\"page_size\":5,\"max_highlight_length\":100}",
  "command": "my-mcp", // <----- This is the faulty key (url key is missing)
  "session_id": "1a2b3c4d-5e6f-7890-abcd-ef1234567890",
  "hook_event_name": "beforeMCPExecution",
  "cursor_version": "3.1.17",
  "workspace_roots": ["/Users/johndoe/projects/my-app"],
  "user_email": "[email protected]",
  "transcript_path": "/Users/johndoe/.cursor/projects/my-app/agent-transcripts/3fa85f64/3fa85f64.jsonl"
}

Stdio MCP:

  1. Configure a stdio MCP server in Cursor (e.g. Playwright MCP with key name my-playwright, command line npx @playwright/mcp@latest)
  2. Set up a beforeMCPExecution hook
  3. Invoke any MCP tool
  4. Inspect the hook payload — command is my-playwright instead of npx @playwright/mcp@latest

Faulty payload:

{
  "conversation_id": "8b3e1d92-1f4a-4b7c-a2e5-9d6f83c21045",
  "generation_id": "2a4c6e8f-3b5d-7f9a-c1e3-5g7i9k1m3o5q",
  "model": "claude-opus-4-6",
  "tool_name": "playwright_navigate",
  "tool_input": "{\"url\":\"https://example.com\"}",
  "command": "playwright",
  "session_id": "8b3e1d92-1f4a-4b7c-a2e5-9d6f83c21045",
  "hook_event_name": "beforeMCPExecution",
  "cursor_version": "3.1.17",
  "workspace_roots": ["/Users/johndoe/projects/my-app"],
  "user_email": "[email protected]",
  "transcript_path": "/Users/johndoe/.cursor/projects/my-app/agent-transcripts/8b3e1d92/8b3e1d92.jsonl"
}

Expected Behavior

For remote MCP servers: url field is populated with the actual remote URL (e.g. https://mcp.notion.com/mcp), command is absent.
For stdio MCP servers: command contains the actual command line (e.g. npx @playwright/mcp@latest), not the config key name.

Operating System

MacOS

Version Information

Version: 3.1.17 (Universal)
VSCode Version: 1.105.1
Commit: fce1e9ab7844f9ea35793da01e634aa7e50bce90
Date: 2026-04-19T19:33:58.189Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 24.6.0

Additional Information

This seems related to beforeMCPExecution command sends wrong info which got fixed previously.

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Thanks for the report @yuval-ast. I can reproduce this on 3.2.11 and have filed a bug internally.

In the meantime, what kind of automations are you building on top of hooks? Happy to suggest workarounds depending on your use case.

Thanks Colin!

Appreciate the quick repro and the internal bug filing. Any ETA on the fix? Happy to test a build once it’s available.

Hey Yuval, no ETA yet, but this is on the team’s radar now. We’ll update this thread when the fix is out to let you know.