cursor-mcp-server
cursor-mcp-server
CursorのComposer 2(またはGrok 4.5)エージェントにすべてのコード作成を委任するMCPサーバーです。PM/オーケストレーターモデル(このサーバーが作られたセットアップではClaude)がコードを直接書かないように設計されています。コンテキストを読み、作業をスコープ単位のタスクに分割し、CursorのエージェントSDKを呼び出して実際にファイルを生成・編集します。
理由
オーケストレーターワークフローにおいて、Claudeのコンテキストウィンドウは希少リソースです。Claudeが直接書くコードの1行1行は、保持し、読み返し、自身のトークンバジェットを消費する行でもあります。そしてそのバジェットは、タスク記述の複雑さではなく、フィーチャーの規模に応じて拡大します。コード生成をCursorに委任することで、オーケストレーターのコストは出力サイズから切り離されます。cursor_write_codeの呼び出しは、Cursorが最終的に20行を生成するか400行を生成するかにかかわらず、ほぼ同じコストです。
また、Cursorのトークン単価はフロンティア推論モデルよりも大幅に安いため、大量のコード生成をそちらへ移すことは、コンテキストウィンドウのトリックに留まらない複利的な利得をもたらします。
Related MCP server: local-llm-mcp
アーキテクチャ
単一のMCPサーバー(@modelcontextprotocol/sdk)が2つのツールを公開しており、どちらも@cursor/sdkのAgent.prompt()を利用しています:
cursor_write_code- 新規ファイル/フィーチャーの作成を委任cursor_edit_code- 既存ファイルへの編集を委任
両ツールとも以下のフィールドを受け付けます:
フィールド | 必須 | 目的 |
| 必須 | 何を構築・変更するかの明確な説明 |
| 任意 | プロジェクトルートへの絶対パス(デフォルトはサーバーのcwd) |
| 書き込み時のみ | Composerがコンテキストとして読む既存ファイル |
| 編集時のみ | 編集対象ファイルへのパス |
| 任意 | 尊重すべきアーキテクチャ上の決定事項、インターフェース、制約 |
| 任意 |
|
| 任意 |
|
サーバーはこれらのフィールドから単一のプロンプトを構築し、Cursorのエージェントに対して実行します(localモードはあなたのマシン上のworkingDirectory内で実行され、cloudモードはCursorのサンドボックス化されたVM上で実行されます)。
セットアップ
npm install
cp .env.example .env
# edit .env: set CURSOR_API_KEY (Cursor dashboard -> Integrations -> API Keys)
npm run build環境変数
変数 | 値 | デフォルト |
| あなたのCursor APIキー | 必須 |
|
|
|
Claude Code / 任意のMCPクライアントへの登録
MCPクライアントの設定(例:.mcp.jsonまたは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" }
}
}
}モデル選択
composer(デフォルト)- Composer 2。明確に仕様化された機械的なタスクに高速かつ信頼性があります:CRUD、スキャフォールディング、小規模な編集、すでに明確なパターンに従う作業などです。grok- Grok 4.5。より高性能で、より高コストです。複雑な推論、難しいリファクタリング、アーキテクチャに影響する変更、またはComposerの実行結果が間違っていた・混乱していた場合に取っておきます。最も難しいケースにはeffort: "high"を使用します。
オーケストレーター契約
このサーバーは、コード生成をこのサーバー経由に強制するシステムプロンプト / CLAUDE.mdと組み合わせて使用することを想定しています:
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.オーケストレーターの役割は変わりません:タスクをスコープ単位のサブタスクに分割し、Composerがコードを書く前にインターフェース/契約を定義し、出力の正確性をレビューし、次に何を構築するかを決定します。実際のコード生成は完全にCursorのエージェントループ内で実行されます。
返ってきた結果は常に独立して再検証してください。 完了メッセージを額面どおり信じないでください。ファイルを開き、テストを実行し、diffを確認してください。サブエージェントが自己申告する「完了」は証拠ではありません。
スクリプト
コマンド | 目的 |
|
|
| TypeScriptを |
| コンパイル済みサーバーを実行 |
ライセンス
MIT - 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