cursor-delegate-mcp 1.11.1 → 1.12.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/PRIVACY.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Privacy
2
2
 
3
- Cursor Delegate MCP runs as a local stdio MCP server. The project author does not operate a backend for the plugin and does not receive your code, prompts, workspace contents, session identifiers, diagnostics, or usage telemetry.
3
+ Cursor Delegate runs as a local stdio MCP server. The project author does not operate a backend for the plugin and does not receive your code, prompts, workspace contents, session identifiers, diagnostics, or usage telemetry.
4
4
 
5
5
  Claude Code installs run the server bundled in the plugin cache. On first session, the plugin may run `npm install --omit=dev` inside that cache to fetch its open-source runtime dependencies; it does not install them into your project. Codex, Copilot, VS Code, and standalone MCP configurations start the published package through `npx`, so npm may apply its own registry logging under npm's policies.
6
6
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cursor Delegate MCP
1
+ # Cursor Delegate
2
2
 
3
3
  **Keep the brains. Delegate the build.**
4
4
 
@@ -8,7 +8,7 @@
8
8
  [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
9
  [![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)
10
10
 
11
- <img src="assets/logo-light.png" alt="Cursor Delegate MCP logo" width="150" align="left" hspace="15">
11
+ <img src="assets/logo-light.png" alt="Cursor Delegate logo" width="150" align="left" hspace="15">
12
12
 
13
13
  Use your best coding agent where its judgment matters most: understanding the task, shaping the plan, and reviewing the result.
14
14
 
@@ -88,7 +88,7 @@ copilot plugin install andreilungeanu/cursor-delegate-mcp
88
88
  ```json
89
89
  {
90
90
  "servers": {
91
- "cursor-delegate-mcp": {
91
+ "cursor-delegate": {
92
92
  "type": "stdio",
93
93
  "command": "npx",
94
94
  "args": ["-y", "cursor-delegate-mcp"]
@@ -114,7 +114,7 @@ Under **Settings → Tools → AI Assistant → Model Context Protocol (MCP)**,
114
114
  ```json
115
115
  {
116
116
  "mcpServers": {
117
- "cursor-delegate-mcp": {
117
+ "cursor-delegate": {
118
118
  "command": "npx",
119
119
  "args": ["-y", "cursor-delegate-mcp"]
120
120
  }
@@ -132,7 +132,7 @@ Heads-up: Cascade caps you at 100 tools across all servers.
132
132
  ```json
133
133
  {
134
134
  "servers": {
135
- "cursor-delegate-mcp": {
135
+ "cursor-delegate": {
136
136
  "type": "stdio",
137
137
  "command": "npx",
138
138
  "args": ["-y", "cursor-delegate-mcp"]
@@ -152,7 +152,7 @@ Add the following server to the client's MCP config:
152
152
  ```json
153
153
  {
154
154
  "mcpServers": {
155
- "cursor-delegate-mcp": {
155
+ "cursor-delegate": {
156
156
  "command": "npx",
157
157
  "args": ["-y", "cursor-delegate-mcp"]
158
158
  }
package/SECURITY.md CHANGED
@@ -11,7 +11,7 @@ Treat every `delegate` call like handing an engineer write access to that tree.
11
11
  ## Recommendations
12
12
 
13
13
  - Point `workspace` at the smallest directory that contains the task (not `$HOME` or `/`).
14
- - Review `filesReportedByAgent` and the git diff before committing.
14
+ - Review `filesReportedByEditTools` and the git diff before committing.
15
15
  - Use `mode: "plan"` when you only want a plan, not file changes.
16
16
  - Run verification (tests, lint) after delegation — the delegate skill asks Claude to do
17
17
  this, but automated gates in CI are still your backstop.
package/TERMS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Terms of Use
2
2
 
3
- Cursor Delegate MCP is provided under the MIT License on an "as is" basis, without warranties or guarantees.
3
+ Cursor Delegate is provided under the MIT License on an "as is" basis, without warranties or guarantees.
4
4
 
5
5
  The plugin runs locally and starts `cursor-agent` with access to the workspace selected for a delegation. Delegated agent-mode tasks may create, modify, or delete files. You are responsible for choosing an appropriate workspace, reviewing changes, protecting credentials, and complying with the terms that apply to Cursor, your MCP host, and any model you select.
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cursor-delegate-mcp",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "type": "module",
5
5
  "description": "MCP server bridging AI coding hosts to cursor-agent over the Agent Client Protocol (ACP).",
6
6
  "license": "MIT",
package/src/acp-client.js CHANGED
@@ -58,8 +58,13 @@ export class AcpClient extends EventEmitter {
58
58
  log: (e) => this.emit("ack", e),
59
59
  });
60
60
  return new Promise((resolve, reject) => {
61
- this.child.once("error", (e) =>
62
- reject(new Error(`Failed to spawn agent (${command}): ${e.message}. Install Cursor CLI and run 'cursor-agent login'.`)));
61
+ this.child.once("error", (e) => {
62
+ // Tagged like every other failure class so the caller gets
63
+ // "delegate failed [spawn-failed]: ..." instead of the one untagged prose error.
64
+ const err = new Error(`Failed to spawn agent (${command}): ${e.message}. Install Cursor CLI and run 'cursor-agent login'.`);
65
+ err.reason = "spawn-failed";
66
+ reject(err);
67
+ });
63
68
  this.child.once("spawn", () => resolve());
64
69
  });
65
70
  }
package/src/delegate.js CHANGED
@@ -462,9 +462,12 @@ export async function runDelegate({
462
462
  if (up.sessionUpdate === "current_mode_update" && up.currentModeId && up.currentModeId !== mode) {
463
463
  modeChanged = { from: mode, to: up.currentModeId };
464
464
  }
465
- // The agent names the turn a beat after the prompt lands ("File Creator"). Cheap
466
- // label for a caller juggling several delegations.
465
+ // The agent names the turn a beat after the prompt lands ("File Creator"). Useful as an
466
+ // ephemeral label while several delegations run, and in timeout forensics — but not in
467
+ // the result, where it arrives after there is nothing left to tell apart and has been
468
+ // measured contradicting the answer ("No Image Detected" on a turn describing an image).
467
469
  if (up.sessionUpdate === "session_info_update" && typeof up.title === "string" && up.title) {
470
+ if (up.title !== sessionTitle) { try { onProgress?.(`turn titled: ${up.title}`.slice(0, 200)); } catch {} }
468
471
  sessionTitle = up.title;
469
472
  }
470
473
  if (up.sessionUpdate === "agent_thought_chunk" && up.content?.text) {
@@ -623,17 +626,27 @@ export async function runDelegate({
623
626
  }
624
627
  const out = {
625
628
  result,
626
- resultSource,
627
- finalMessageAvailable,
628
629
  sessionId,
629
- filesReportedByAgent: normalizeAgentReportedFiles([...touched], workspace),
630
- resumed: !!resumeSessionId && sessionId === resumeSessionId,
631
630
  };
631
+ // Like every other collection here, absence means "nothing reported": an empty list on
632
+ // every read-only turn read as a claim that nothing changed, which this field cannot make
633
+ // (shell-driven edits leave no diff event).
634
+ const filesReported = normalizeAgentReportedFiles([...touched], workspace);
635
+ if (filesReported.length) out.filesReportedByEditTools = filesReported;
636
+ // resultSource is a caveat, not a fact worth stating on every turn: on the happy path
637
+ // (post-tool / tool-free-stream) result is simply the answer, so say nothing. Surface it only
638
+ // when it warns — pre-tool-fallback, plan-detail, none. finalMessageAvailable is dropped
639
+ // outright: it stated the same thing in a second boolean. resumed is emitted only when a
640
+ // resume actually took; a fresh session or a failed resume (which carries its own warning)
641
+ // leaves it absent.
642
+ if (resultSource !== "post-tool" && resultSource !== "tool-free-stream") out.resultSource = resultSource;
643
+ if (!!resumeSessionId && sessionId === resumeSessionId) out.resumed = true;
632
644
  if (stopReason !== undefined) out.stopReason = stopReason;
633
645
  // Elicitation almost never fires (the agent tends to ask in prose and end the turn), so an
634
646
  // always-empty array is steady noise. Report it only when a question actually came through.
635
647
  if (questionsAsked.length) out.questionsAsked = questionsAsked;
636
- if (sessionTitle) out.sessionTitle = sessionTitle;
648
+ // sessionTitle stays out of the result: it is a live label (progress) and a forensic one
649
+ // (timeout errors), not a fact about the finished turn.
637
650
  if (resumeError) protocolWarnings.push(`resuming ${resumeSessionId} failed, started a fresh session: ${resumeError}`);
638
651
  for (const id of unsupportedOptions) protocolWarnings.push(`model ${model} has no ${id} option; the requested value was ignored`);
639
652
  protocolWarnings.push(...contextWarnings);
@@ -645,14 +658,27 @@ export async function runDelegate({
645
658
  if (dropPlanDetail) delete out.plan.detail;
646
659
  }
647
660
  // Most successful turns emit no todos at all, so an empty list would read as "nothing
648
- // done" rather than "not tracked". Report only what the agent actually sent.
649
- if (sawTodoFrame) Object.assign(out, sanitizeTodos(protocolWarnings));
661
+ // done" rather than "not tracked". Report only what the agent actually sent — and of
662
+ // that, the full list only when it says something todoProgress cannot: which items
663
+ // remain. On a fully-completed turn the list restates the counts entry by entry.
664
+ if (sawTodoFrame) {
665
+ const { todos: todoList, todoProgress } = sanitizeTodos(protocolWarnings);
666
+ out.todoProgress = todoProgress;
667
+ if (todoProgress.completed < todoProgress.total) out.todos = todoList;
668
+ }
650
669
  if (writeCapableActivity.length) {
651
670
  out.writeCapableActivity = writeCapableActivity;
671
+ // "the diff for what changed" overclaims when every entry is a pathless execute — live
672
+ // runs drew the same warning for read-only commands (git log, git show, ls -la) as for
673
+ // a real write. Hedge when nothing reported a path.
674
+ const anyPath = writeCapableActivity.some((a) => a.path);
652
675
  protocolWarnings.push(
653
676
  `mode ${mode} asked the agent not to change anything, but it ran ${writeCapableActivity.length}`
654
677
  + ` write-capable tool call${writeCapableActivity.length === 1 ? "" : "s"} — see writeCapableActivity`
655
- + " for what ran, and the diff for what changed."
678
+ + " for what ran"
679
+ + (anyPath
680
+ ? ", and the diff for what changed."
681
+ : "; none reported touching a file, so this may be read-only activity — check the git diff to confirm nothing changed.")
656
682
  );
657
683
  }
658
684
  if (modeChanged) {
@@ -694,9 +720,11 @@ export async function runDelegate({
694
720
  }
695
721
  if (sessionId) err.message += ` Resume with resumeSessionId ${sessionId}.`;
696
722
  if (isTimeout) {
723
+ // Name the knob that actually fired: raising the hard cap does nothing for an
724
+ // idle-timeout, whose ceiling is CURSOR_DELEGATE_IDLE_MS.
725
+ const knob = err.reason === "idle-timeout" ? "CURSOR_DELEGATE_IDLE_MS" : "CURSOR_DELEGATE_HARD_CAP_MS";
697
726
  err.message += " cursor-agent does not stream shell output over ACP, so a long-running command emits"
698
- + " nothing until it exits. Split the command, run it in the background and poll, or raise"
699
- + " CURSOR_DELEGATE_HARD_CAP_MS.";
727
+ + ` nothing until it exits. Split the command, run it in the background and poll, or raise ${knob}.`;
700
728
  }
701
729
  }
702
730
  // Opt-in, because the frames land in the caller's context and nothing there is
package/src/server.js CHANGED
@@ -30,7 +30,7 @@ function rememberSession(set, id) {
30
30
  // Loaded at connect, before any tool schema is, so this carries only pre-call facts: what a
31
31
  // caller needs to decide whether to delegate at all. Call-time facts belong on the parameter
32
32
  // descriptions, read while the call is being written.
33
- export const SERVER_INSTRUCTIONS = `Delegate coding work to Cursor through the delegate tool. Every permission the agent requests is auto-approved, in every mode: mode="plan" and mode="ask" are instructions to the agent, not limits the bridge enforces, and the bridge cannot detect one being ignored. So scope workspace to the smallest relevant directory and review the git diff after every run, not only write-capable ones; filesReportedByAgent lists what the agent reported editing but the diff is authoritative.`;
33
+ export const SERVER_INSTRUCTIONS = `Delegate coding work to Cursor through the delegate tool. Every permission the agent requests is auto-approved, in every mode: mode="plan" and mode="ask" are instructions to the agent, not limits the bridge enforces, and the bridge cannot detect one being ignored. So scope workspace to the smallest relevant directory and review the git diff after every run, not only write-capable ones; filesReportedByEditTools lists what the agent's edit tools reported changing (absent when they reported none) but the diff is authoritative.`;
34
34
 
35
35
  const planEntrySchema = z.object({
36
36
  content: z.string(),
@@ -40,23 +40,21 @@ const planEntrySchema = z.object({
40
40
 
41
41
  const delegateOutputSchema = z.object({
42
42
  result: z.string(),
43
- resultSource: z.enum(["tool-free-stream", "post-tool", "pre-tool-fallback", "plan-detail", "none"]).optional().describe(
44
- "Where result came from. pre-tool-fallback means no final message closed the turn and result is the last message before the agent's final tool call — read protocolWarnings before trusting it as the answer. plan-detail (plan/ask only) means the agent's chat message was too terse to be the plan, so result carries the plan it filed via create_plan."
43
+ resultSource: z.enum(["pre-tool-fallback", "plan-detail", "none"]).optional().describe(
44
+ "Present only as a caveat on result; absent on the happy path, where result is simply the agent's answer. pre-tool-fallback: no final message closed the turn and result is the last message before the agent's final tool call — read protocolWarnings before trusting it. plan-detail (plan/ask only): the agent's chat message was too terse to be the plan, so result carries the plan it filed via create_plan. none: the turn produced no message and result is empty."
45
45
  ),
46
- finalMessageAvailable: z.boolean().optional(),
47
46
  stopReason: z.string().optional().describe(
48
47
  "Present only when it is not the ordinary end_turn — a refusal, a cancel, or an output cap. Absence means the turn ended normally."
49
48
  ),
50
49
  sessionId: z.string(),
51
- filesReportedByAgent: z.array(z.string()).describe(
52
- "Files the agent reported editing via native ACP diff events (may omit shell-driven edits)."
50
+ filesReportedByEditTools: z.array(z.string()).optional().describe(
51
+ "Files the agent's edit tools reported changing, via native ACP diff events. Absent when they reported none — which is not proof nothing changed: shell-driven edits leave no diff event; the git diff is authoritative."
53
52
  ),
54
53
  questionsAsked: z.array(z.string()).optional().describe(
55
54
  "Clarifying questions the agent raised through elicitation. Absent on most turns — the agent usually asks in prose and ends the turn, which this does not capture; read result for that."
56
55
  ),
57
- resumed: z.boolean().optional(),
58
- sessionTitle: z.string().optional().describe(
59
- "Short title the agent gave this turn. Present on most turns; purely a label."
56
+ resumed: z.boolean().optional().describe(
57
+ "Present and true only when a requested resume took (the returned session id matched resumeSessionId). Absent for a fresh session, or when a resume failed — a failed resume is reported in protocolWarnings."
60
58
  ),
61
59
  autoAnswered: z.array(z.object({ prompt: z.string(), chosen: z.string() })).optional(),
62
60
  fallbackAnswers: z.array(z.object({ prompt: z.string(), given: z.string(), chosen: z.string() })).optional(),
@@ -76,7 +74,7 @@ const delegateOutputSchema = z.object({
76
74
  content: z.string(),
77
75
  status: z.enum(["pending", "in_progress", "completed"]).optional(),
78
76
  })).optional().describe(
79
- "Todo list the agent tracked for this turn. Absent when the agent tracked none, which is common on short tasks and does not imply incompleteness."
77
+ "Todo items the agent left unfinished, present only when todoProgress shows completed < total — read it to see what remains before resuming. Absent both when the agent tracked no todos (common on short tasks) and when everything tracked was completed; todoProgress tells those apart."
80
78
  ),
81
79
  modeChanged: z.object({ from: z.string(), to: z.string() }).optional().describe(
82
80
  "Set when the agent switched itself out of the requested mode mid-session. Absence does not mean the mode was honored — an agent can write while staying in plan."