cursor-sdk-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cursor-sdk-mcprun a cursor agent to add error handling to src/api.ts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cursor-sdk-mcp
An MCP (Model Context Protocol) server that lets MCP clients such as Claude Code invoke the Cursor SDK and use Cursor Agent capabilities — running a Cursor coding agent against a working directory, listing models, and continuing agent conversations — all as tools.
What it does
The server speaks MCP over stdio and exposes these tools:
Tool | Description |
| Verify the configured Cursor API key and return the authenticated identity. |
| List the Cursor models available to the account. |
| Run a Cursor Agent (local runtime) against a |
| Continue a previous agent conversation by |
Under the hood it uses @cursor/sdk's local runtime: the agent loop runs in this Node process
and reads/writes files on disk, while inference runs on Cursor's hosted models.
Related MCP server: @willpowell8/cursor-cloud-agent-mcp
Requirements
Node.js >= 22.13 (required by
@cursor/sdk).A Cursor API key. Create one at the Cursor Dashboard → API Keys (user key) or Team settings (service account key).
Install & build
npm install
npm run buildConfigure
Set your API key (see .env.example):
export CURSOR_API_KEY="your-cursor-api-key"
# Optional: default model id used when a tool call omits one (default: "auto")
export CURSOR_MCP_DEFAULT_MODEL="auto"Use with Claude Code
Register the server with Claude Code (stdio):
claude mcp add cursor-sdk -- node /absolute/path/to/cursor-sdk-mcp/dist/index.jsOr add it to your MCP client config manually:
{
"mcpServers": {
"cursor-sdk": {
"command": "node",
"args": ["/absolute/path/to/cursor-sdk-mcp/dist/index.js"],
"env": { "CURSOR_API_KEY": "your-cursor-api-key" }
}
}
}Then ask Claude Code to, for example, "use the cursor agent to refactor src/auth.ts", and it will
call cursor_run_agent.
Development
npm run dev # run from source with hot reload (tsx)
npm run typecheck # type-check only
npm run lint # eslint
npm test # integration tests (fake Cursor backend, no network)
npm run demo # spawn the built server over stdio and call its tools
RUN_AGENT=1 npm run demo # additionally run a real Cursor Agent (needs CURSOR_API_KEY)How it's structured
src/cursor.ts—CursorServiceinterface +CursorSdkService(the@cursor/sdkwrapper).src/server.ts— builds theMcpServerand registers the four tools. Decoupled from the SDK viaCursorServiceso tests can inject a fake backend.src/index.ts— entry point; wires the real service to aStdioServerTransport.tests/server.test.ts— connects an in-memory MCP client to the server and exercises every tool.examples/demo-client.ts— end-to-end demo over a real stdio transport.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/newxun/cursor-sdk-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server