
Cursor Mcp
io.github.qmediatv1.2.0更新於 Oct 6, 2026
Cursor's agent (cursor-agent CLI) through MCP: any model your plan offers, resumable sessions.
概覽
封裝 Cursor CLI 代理,讓助理能執行 Cursor 編碼提示、接續工作階段、列出模型並檢查安裝狀態。
- 功能
- 圍繞本機 cursor-agent CLI 提供五個工具:cursor_agent 以指定模型與模式執行提示,cursor_reply 接續既有工作階段,cursor_models 列出已安裝 CLI 提供的模型 id,cursor_sessions 列出此伺服器執行個體的工作階段,cursor_health 檢查安裝、驗證與設定。以串流 JSON 回傳工作階段 id、模型、耗時、工具呼叫次數與變更的檔案,並發送進度通知。以號誌限制同時執行的代理程序數量。
- 適用情境
- 適合讓助理把編碼或程式碼審查工作交給 Cursor 代理執行,包括同時執行多個模型,或讓 Claude Code 擔任監督者、由 Cursor 模型負責寫程式。也適合唯讀的規劃或探索模式。
- 執行需求
- 需要 Node.js 22 或更新版本,並安裝與驗證 Cursor CLI,使用包含代理用量的 Cursor 帳戶。以 stdio 在本機執行,通常透過 npx 或全域安裝。選用環境變數:CURSOR_MAX_CONCURRENCY、CURSOR_ALLOW_YOLO、CURSOR_SANDBOX、CURSOR_KILL_GRACE_MS。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Cursor Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@qmediat.io/cursor-mcp
[npm version] [License: MIT] [TypeScript]
MCP server for the Cursor CLI (cursor-agent): run Cursor's agent with any model id your plan offers — the Composer, Claude, GPT, Gemini and Grok families — through the Model Context Protocol.
Why this server?
- Any Cursor model — the
modelid is passed tocursor-agent --modelas given;cursor_modelslists what your CLI offers (Composer, Claude, GPT, Gemini, Grok families on your plan) - 5 tools — agent execution, session continuation, model listing, session listing, health check
- Parallel execution — run multiple models simultaneously with built-in concurrency control (semaphore)
- Guarded execution —
spawnwithout a shell, auto-approve only through the operator's environment (never a tool parameter), the client's cancellation and the timeout kill the child and its process group (SIGTERM, SIGKILL 5 s later; on Windows cursor-agent itself only) - Minimal dependencies — only
@modelcontextprotocol/sdk+zod - Session management — resume conversations across calls
Quick Start
Prerequisites
- Node.js >= 22.0.0
- Cursor CLI installed and authenticated:
Requires Node.js 22 or newer.
Install
or by hand (below). npm install -g @qmediat.io/cursor-mcp installs the cursor-mcp command, which can replace the npx line in any config.
Configuration
Claude Code (~/.claude.json)
Claude Desktop (claude_desktop_config.json)
Local development
Environment Variables
Available Tools
Both agent tools run cursor-agent with --output-format stream-json: the answer, its session_id, request_id, the model cursor-agent reported, the duration, the number of tool calls and the files changed (write/edit targets, each once) come back as text and as structuredContent (outputSchema published). A client that sends a progress token on the request gets one notifications/progress per event (model, tool call, assistant message), so a ten-minute run never looks dead.
Models
model is passed to cursor-agent --model as given, so every id the installed CLI accepts works — the current list and prices are on cursor.com/docs/models-and-pricing, and cursor_models returns what your CLI reports (cursor-agent models). auto (the default) lets Cursor choose. This README names no ids on purpose: Cursor adds and retires models faster than this package releases, and a list here was what made 1.0.x reject every current model.
Modes
Parallel Execution
Run multiple models simultaneously by making parallel tool calls:
The built-in semaphore (default: 3) queues excess requests to prevent rate limit errors.
Security
- No shell execution —
child_process.spawnwith argument arrays; the prompt follows a--separator and the session id must be one word, so neither can read as acursor-agentoption (a prompt or session id of-fcannot turn into--force) - No credentials stored — cursor-agent handles its own OAuth
- No HTTP requests — pure CLI wrapper, no network access beyond cursor-agent
- Process cleanup — the client's cancellation (the MCP request signal) and the timeout kill the child and the helpers in its process group (POSIX; on Windows there is no group and only cursor-agent itself is signalled): SIGTERM, then SIGKILL after
CURSOR_KILL_GRACE_MS(5 s); the call and its concurrency slot are released only once the child itself has exited; the server's own shutdown ends every running group the same way, so no agent outlives it - Auto-approve gated —
--forcerequires explicitCURSOR_ALLOW_YOLO=trueenv var, never controllable by LLMs; without it the agent only proposes changes;CURSOR_SANDBOX=enabledconfines an auto-approved agent; it applies tocursor_agentandcursor_replyalike - Trusted workspace — every call runs
cursor-agent --truston the givenworkspace(the server's cwd by default), so the agent is not prompted about the directory: pointworkspaceonly at directories you intend it to operate in - Concurrency limited — semaphore prevents resource exhaustion
See SECURITY.md for full details.
Supervised Coding Skill
Optional Claude Code skill that lets Claude Code act as a supervisor while any Cursor model does the coding.
How it works: Claude Code analyzes the task, sends precise instructions to Cursor via cursor_agent, reviews the output by reading actual files from disk, and iterates with cursor_reply until satisfied (max 3 rounds).
Prerequisite: The
cursor-cliMCP server (this package) must be installed and configured in Claude Code first.
Usage
Run cursor_models to list the ids your CLI offers.
Install the skill
Create ~/.claude/skills/cursor-code/SKILL.md with the following content:
SKILL.md (click to expand)
Restart Claude Code after creating the skill file.
Development
See CONTRIBUTING.md for guidelines; npm test builds and runs the smoke and argv tests.
Trademarks and affiliation
Cursor is a trademark of Anysphere. This is an independent, community-maintained integration published by Quantum Media Technologies sp. z o.o.; it is not affiliated with, sponsored by or endorsed by Anysphere. Use of the Cursor API or CLI through this server is subject to Anysphere's own terms and to your own API key or account.
License
MIT - Quantum Media Technologies sp. z o.o.
Made by Quantum Media Technologies · more open source from qmediat
來源:README.md,提交 8fc3256
工具
0版本歷史
1- v1.2.0最新Oct 6, 2026

