We’re embedding local Cursor agents (T3 Code) with settingSources so ambient MCP from ~/.cursor/mcp.json and project .cursor/mcp.json can load.
From the CLI, unapproved servers are explicit:
$ agent mcp list
neon: not loaded (needs approval)
…
After agent mcp enable <server>, they become ready and show up in the agent tool catalog.
Through the SDK, the same unapproved servers just never appear. There is no public API/event/callback that says “this MCP exists but needs approval.” Internally the runtime throws something like McpServerNotApprovedError during lease load and skips the server. From an embedder’s point of view that is indistinguishable from “not configured,” “auth failed,” “disabled,” or “wrong cwd.”
So hosts cannot:
- Show a confirmation UI for MCP approval
- Tell the user why tools are missing
- Point them at
agent mcp enable/ the right project slug
agent.reload() also doesn’t help with discovery of this state.
Related (same area, separate ask)
Project ambient MCP appears tied to cwd-derived projectRoot, not local.dirs. For git worktree workflows (cwd = worktree, project .cursor/mcp.json only at the main workspace root), project MCPs don’t load even when dirs: [workspaceRoot] is set and settingSources includes “project”. Rules/skills from extra dirs seem to load; MCP does not. Happy to split that into a second thread if useful.
Expected Behavior
Some first-class SDK surface for ambient MCP lifecycle, for example:
- List configured ambient servers with status: ready | needs_approval | requires_authentication | disabled | error (+ message)
- A run/init event or host callback when a server is skipped for approval (don’t fail the whole run; just make it observable)
- Ideally a way to approve/deny from the host, or a documented “open CLI / deep link” path if approval must stay out-of-process
Also worth documenting next to settingSources in the MCP docs: approval is a hard gate, and the SDK will not prompt.
Steps to Reproduce
- Add an ambient stdio/HTTP server to ~/.cursor/mcp.json or /.cursor/mcp.json that is not in ~/.cursor/projects//mcp-approvals.json
- Confirm
agent mcp list(from that cwd) showsnot loaded (needs approval) - Agent.create({ local: { cwd, settingSources: [“project”, “user”, “plugins”] }, … }) and run a turn
- Observe: server tools absent; no SDK signal that approval was the reason
agent mcp enable <server>, restart/recreate agent → tools appear
Version Information
- @cursor/sdk 1.2.0
- Node 24
- Local agents via Agent.create / agent.send
- Linux
Additional context
We’re fine keeping approval as a Cursor-local trust gate. We just need the SDK to expose the same status the CLI already knows, so product UIs aren’t forced to shell out to agent mcp list or reverse-engineer mcp-approvals.json hashes.