-
Notifications
You must be signed in to change notification settings - Fork 155
[BUG] cursor: .cursor/mcp.json emitted with Copilot schema (type: "local") — stdio MCP servers fail to start in Cursor #844
Copy link
Copy link
Open
Labels
area/mcp-configMCP server configuration depth, transports, variable resolution.MCP server configuration depth, transports, variable resolution.bugDeprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.good first issueGood for newcomersGood for newcomersneeds-triageDeprecated: use status/needs-triage. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use status/needs-triage. Kept for issue history; will be removed in milestone 0.10.0.priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.One manifest, every target. Multi-target deploy, marketplace, packaging, install.type/bugSomething does not work as documented.Something does not work as documented.
Milestone
Metadata
Metadata
Assignees
Labels
area/mcp-configMCP server configuration depth, transports, variable resolution.MCP server configuration depth, transports, variable resolution.bugDeprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.good first issueGood for newcomersGood for newcomersneeds-triageDeprecated: use status/needs-triage. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use status/needs-triage. Kept for issue history; will be removed in milestone 0.10.0.priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.One manifest, every target. Multi-target deploy, marketplace, packaging, install.type/bugSomething does not work as documented.Something does not work as documented.
Type
Projects
Status
In Progress
Describe the bug
When a package is installed with
--client cursor, APM generates.cursor/mcp.jsonusing the GitHub Copilot CLI server shape instead of Cursor's. The output contains"type": "local"plus Copilot-only fields ("tools","id"). Cursor's MCP loader does not recognise"type": "local"for stdio servers, and the server silently fails to register. Manually changing"type": "local"→"type": "stdio"(and removing the Copilot fields) fixes the server.Per Cursor docs — Model Context Protocol, stdio entries in
.cursor/mcp.jsonmust use"type": "stdio", together withcommand, and optionallyargs/env.Root cause.
CursorClientAdapterinherits fromCopilotClientAdapterand reuses_format_server_config, which hard-codes the Copilot shape:For self-defined stdio deps (
_raw_stdio) the adapter only appendscommand/args/envon top of this Copilot skeleton, so the resulting file is never valid for Cursor.To Reproduce
Steps to reproduce the behavior:
vlsi/troubleshooting-cli→ai-packages/troubleshooting/apm.yml.apm install ... --client cursor..cursor/mcp.json— it contains"type": "local"."type": "local"with"type": "stdio"→ the server works immediately.Expected behavior
.cursor/mcp.jsonshould follow Cursor's documented stdio schema, e.g.:{ "mcpServers": { "troubleshooting": { "type": "stdio", "command": "./tscli", "args": ["mcp"] } } }Copilot-only fields (
"tools","id") should not be written for Cursor.Environment (please complete the following information)
Logs
Actual
.cursor/mcp.jsongenerated by APM (broken in Cursor):{ "mcpServers": { "troubleshooting": { "type": "local", "tools": ["*"], "id": "", "command": "./tscli", "args": ["mcp"] } } }After manual fix (works):
{ "mcpServers": { "troubleshooting": { "type": "stdio", "command": "./tscli", "args": ["mcp"] } } }Additional context
Scope. This is an APM adapter bug — the consumer package's
apm.ymlis correct; only the Cursor output is wrong.Suggested fix. Override
_format_server_config(and/or thetypemapping) inCursorClientAdapterso that:typeis set to"stdio"for stdio transports (and"http"for HTTP/SSE transports, per Cursor docs);tools,id) are not emitted.Workaround for users today. After
apm install --client cursor, edit.cursor/mcp.jsonand replace"type": "local"with"type": "stdio"; optionally drop"tools"and"id".