cursor-delegate-mcp 1.18.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,13 @@
1
1
  # Cursor Delegate
2
2
 
3
- **Keep the brains. Delegate the build.**
3
+ **Stop burning your frontier agent's limits on boilerplate.**
4
+
5
+ Delegate edits to Cursor's CLI agent — your agent writes the brief and reviews the diff.
4
6
 
5
7
  [![npm version](https://img.shields.io/npm/v/cursor-delegate-mcp)](https://www.npmjs.com/package/cursor-delegate-mcp)
6
8
  [![npm downloads](https://img.shields.io/npm/dt/cursor-delegate-mcp)](https://www.npmjs.com/package/cursor-delegate-mcp)
9
+ [![MCP Registry](https://img.shields.io/badge/MCP%20Registry-listed-blue)](https://registry.modelcontextprotocol.io/v0/servers?search=cursor-delegate)
10
+ [![cursor-delegate-mcp MCP server](https://glama.ai/mcp/servers/andreilungeanu/cursor-delegate-mcp/badges/score.svg)](https://glama.ai/mcp/servers/andreilungeanu/cursor-delegate-mcp)
7
11
  [![node](https://img.shields.io/node/v/cursor-delegate-mcp)](https://nodejs.org)
8
12
  [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
13
  [![tests](https://github.com/andreilungeanu/cursor-delegate-mcp/actions/workflows/test.yml/badge.svg)](https://github.com/andreilungeanu/cursor-delegate-mcp/actions/workflows/test.yml)
@@ -20,25 +24,19 @@ Cursor Delegate is the MCP bridge that lets Claude Code, ChatGPT/Codex, Copilot
20
24
 
21
25
  ## 🧠 Frontier quality, kept
22
26
 
23
- Your assistant does what frontier models are actually for: understands the task, writes a precise brief, reviews the finished diff. And **Composer 2.5** holds its own — a seriously capable coding model, just guided and checked by a smarter one. The result reads like frontier work, because a frontier model planned it and signed off on it.
27
+ Your assistant does what frontier models are actually for: understands the task, writes a precise brief, reviews the finished diff. **Composer 2.5** runs the implementation loop under that brief. Nothing lands unreviewed — the agent that scoped the work reads the changed files back before you see them.
24
28
 
25
29
  ## ⚡ Done faster
26
30
 
27
- Composer 2.5 is built for speed. It tears through multi-file edits while a frontier model would still be streaming the first file. You delegate, keep working with your assistant, and the diff shows up done.
31
+ Composer 2.5 is built for throughput on multi-file edits. The whole delegation is one call — brief in, result out — so you review a finished diff instead of babysitting edits landing file by file.
28
32
 
29
33
  ## 🔋 Your limits stop being the bottleneck
30
34
 
31
- Delegated work bills to Composer's **own usage pool** — separate from Cursor's API-priced main quota, and so generous most users never hit its ceiling. Your Claude or Codex subscription spends tokens only on the brief and the review, so the 5-hour window and weekly limits go a lot further. On API? That's the per-token grind moved off your bill.
35
+ Composer and Grok run on their **own usage allowance** on every Cursor plan — separate from the API-priced main quota, and generous enough that most people never reach the ceiling. Your Claude or Codex subscription spends tokens only on the brief and the review, so the 5-hour window and weekly limits go a lot further. Paying per token on API? That grind moves onto Cursor capacity you already have.
32
36
 
33
- ```
34
- You → your agent (plans & reviews)
35
- │ MCP delegate tool
36
- ▼
37
- cursor-agent (Composer 2.5 — implements)
38
- │ edits your workspace
39
- ▼
40
- Clean result: what changed, which files, the plan
41
- ```
37
+ ![You and your agent plan and review; the MCP delegate tool hands the brief to cursor-agent (Composer 2.5), which implements and edits your workspace; a clean result comes back with what changed, which files, and the plan, for your agent to review](assets/flow.png)
38
+
39
+ ![Delegate result payload](assets/result-json.png)
42
40
 
43
41
  ## Features
44
42
 
@@ -46,11 +44,11 @@ You → your agent (plans & reviews)
46
44
  - 💬 **No stalled runs** — if Cursor needs to clarify, it ends the turn and returns the question as a normal result. Your agent reads it and answers by resuming the same session — nothing blocks on a modal waiting for input.
47
45
  - 📦 **Clean, named results** — final answer, changed files, session id, and the plan, returned as one compact JSON payload. Nothing to scrape, nothing to guess.
48
46
  - 📋 **Plan first** — `plan` mode: Cursor drafts a plan, you review it, then the same session implements it.
49
- - 🔍 **Ask anything** — `ask` mode: read-only Q&A over your codebase, zero file changes.
47
+ - 🔍 **Ask anything** — `ask` mode: read-only Q&A over your codebase.
50
48
  - 🩺 **Self-diagnosing** — a `doctor` tool that tells you exactly what's missing if setup isn't right.
51
- - 🔌 **Works everywhere MCP does** — VS Code, JetBrains, Windsurf, Visual Studio, and more.
49
+ - 🔌 **Portable** — plain stdio MCP, so it runs anywhere: VS Code, JetBrains, Windsurf, Visual Studio, and more.
52
50
 
53
- ## Quick start
51
+ ## Install
54
52
 
55
53
  You need [Node.js 20+](https://nodejs.org/) and the [Cursor CLI](https://cursor.com/docs/cli/overview), logged in (`cursor-agent login`).
56
54
 
@@ -80,10 +78,28 @@ codex plugin add cursor-delegate@cursor-delegate-mcp
80
78
  copilot plugin install andreilungeanu/cursor-delegate-mcp
81
79
  ```
82
80
 
83
- ### More clients
81
+ ### Any other MCP client
82
+
83
+ ```json
84
+ {
85
+ "mcpServers": {
86
+ "cursor-delegate": {
87
+ "command": "npx",
88
+ "args": ["-y", "cursor-delegate-mcp"]
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
94
+ ### Client-specific config locations
84
95
 
85
96
  <details>
86
- <summary><strong>VS Code</strong> — <code>.vscode/mcp.json</code></summary>
97
+ <summary><strong>VS Code</strong> — one-click install, or <code>.vscode/mcp.json</code></summary>
98
+
99
+ [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect/mcp/install?name=cursor-delegate&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cursor-delegate-mcp%22%5D%7D)
100
+ [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=cursor-delegate&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cursor-delegate-mcp%22%5D%7D&quality=insiders)
101
+
102
+ Or add it manually:
87
103
 
88
104
  ```json
89
105
  {
@@ -145,20 +161,12 @@ Requires 17.14+. Note the top-level key is `servers`, not `mcpServers`.
145
161
 
146
162
  </details>
147
163
 
148
- ### Kiro, Kilo Code, and any other MCP client
164
+ <details>
165
+ <summary><strong>Kiro, Kilo Code, Zed</strong> — and any other stdio MCP client</summary>
149
166
 
150
- Add the following server to the client's MCP config:
167
+ Use the portable definition above in the client's own MCP config file.
151
168
 
152
- ```json
153
- {
154
- "mcpServers": {
155
- "cursor-delegate": {
156
- "command": "npx",
157
- "args": ["-y", "cursor-delegate-mcp"]
158
- }
159
- }
160
- }
161
- ```
169
+ </details>
162
170
 
163
171
  ## License
164
172
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cursor-delegate-mcp",
3
- "version": "1.18.0",
3
+ "version": "1.19.0",
4
4
  "mcpName": "io.github.andreilungeanu/cursor-delegate-mcp",
5
5
  "type": "module",
6
6
  "description": "Delegate multi-file coding work from Claude Code, Codex, or Copilot to Cursor's CLI agent — structured results, plan mode, and changed files.",
package/src/delegate.js CHANGED
@@ -12,6 +12,7 @@ import { normalizeAgentReportedFiles } from "./agent-reported-files.js";
12
12
  import { makeTurnState } from "./turn-state.js";
13
13
  import { makeError } from "./errors.js";
14
14
  import { PLAN_PRIORITIES, PLAN_STATUSES, TODO_STATUSES } from "./acp-enums.js";
15
+ import { optionsFrom, resolveEffortId, unsupportedWarning } from "./model-options.js";
15
16
 
16
17
  export const DEFAULT_MODEL = "composer-2.5";
17
18
  export const DEFAULT_HANDSHAKE_MS = 60000;
@@ -184,16 +185,25 @@ async function applyConfig(client, sessionId, configId, value) {
184
185
  // The resolved model appears only in a set_config_option reply's configOptions (set_model
185
186
  // returns nothing). Absent for models that reject every option sent — the field then stays off.
186
187
  function servedModelFrom(res) {
187
- const opts = res?.configOptions;
188
- if (!Array.isArray(opts)) return undefined;
188
+ const opts = optionsFrom(res);
189
+ if (opts === undefined) return undefined;
189
190
  const m = opts.find((o) => o?.id === "model");
190
191
  return typeof m?.currentValue === "string" ? m.currentValue : undefined;
191
192
  }
192
193
 
194
+ // Sent under whichever id the model declares. A model that refuses fast leaves no option list;
195
+ // only then are the candidate ids tried in turn.
196
+ async function applyEffort(client, sessionId, value, modelOptions) {
197
+ const id = resolveEffortId(modelOptions, value);
198
+ if (id === undefined) return { applied: false };
199
+ const r = await applyConfig(client, sessionId, id, value);
200
+ return r.unsupported ? { applied: false } : { applied: true, res: r.res };
201
+ }
202
+
193
203
  /**
194
204
  * @param {{
195
205
  * spec?: string, mode?: string, resumeSessionId?: string, workspace?: string,
196
- * model?: string, fast?: boolean, reasoning?: string, context?: string,
206
+ * model?: string, fast?: boolean, effort?: string, context?: string,
197
207
  * contextFiles?: string[], clientFactory?: (opts: any) => any,
198
208
  * idleMs?: number, handshakeMs?: number, hardCapMs?: number, timeoutMs?: number,
199
209
  * onSessionReady?: (sessionId: string, client: any) => void,
@@ -203,7 +213,7 @@ function servedModelFrom(res) {
203
213
  */
204
214
  export async function runDelegate({
205
215
  spec, mode = "agent", resumeSessionId, workspace,
206
- model = DEFAULT_MODEL, fast = false, reasoning, context, contextFiles, clientFactory,
216
+ model = DEFAULT_MODEL, fast = false, effort, context, contextFiles, clientFactory,
207
217
  idleMs, handshakeMs, hardCapMs, timeoutMs,
208
218
  onSessionReady, onProgress, progressThrottleMs = 2000,
209
219
  heartbeatMs = DEFAULT_HEARTBEAT_MS,
@@ -365,15 +375,28 @@ export async function runDelegate({
365
375
  assertKnownModel(client, model);
366
376
  await client.setModel(sessionId, model);
367
377
  // fast is always sent — a resumed session may already have it on, so false is a real
368
- // instruction. reasoning and context go only when the caller named one. Each reply reports
369
- // the now-current model; the last one seen wins.
378
+ // instruction. Its reply carries this model's configOptions, which is where the effort id
379
+ // comes from. effort and context go only when the caller named one. Each reply reports the
380
+ // now-current model; the last one seen wins.
370
381
  const fastResult = await applyConfig(client, sessionId, "fast", fast);
371
- if (fastResult.unsupported && fast) unsupportedOptions.push("fast");
382
+ if (fastResult.unsupported && fast) unsupportedOptions.push({ arg: "fast" });
372
383
  else servedModel = servedModelFrom(fastResult.res) ?? servedModel;
373
- for (const [id, value] of [["reasoning", reasoning], ["context", context]]) {
374
- if (value === undefined) continue;
375
- const r = await applyConfig(client, sessionId, id, value);
376
- if (r.unsupported) unsupportedOptions.push(id);
384
+ let modelOptions = optionsFrom(fastResult.res);
385
+ // A model that refuses fast leaves no list. Re-asserting the model just set is inert, and
386
+ // its reply carries the full list — measured on claude-haiku-4-5, which refuses fast.
387
+ if (modelOptions === undefined && effort !== undefined) {
388
+ const reasserted = await applyConfig(client, sessionId, "model", model);
389
+ modelOptions = optionsFrom(reasserted.res);
390
+ servedModel = servedModelFrom(reasserted.res) ?? servedModel;
391
+ }
392
+ if (effort !== undefined) {
393
+ const applied = await applyEffort(client, sessionId, effort, modelOptions);
394
+ if (!applied.applied) unsupportedOptions.push({ arg: "effort", modelOptions });
395
+ else servedModel = servedModelFrom(applied.res) ?? servedModel;
396
+ }
397
+ if (context !== undefined) {
398
+ const r = await applyConfig(client, sessionId, "context", context);
399
+ if (r.unsupported) unsupportedOptions.push({ arg: "context" });
377
400
  else servedModel = servedModelFrom(r.res) ?? servedModel;
378
401
  }
379
402
  await client.setMode(sessionId, mode);
@@ -441,7 +464,7 @@ export async function runDelegate({
441
464
  // sessionTitle stays out of the result: it is a live label (progress) and a forensic one
442
465
  // (timeout errors), not a fact about the finished turn.
443
466
  if (resumeError) protocolWarnings.push(`resuming ${resumeSessionId} failed, started a fresh session: ${resumeError}`);
444
- for (const id of unsupportedOptions) protocolWarnings.push(`model ${model} has no ${id} option; the requested value was ignored`);
467
+ for (const u of unsupportedOptions) protocolWarnings.push(unsupportedWarning(model, u));
445
468
  protocolWarnings.push(...contextWarnings);
446
469
  if (state.planEntries.length > 0 || state.planOverview !== undefined || state.planDetail !== undefined) {
447
470
  // Sanitize even when the plan is discarded: the warnings it raises report malformed ACP
package/src/doctor.js CHANGED
@@ -4,6 +4,7 @@ import { AcpClient } from "./acp-client.js";
4
4
  import { resolveAcpSpawn } from "./spawn.js";
5
5
  import { treeKill } from "./proc.js";
6
6
  import { readPackageVersion } from "./version.js";
7
+ import { allowedValues } from "./model-options.js";
7
8
 
8
9
  const HANDSHAKE_TIMEOUT_MS = 15_000;
9
10
  const VERSION_PROBE_TIMEOUT_MS = 10_000;
@@ -67,6 +68,12 @@ async function runDeepHandshake({ spawnSpec, clientFactory, workspace, timeoutMs
67
68
  details.models = (client.sessionModels?.availableModels ?? []).map((m) => m?.modelId).filter(Boolean);
68
69
  details.currentModel = client.sessionModels?.currentModelId ?? null;
69
70
  details.modes = (client.sessionModes?.availableModes ?? []).map((m) => m?.id).filter(Boolean);
71
+ // session/new already returned these. currentModel only — any other model needs a set_model
72
+ // first, which this handshake does not send.
73
+ details.currentModelOptions = (client.configOptions ?? [])
74
+ // model and mode are already reported as their own fields.
75
+ .filter((o) => typeof o?.id === "string" && o.id !== "model" && o.id !== "mode")
76
+ .map((o) => ({ id: o.id, values: allowedValues(o) }));
70
77
  })();
71
78
  const timeout = new Promise((_, reject) => {
72
79
  timer = setTimeout(() => {
@@ -0,0 +1,52 @@
1
+ // Config option ids differ per model, and a model rejects any id it does not declare. The set is
2
+ // knowable only once a model is selected, from the configOptions the agent echoes back.
3
+
4
+ // Mirrors cursor-agent's own classifier.
5
+ const THOUGHT_LEVEL_IDS = new Set(["thinking", "reasoning", "effort", "thought_level"]);
6
+
7
+ export function isThoughtLevel(opt) {
8
+ const id = typeof opt?.id === "string" ? opt.id.toLowerCase() : "";
9
+ if (THOUGHT_LEVEL_IDS.has(id)) return true;
10
+ const name = typeof opt?.name === "string" ? opt.name.toLowerCase() : "";
11
+ return /thinking|reasoning|thought/.test(name);
12
+ }
13
+
14
+ export function optionsFrom(res) {
15
+ return Array.isArray(res?.configOptions) ? res.configOptions : undefined;
16
+ }
17
+
18
+ export function allowedValues(opt) {
19
+ return (Array.isArray(opt?.options) ? opt.options : [])
20
+ .map((o) => o?.value)
21
+ .filter((v) => typeof v === "string");
22
+ }
23
+
24
+ function isBoolean(opt) {
25
+ const v = allowedValues(opt).slice().sort();
26
+ return v.length === 2 && v[0] === "false" && v[1] === "true";
27
+ }
28
+
29
+ // Claude declares thinking (true|false) and effort (low|medium|high) together, so the value picks
30
+ // the id. With no match, a non-boolean candidate still goes: the agent's own "Invalid value for X"
31
+ // names the allowed set. A boolean-only model (claude-haiku-4-5 declares just thinking) gets
32
+ // nothing — sending a level there is a guaranteed invalid value, which would fail the run.
33
+ export function resolveEffortId(options, value) {
34
+ const candidates = (Array.isArray(options) ? options : []).filter(isThoughtLevel);
35
+ if (candidates.length === 0) return undefined;
36
+ const pick = candidates.find((o) => allowedValues(o).includes(value))
37
+ ?? candidates.find((o) => !isBoolean(o));
38
+ return typeof pick?.id === "string" ? pick.id : undefined;
39
+ }
40
+
41
+ // effort's id varies per model, so name the ids the model declares. fast and context are sent
42
+ // under their own names.
43
+ export function unsupportedWarning(model, { arg, modelOptions }) {
44
+ if (arg !== "effort") return `model ${model} has no ${arg} option; the requested value was ignored`;
45
+ // No reply carried a list, so claiming the model declares nothing would assert a capability
46
+ // never observed.
47
+ if (modelOptions === undefined) return `effort ignored: ${model} did not report its option list`;
48
+ const ids = modelOptions.filter(isThoughtLevel).map((o) => o?.id).filter(Boolean);
49
+ return ids.length
50
+ ? `effort ignored: ${model} declares ${ids.join(", ")}, which did not take the requested value`
51
+ : `effort ignored: ${model} declares no thinking or reasoning option`;
52
+ }
package/src/server.js CHANGED
@@ -144,12 +144,17 @@ export const delegateInputSchema = z.object({
144
144
  spec: z.string().trim().min(1, "spec must not be blank").describe("Inline task brief (default): goal, scope, decisions already made (constraints and fixed choices — quote the user's exact values verbatim), acceptance criteria. Point at files to read or mimic rather than pasting code. Optional file path if the user wants a persisted spec."),
145
145
  mode: z.enum(["agent", "plan", "ask"]).default("agent").describe("Requested agent mode. plan and ask are passed to the agent as instructions, not enforced by the bridge — the agent may write in any of them, so review the git diff after every run. ask held on every model tested while plan compliance varies by model, so prefer ask when you need the stricter read-only instruction."),
146
146
  resumeSessionId: z.string().optional().describe("Resume an existing ACP session instead of a new one"),
147
- workspace: z.string().optional().describe("Working directory for the agent (defaults to cwd). Must be an existing directory; the call fails rather than creating it."),
148
- model: z.string().trim().min(1, "model must be a non-empty string").default(DEFAULT_MODEL),
147
+ workspace: z.string().optional().describe("Working directory for the agent. Optional; defaults to the server process cwd. Must already exist — never create one for the call."),
148
+ model: z.string().trim().min(1, "model must be a non-empty string").default(DEFAULT_MODEL).describe("Bare ACP family id, version included: composer-2.5, grok-4.5, claude-opus-5, gpt-5.6-sol. doctor deep:true lists every id."),
149
149
  fast: z.boolean().default(false).describe("Fast speed tier — higher cost; enable only when the user asks"),
150
150
  // Which options a model offers, and their valid values, are only knowable by asking the
151
151
  // agent, so these stay open strings and the agent rejects what it does not accept.
152
- reasoning: z.string().trim().min(1).optional().describe("Reasoning effort. Not offered by every model; gpt-5.x accepts none, low, medium, high, extra-high."),
152
+ effort: z.string().trim().min(1).optional().describe("Thinking effort. Not offered by every model, and the values differ; gpt-5.x accepts none, low, medium, high, extra-high. doctor deep:true lists the current model's options."),
153
+ // Declared only to be rejected: an undeclared key is stripped silently, which would lose the
154
+ // requested effort without a word. Rejection costs a retry and no spawn.
155
+ reasoning: z.string().trim().min(1).optional()
156
+ .refine((v) => v === undefined, { message: "reasoning was renamed to effort; pass effort instead" })
157
+ .describe("Removed — use effort."),
153
158
  context: z.string().trim().min(1).optional().describe("Context window size. Not offered by every model; gpt-5.x accepts 272k and 1m."),
154
159
  contextFiles: z.array(z.string()).optional().describe("Paths to attach instead of pasting file contents into spec. Text files are passed as references the agent may open; images (png, jpg, gif, webp, under 5MB) are sent inline. Relative paths resolve against workspace, and paths outside it are allowed — attach only files the agent should read. Anything skipped is reported in protocolWarnings, never fatal."),
155
160
  });
@@ -164,7 +169,7 @@ export const delegateInputSchema = z.object({
164
169
  * @returns {Promise<import("@modelcontextprotocol/sdk/types.js").CallToolResult>}
165
170
  */
166
171
  export async function runDelegateTool({ args, extra, runDelegate, inFlight, seenSessions = new Set() }) {
167
- const { spec, mode, resumeSessionId, workspace, model, fast, reasoning, context, contextFiles } = args;
172
+ const { spec, mode, resumeSessionId, workspace, model, fast, effort, context, contextFiles } = args;
168
173
 
169
174
  const progressToken = extra?._meta?.progressToken;
170
175
  /** @type {(message: string) => void} */
@@ -191,7 +196,7 @@ export async function runDelegateTool({ args, extra, runDelegate, inFlight, seen
191
196
  workspace: workspace || process.cwd(),
192
197
  model,
193
198
  fast,
194
- reasoning,
199
+ effort,
195
200
  context,
196
201
  contextFiles,
197
202
  onProgress,