What this thread does
Do first: Create a connection file under bot/mcp-connections/; default-export defineConnection with the server configuration and advertiseTools: true.
Short answer
The October 20, 2026 SDK launch introduced MCP connections as agent project files. Current reference paths include the bot directory. A filename becomes the server name; host-only connections are kept outside model and playground discovery.
What to do
| Value | Action / meaning |
|---|---|
October 20, 2026; mcp-connections/ | Launch introduced MCP connections as code. |
bot/mcp-connections/; defineConnection; @grok/agent-sdk/connections | Default-export defineConnection from this package in each connection file. |
url; https://mcp.linear.app/mcp | Remote HTTP server example. |
advertiseTools: true | Expose server tools for calls by name, preserving descriptions, schemas and MCP annotations. |
bot/host-connections/ | Use for host-code-only servers; same configuration shape, hidden from the model/playground. |
command; args; env; cwd | For local stdio, launch a child process. TypeScript handlers may instead live in a tools object. |
${NAME}; headers; env | Use variable templates in remote headers or stdio env; resolved whenever the connection opens. |
process.env.NAME; agent-sdk validate | Top-level environment reads only work locally; validation warns about missing template variables. Unset variables become empty and cause server auth failure. |
oauth: true; agent-sdk mcp oauth | Opt into OAuth for a compatible server. |
auth; headers | Per-session HTTP/SSE callback runs on the host before every turn; returned headers override static ones. Throwing fails the turn. |
session.auth; session.id; session.continuationKey | Derive identity from auth, ID or channel state; continuationKey rotates after every HTTP follow-up. |
host.mcp; oauth: true | Host calls use static headers; auth callback cannot combine with OAuth. |
optional: true | Skip unavailable connections instead of failing the turn. A filter matching nothing otherwise fails too. |
tools; disallowedTools; tools/list | Allow names with tools, exclude with disallowedTools; exclusion wins. Unknown tool names are skipped. Model filters require advertisement. |
effects: "read" | Keep only listed tools annotated by the server as reads. |
cursorAccount: true; account.ts; cursor.ts | Forward dashboard-authorized account connectors. Name the file account.ts; cursor.ts collides with the IDE namespace. |
servers: "*"; servers: ["Linear"] | Account connections include all HTTP/SSE connectors unless restricted by a server list. The host must be signed in or serve fails at startup. |
--allow-anonymous; --allow-anonymous-cursor-account-mcp; --bearer-token | Account connectors are usable by every caller. Shared hosts should use --bearer-token; serve blocks anonymous account access unless the extra exception is set behind a trusted boundary. |
ctx.host.mcp; args.host.mcp | Server tools use ctx; channel and schedule handlers use args. |
host.mcp.names(); listTools(name); callTool(name, tool, args) | List connections, inspect a named connection, and call one of its tools. |
Limits and open questions
Listing/auth failures and invalid-name/collision errors fail the turn; the page also describes renaming invalid or colliding advertised names without specifying which cases are recoverable. Dry-run sessions execute read-only MCP tools, stub writes and make unannotated tools unavailable. Outside dry-run, unannotated tools run once; authored reads get transient retries. Peer-agent connections are a separate use of the same file format.
Not for: Cursor IDE mcp.json configuration or writing a native Agent SDK tool.
Sources
- MCP connection reference, Cursor, 2026-11-17.
- Agent SDK launch in changelog, Cursor, 2026-10-20.
Checked
2026-11-17; read MCP connection reference, Agent SDK launch in changelog; no command was run.
Started from a post by @Cursor, packaged by the editor. Original post