cursor-mcp-server
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-mcp-serverCreate a new React component for a todo list in the frontend directory."
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-mcp-server
An MCP server that delegates all code writing to Cursor's Composer 2 (or Grok 4.5) agents. Built so that a PM/orchestrator model - Claude, in the setup this was built for - never writes code directly. It reads context, breaks work into scoped tasks, and calls out to Cursor's agent SDK to actually generate or edit files.
Why
Claude's context window is the scarce resource in an orchestrator workflow. Every line of code Claude writes directly is a line it has to hold, re-read, and pay for in its own token budget - and that budget scales with the size of the feature, not with the complexity of the task description. Delegating code generation to Cursor decouples the orchestrator's cost from output size: a cursor_write_code call costs roughly the same whether Cursor ends up producing 20 lines or 400.
Cursor's per-token pricing is also substantially cheaper than a frontier reasoning model's, so shifting bulk code generation there is a compounding win, not just a context-window trick.
Related MCP server: local-llm-mcp
Architecture
A single MCP server (@modelcontextprotocol/sdk) exposing two tools, both backed by @cursor/sdk's Agent.prompt():
cursor_write_code- delegate creation of new files/featurescursor_edit_code- delegate edits to an existing file
Both tools accept:
Field | Required | Purpose |
| yes | Clear description of what to build/change |
| no | Absolute path to the project root (defaults to the server's cwd) |
| write only | Existing files Composer should read for context |
| edit only | Path to the file being edited |
| no | Architectural decisions, interfaces, or constraints to respect |
| no |
|
| no |
|
The server builds a single prompt from these fields and runs it against Cursor's agent (local mode executes on your machine in workingDirectory; cloud mode runs on Cursor's sandboxed VMs).
Setup
npm install
cp .env.example .env
# edit .env: set CURSOR_API_KEY (Cursor dashboard -> Integrations -> API Keys)
npm run buildEnvironment variables
Variable | Values | Default |
| your Cursor API key | required |
|
|
|
Register with Claude Code / any MCP client
Add to your MCP client config (e.g. .mcp.json or claude mcp add):
{
"mcpServers": {
"cursor-coder": {
"command": "node",
"args": ["/absolute/path/to/cursor-mcp-server/dist/index.js"],
"env": { "CURSOR_API_KEY": "your_cursor_api_key_here" }
}
}
}Model selection
composer(default) - Composer 2. Fast and reliable for well-specified, mechanical tasks: CRUD, scaffolding, small edits, following an already-clear pattern.grok- Grok 4.5. More capable, more expensive. Reserve for complex reasoning, tricky refactors, architecture-sensitive changes, or when a Composer run came back wrong/confused. Useeffort: "high"for the hardest cases.
Orchestrator contract
This server is meant to be paired with a system prompt / CLAUDE.md that hard-gates code generation through it:
You are the architect and project manager. Cursor Composer 2 is your
code-writing sub-agent.
- NEVER write code yourself. No code blocks, no file edits.
- For ALL code generation -> call cursor_write_code.
- For ALL code edits -> call cursor_edit_code.
- You MAY read files to understand context before delegating.
- You MAY review Composer's output and ask it to revise via another
tool call.The orchestrator's job stays: breaking tasks into scoped sub-tasks, defining interfaces/contracts before Composer writes them, reviewing output for correctness, and deciding what to build next. The actual code generation runs entirely inside Cursor's agent loop.
Always independently re-verify what comes back. Don't trust a completion message at face value - open the file, run the tests, check the diff. A sub-agent's self-reported "done" is not evidence.
Scripts
Command | Purpose |
| Run with |
| Compile TypeScript to |
| Run the compiled server |
License
MIT - see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables AI assistants to delegate specific tasks to specialized sub-agents (e.g., test-writer, code-reviewer). Supports both Cursor and Claude Code with custom agent definitions.178294MIT
- AlicenseBqualityCmaintenanceEnables coding agents like Claude Code and Codex to offload boilerplate generation, summarization, and other bounded text tasks to local or cheap cloud LLMs, keeping the frontier agent in charge of judgment and code edits.92MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI to delegate boilerplate, drafts, tests, and refactors to free LLM providers, saving tokens and running tasks in parallel.204MIT
- AlicenseAqualityBmaintenanceLets your primary coding agent delegate grunt work to a cheaper model via OpenCode, enabling cost-effective task distribution.5MIT
Related MCP Connectors
Coding agents from Claude Code, Cursor and Codex claim jobs and lock files on one shared board.
The team layer for AI coding agents: shared contracts, collision alerts, E2EE sessions.
Coding agents build full-stack apps in persistent workspaces and share them by link.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Villarley/cursor-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server