cursor-delegate-mcp 2.2.1 → 2.3.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/CHANGELOG.md CHANGED
@@ -6,6 +6,34 @@ All notable changes to this project are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.3.0] - 2026-09-06
10
+
11
+ ### Fixed
12
+
13
+ - JSON that is not an object is ignored on the ACP stream. `null` threw in the frame
14
+ reader — an uncaught exception that took down the server — and arrays or primitives
15
+ counted as activity, holding the idle guard open the way a launcher banner used to.
16
+ - Malformed tool `content` blocks are dropped and reported once in `protocolWarnings`.
17
+ A null block, a block with no string `type`, or a `diff` whose `path` is missing or
18
+ not a string threw in the update handler or recorded a non-path in `touchedFiles`.
19
+ - `cursor/update_todos` sent as a JSON-RPC notification is merged and not answered. A
20
+ reply to a notification is invalid JSON-RPC and aborted the turn.
21
+ - An image `contextFile` that cannot be read is skipped with a warning. A permission
22
+ error or a locked file used to fail the whole delegation after the other attachments
23
+ were already accepted.
24
+ - The Codex plugin `interface` drops `supportURL`. Codex's validator rejects unknown
25
+ keys, so a listing that kept that field would not validate.
26
+
27
+ ### Changed
28
+
29
+ - README usage copy names the Cursor Models pool and links Cursor's usage-limits help
30
+ instead of calling the allowance generous enough that most people never hit it.
31
+
32
+ ### Internal
33
+
34
+ - The production `npm audit` CI step retries three times with a five-minute timeout, so
35
+ a registry blip no longer fails the whole test workflow.
36
+
9
37
  ## [2.2.1] - 2026-09-04
10
38
 
11
39
  ### Changed
package/README.md CHANGED
@@ -32,7 +32,7 @@ Composer 2.5 is built for throughput on multi-file edits. The whole delegation i
32
32
 
33
33
  ## 🔋 Your limits stop being the bottleneck
34
34
 
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.
35
+ Composer and Grok draw from the **Cursor Models usage pool**, separate from third-party model usage on [supported Cursor plans](https://cursor.com/help/models-and-usage/usage-limits). Your Claude or Codex subscription handles the brief and review while Cursor runs the implementation. If you pay per token on API, implementation moves onto the Cursor capacity you already have.
36
36
 
37
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
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cursor-delegate-mcp",
3
- "version": "2.2.1",
3
+ "version": "2.3.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, Copilot, or any MCP client to Cursor's CLI agent — structured results, plan mode, and changed files.",
package/src/acp-client.js CHANGED
@@ -97,7 +97,12 @@ export class AcpClient extends EventEmitter {
97
97
  this.child.once("close", emitExit);
98
98
  this.router = null;
99
99
  this.peer = new JsonRpcPeer(this.child.stdout, this.child.stdin, {
100
- onNotification: (method, params) => { if (method === "session/update") this.emit("update", params); },
100
+ onNotification: (method, params) => {
101
+ if (method === "session/update") this.emit("update", params);
102
+ else if (method === "cursor/update_todos") {
103
+ Promise.resolve(this.router?.(undefined, method, params)).catch(() => {});
104
+ }
105
+ },
101
106
  // The router is async and its result discarded, so a throw from its own catch would reject
102
107
  // unobserved and exit the process. Promise.resolve covers a sync router in tests.
103
108
  onRequest: (id, method, params) => {
package/src/delegate.js CHANGED
@@ -125,7 +125,11 @@ async function buildContextBlocks(contextFiles, workspace, client, warnings) {
125
125
  warnings.push(`contextFile ${entry} skipped: ${Math.round(stat.size / 1024)}KB exceeds the ${MAX_IMAGE_BYTES / 1024 / 1024}MB image limit`);
126
126
  continue;
127
127
  }
128
- blocks.push({ type: "image", mimeType, data: (await readFile(canonical)).toString("base64") });
128
+ try {
129
+ blocks.push({ type: "image", mimeType, data: (await readFile(canonical)).toString("base64") });
130
+ } catch (err) {
131
+ warnings.push(`contextFile ${entry} skipped: could not read image (${err?.code || "read failed"})`);
132
+ }
129
133
  continue;
130
134
  }
131
135
  blocks.push({ type: "resource_link", uri: pathToFileURL(canonical).href, name: path.basename(canonical) });
@@ -434,7 +438,13 @@ export async function runDelegate({
434
438
  // is an uncaught exception — the whole server, not this one turn — and it also stops the
435
439
  // reply on the next line from being read, so the turn hangs to its cap.
436
440
  for (const c of Array.isArray(up.content) ? up.content : []) {
437
- if (c.type === "diff" && c.path) {
441
+ if (!c || typeof c !== "object" || Array.isArray(c) || typeof c.type !== "string"
442
+ || (c.type === "diff" && (typeof c.path !== "string" || !c.path))) {
443
+ const warning = "malformed tool content dropped: expected content blocks with string diff paths";
444
+ if (!frameWarnings.includes(warning)) frameWarnings.push(warning);
445
+ continue;
446
+ }
447
+ if (c.type === "diff") {
438
448
  state.touched.add(c.path);
439
449
  try { onProgress?.("editing " + c.path); } catch {}
440
450
  }
package/src/jsonrpc.js CHANGED
@@ -88,6 +88,7 @@ export class JsonRpcPeer {
88
88
  if (!line.trim()) return;
89
89
  let msg;
90
90
  try { msg = JSON.parse(line); } catch { return; }
91
+ if (msg === null || typeof msg !== "object" || Array.isArray(msg)) return;
91
92
  // Only a parsed frame counts. A blank line, a launcher banner or anything else the agent
92
93
  // prints is not the protocol advancing, and treating it as such is what let a chatty
93
94
  // launcher hold the idle guard open and made "Last ACP frame Ns ago" report a stderr byte.
@@ -41,6 +41,7 @@ export function createRequestRouter({ respond, respondError, onCreatePlan, onTod
41
41
  if (method === "cursor/update_todos") {
42
42
  onTodos?.({ todos: params?.todos, merge: params?.merge, toolCallId: params?.toolCallId });
43
43
  log({ method, params });
44
+ if (id == null) return;
44
45
  // The documented response is {outcome:{outcome:"accepted", todos}}; the bare {} we
45
46
  // have always sent is accepted by cursor-agent, so it stays until that changes.
46
47
  return respond(id, {});
@@ -53,7 +54,7 @@ export function createRequestRouter({ respond, respondError, onCreatePlan, onTod
53
54
  } catch (err) {
54
55
  // -32603, not -32000: ACP assigns -32000 to auth_required, and a bug on this side
55
56
  // reported as "authenticate" sends the agent down a recovery path that cannot work.
56
- return respondError(id, -32603, `Router error: ${err?.message || err}`);
57
+ if (id != null) return respondError(id, -32603, `Router error: ${err?.message || err}`);
57
58
  }
58
59
  };
59
60
  }