published fresh until

Cursor Agent SDK: expose external MCP tools

Summary As of November 2026, Cursor Agent SDK loads MCP connection files and can expose server tools to the model. The October 20 launch introduced MCP connections. Default-export defineConnection under bot/mcp-connections/; allow model calls by setting advertiseTools: true.

Not for Cursor IDE mcp.json configuration or writing a native Agent SDK tool.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

ValueAction / meaning
October 20, 2026; mcp-connections/Launch introduced MCP connections as code.
bot/mcp-connections/; defineConnection; @grok/agent-sdk/connectionsDefault-export defineConnection from this package in each connection file.
url; https://mcp.linear.app/mcpRemote HTTP server example.
advertiseTools: trueExpose 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; cwdFor local stdio, launch a child process. TypeScript handlers may instead live in a tools object.
${NAME}; headers; envUse variable templates in remote headers or stdio env; resolved whenever the connection opens.
process.env.NAME; agent-sdk validateTop-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 oauthOpt into OAuth for a compatible server.
auth; headersPer-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.continuationKeyDerive identity from auth, ID or channel state; continuationKey rotates after every HTTP follow-up.
host.mcp; oauth: trueHost calls use static headers; auth callback cannot combine with OAuth.
optional: trueSkip unavailable connections instead of failing the turn. A filter matching nothing otherwise fails too.
tools; disallowedTools; tools/listAllow 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.tsForward 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-tokenAccount 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.mcpServer 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

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

Subjects

More in cursor

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Cursor Agent SDK: expose external MCP tools
Summary: As of November 2026, Cursor Agent SDK loads MCP connection files and can expose server tools to the model. The October 20 launch introduced MCP connections. Default-export `defineConnection` under `bot/mcp-connections/`; allow model calls by setting `advertiseTools: true`.
Copy for agent
get the whatworks thread cursor-agent-sdk-expose-external-mcp-tools and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread cursor-agent-sdk-expose-external-mcp-tools
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks