cursor-dispatcher
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-dispatcherhave cursor scaffold a fastify server under ./demo."
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-dispatcher
An MCP server + Claude Code plugin that lets Claude spawn Cursor subagents as async, bounded workers.
Claude delegates a task, gets a run_id back immediately, and continues talking to the user. When the subagent finishes, a plugin hook injects the outcome into Claude's next turn — no polling, no blocked chat.
The original design spec lives in
PRD.md.
What it does
Spawn Cursor subagents on demand (
spawn_subagent).Message them mid-run via
--resume=<chat_id>(send_subagent_message).Stream their NDJSON events to disk as they run (readable via
get_subagent_eventsor thesubagent://<run_id>/eventsMCP resource).Synthesize a structured completion payload — status, summary, artifacts (file edits + shell tool calls with stdout/stderr) — via
get_subagent_result.Cancel, list, prune.
Retain run history under
~/.claude-cursor-harness/with tiered compression (7d → gzip, 14d → delete) and an LRU cap.Notify Claude asynchronously via an
UserPromptSubmithook so subagent completions surface without polling.Preflight cursor-agent auth on startup + every spawn; refuses with an actionable error if not logged in.
Related MCP server: cursor-mcp-server
Requirements
Node ≥ 20 (for the MCP server)
cursor-agentinstalled on$PATH, authenticated viacursor-agent loginorCURSOR_API_KEYenv varClaude Code (for the plugin — hooks, skill, slash command)
Install
Public (via GitHub marketplace)
From inside Claude Code:
/plugin marketplace add ppetko98/cursor-dispatcher
/plugin install cursor-dispatcher@cursor-dispatcher
/reload-pluginsThat's it — Claude Code clones the repo, wires up the MCP server, hook, skill, and slash command. You still need cursor-agent installed on $PATH and authenticated (see /cursor-login).
Local (for dev)
git clone https://github.com/ppetko98/cursor-dispatcher.git
cd cursor-dispatcher
npm install
npm run build
# From Claude Code:
/plugin marketplace add /absolute/path/to/cursor-dispatcher
/plugin install cursor-dispatcher@cursor-dispatcher
/reload-pluginsThen verify:
/mcp # cursor-dispatcher should be listed
/hooks # UserPromptSubmit → on-user-prompt.mjs
Skill: cursor-dispatcher:cursor-subagent
Slash: /cursor-loginWithout the plugin (MCP-only)
If you only want the MCP tools without the hook + skill:
claude mcp add cursor-dispatcher -- node /absolute/path/to/cursor-dispatcher/dist/server.jsUsage (from Claude)
Typical delegation flow, driven by the shipped cursor-subagent skill:
You: "have cursor scaffold a fastify server under
./demo."Claude: calls
spawn_subagent({ prompt: "...", cwd: "...", permission: "auto" })→ returnsrun_idinstantly. Tells you it's running and moves on.Subagent runs
cursor-agent -p --output-format stream-json --resume-supportin the background, streaming NDJSON events to~/.claude-cursor-harness/runs/<run_id>/events.ndjson.You send any next message — the
UserPromptSubmithook scans for terminal transitions and prependsSUBAGENT <id> → completed — <summary>to your prompt.Claude sees the update inline in the very next turn and reports back with the outcome (files edited, shell output, etc.).
Follow-ups on the same run use send_subagent_message — it re-invokes cursor-agent --resume=<chat_id> so the subagent picks up where it left off.
Permission model
The harness maps the parent Claude session's own posture to Cursor's approval flags:
| Cursor flags | When to pick |
|
| Parent Claude is in plan / read-only mode. Subagent cannot write files or run shell commands. |
|
| Default. Server-side classifier auto-approves safe tool calls; unsafe ones would prompt (and effectively hang in headless mode). |
|
| Fully autonomous. Use only when the user has explicitly said "let it rip." |
Model must come from an allowlist (default: auto, gpt-5.2, claude-opus-5-thinking-high, claude-opus-4-8-thinking-high, composer-2.5). Working directory must live under a configured root (default ~/workspace).
MCP tools
All tools live under the cursor-dispatcher MCP server.
Tool | Purpose |
| Launch a new subagent. Returns |
| Send a follow-up message to a run (resumes the same Cursor chat). |
| Cheap poll: status + last event id + current turn. |
| Fetch NDJSON events since a given |
| Terminal-run completion payload: |
| Filterable list of runs known to the harness. |
| SIGTERM the child. |
| Manual cleanup: |
Resources are exposed at subagent://<run_id>/status and subagent://<run_id>/events, with notifications/resources/updated fired on each new batch of events.
Configuration
Precedence: env var > ~/.claude-cursor-harness/config.json > built-in defaults.
Example config file:
{
"runtime": { "cursorBin": "cursor-agent" },
"policy": {
"models": ["auto", "gpt-5.2"],
"defaultModel": "auto",
"cwdRoot": "/Users/you/workspace",
"sandbox": "enabled"
},
"retention": {
"compressAfterDays": 7,
"maxAgeDays": 14,
"maxRuns": 200,
"pruneOnStartup": true,
"pruneOnSpawn": true
}
}Env-var overrides:
Env | Config path |
| root data dir (default |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| cursor-agent auth (bypasses login) |
Retention
Each run's data lives under ~/.claude-cursor-harness/runs/<run_id>/:
runs/<run_id>/
├── meta.json # RunMeta (status, model, chat_id, session, summary, retention state)
├── events.ndjson # NDJSON of every parsed cursor-agent event
├── messages.ndjson # Parent ↔ subagent message log
└── artifacts/ # Reserved for future materialized outputsLifecycle:
0–7 days: kept fully.
7–14 days:
events.ndjsonandmessages.ndjsongzipped in place.meta.jsongainsretentionState: "compressed",compressedAt, and a materializedsummaryso it stays self-describing.get_subagent_resultstill works —readEventstransparently gunzips.>14 days: entire run dir deleted.
LRU: if more than
maxRunsterminal survivors remain, the oldest (byendedAt) are deleted regardless of age.Non-terminal runs are never touched.
Triggers: startup (registry.load), after every spawn_subagent, and on-demand via prune_subagents.
The plugin bundle
Under plugin/:
MCP server — same code that ships as
dist/server.js.Skill
cursor-subagent(plugin/skills/cursor-subagent/SKILL.md) — teaches Claude the non-blocking pattern, permission mapping, and follow-up flow.Slash command
/cursor-login(plugin/commands/cursor-login.md) — walks the user through interactive login orCURSOR_API_KEYsetup.Hook
UserPromptSubmit(plugin/hooks/on-user-prompt.mjs) — before each of your prompts, scans for new terminal transitions and injects a summary block. Filters to this Claude Code session where possible; falls back to reporting mismatched-session runs as[unlinked]so nothing is silently missed.
Development
npm install
npm run build # tsc
npm test # vitest (34 tests)
npm run lint # tsc --noEmitRepo layout:
src/
├── server.ts # MCP stdio entrypoint
├── config.ts # Config layer (env + config.json)
├── session.ts # Per-server session id resolver
├── types.ts
├── runtime/
│ ├── runner.ts # Cursor CLI child process
│ ├── registry.ts # In-memory + disk-backed run registry
│ ├── storage.ts # ~/.claude-cursor-harness/ layout + gzip helpers
│ ├── events.ts # NDJSON parser, summary + artifact synthesis
│ ├── cleanup.ts # Retention engine (compress/delete/LRU)
│ ├── auth.ts # cursor-agent status preflight
│ └── notifier.ts # MCP notifications helpers
├── tools/ # One file per MCP tool
└── policy/ # Model allowlist, sandbox, cwd whitelist
plugin/
├── .claude-plugin/plugin.json
├── skills/cursor-subagent/SKILL.md
├── commands/cursor-login.md
└── hooks/on-user-prompt.mjs
tests/Known limitations
Session linking is loose. Claude Code doesn't expose a shared session id to child MCP servers, so runs stamped with the MCP server's random UUID rarely match the session id Claude Code injects into the hook. The hook falls back to reporting these as
[unlinked]so nothing is missed — noisy if you run concurrent Claude sessions.True mid-silence wake-up isn't possible. MCP notifications reach the client but Claude Code doesn't (currently) auto-invoke the model on them. Subagent completions surface on your next prompt, not asynchronously.
spawn_subagentrequires a working cursor-agent + auth. No queueing, no retry. If cursor-agent isn't installed or not authenticated, the tool call fails with a clear message pointing at/cursor-login.
License
PolyForm Noncommercial 1.0.0 — free for personal, research, educational, hobbyist, and other noncommercial use (including noncommercial open-source projects, charities, and government/academic institutions). Commercial use, hosting-as-a-service, and repackaging for resale are not permitted. If you want to use this in a for-profit setting, open an issue to discuss a commercial license.
Note: "noncommercial" here does not meet the OSI's Open Source Definition (which forbids field-of-use restrictions); this is a source-available 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
- AlicenseAqualityDmaintenanceMCP server that spawns autonomous Claude Code agents in GitHub repos, enabling task delegation with persistent state, multi-step workflows, and job monitoring.Last updated473162Apache 2.0
- Flicense-qualityDmaintenanceAn MCP server wrapping the Cursor CLI agent, enabling Claude Code and other MCP clients to delegate tasks to Cursor's AI agent for file writing, bash commands, and codebase queries.Last updated
- Alicense-qualityDmaintenanceAn MCP server that enables Claude to orchestrate multiple autonomous Claude Code agents working in parallel across different projects, with tools to dispatch, monitor, and manage their progress.Last updated191MIT
- Alicense-qualityFmaintenanceAn MCP server that enables Cursor to delegate complex, multi-step tasks to specialized subagents, including general-purpose and explore agents, with automatic discovery of existing Claude subagents.Last updated41MIT
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
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/ppetko98/cursor-dispatcher'
If you have feedback or need assistance with the MCP directory API, please join our Discord server