
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

