cursor-delegate-mcp 2.3.0 → 2.5.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,60 @@ All notable changes to this project are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.5.0] - 2026-10-05
10
+
11
+ ### Changed
12
+
13
+ - Zod 4. The minimum supported `@modelcontextprotocol/sdk` is now 1.23.0, the first
14
+ release that accepts Zod 4 schemas; 1.22.x requires Zod 3.
15
+
16
+ ### Security
17
+
18
+ - Lockfile bumps of `fast-uri` to 3.1.8 and `ip-address` to 10.7.3, clearing the two
19
+ moderate audit advisories in the MCP SDK's dependencies.
20
+
21
+ ### Internal
22
+
23
+ - Lockfile bumps of `@modelcontextprotocol/sdk` to 1.31.0 and the dev dependency
24
+ `@types/node` to 26.6.4.
25
+ - The release workflow retries the MCP Registry publish while npm is still processing
26
+ the new version, instead of failing the run. npm serves a new version a minute or two
27
+ after accepting it, and the registry validates against npm.
28
+
29
+ ## [2.4.0] - 2026-10-05
30
+
31
+ ### Added
32
+
33
+ - `effectiveEffort` in the delegate result: the current value of each option recognized as
34
+ effort, keyed by option id, as the agent reported it when the prompt went out. It is
35
+ present even when `effort` is omitted, because the model then runs at the level Cursor
36
+ saved for it, and absent when no reply confirmed a value. Read from replies the bridge
37
+ already receives, so it adds no ACP requests.
38
+ - `doctor` with `deep: true` reports each `currentModelOptions` entry's `name`, ACP
39
+ `category` and `currentValue` when the agent sends them as strings. The id and values
40
+ alone could not show that grok-4.7's `reasoning_effort` is its effort setting, or which
41
+ level Cursor had saved for it.
42
+
43
+ ### Fixed
44
+
45
+ - `effort` reaches a model that advertises it under an unfamiliar id. An option the agent
46
+ marks with ACP's `thought_level` category counts as effort whatever its id or name, and
47
+ the fallback for agents that send no category also knows `reasoning_effort` and names
48
+ containing "effort". grok-4.7 declares `reasoning_effort` ("Effort"), which was missed, so
49
+ `effort: "high"` failed with `invalid-effort` claiming the model had no effort setting.
50
+ - `invalid-effort` no longer says `Accepted: none` when no option is recognized as effort.
51
+ Missing an option is not proof the model has none, so the error lists the options the
52
+ model advertised, with their names, categories and values.
53
+
54
+ ### Security
55
+
56
+ - Lockfile bump of `hono` to 4.13.7, clearing a moderate audit advisory.
57
+
58
+ ### Internal
59
+
60
+ - Lockfile bumps of `@modelcontextprotocol/sdk` to 1.30.1 and the dev dependency
61
+ `@types/node` to 26.6.3.
62
+
9
63
  ## [2.3.0] - 2026-09-06
10
64
 
11
65
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cursor-delegate-mcp",
3
- "version": "2.3.0",
3
+ "version": "2.5.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.",
@@ -57,8 +57,8 @@
57
57
  "typecheck": "tsc -p tsconfig.json"
58
58
  },
59
59
  "dependencies": {
60
- "@modelcontextprotocol/sdk": "^1.22.0",
61
- "zod": "^3.23.8"
60
+ "@modelcontextprotocol/sdk": "^1.23.0",
61
+ "zod": "^4.6.5"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/node": "^26.1.1",
package/src/delegate.js CHANGED
@@ -12,7 +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, resolveEffort, unsupportedWarning } from "./model-options.js";
15
+ import { effortSettings, optionsFrom, resolveEffort, unsupportedWarning } from "./model-options.js";
16
16
  import { transcriptFrames } from "./jsonrpc.js";
17
17
 
18
18
  export const DEFAULT_MODEL = "composer-2.5";
@@ -230,11 +230,13 @@ async function applyEffort(client, sessionId, model, value, modelOptions) {
230
230
  + " the selected model did not report a usable effort option list."
231
231
  );
232
232
  }
233
- if (resolved.status === "unsupported") {
233
+ if (resolved.status === "unrecognized") {
234
234
  throw makeError(
235
235
  "invalid-effort",
236
- `Model ${JSON.stringify(model)} does not advertise configurable effort.`
237
- + ` Accepted: none. Omit effort; do not send ${JSON.stringify("none")}.`
236
+ `Model ${JSON.stringify(model)} advertised no option the bridge recognizes as effort.`
237
+ + ` Advertised: ${JSON.stringify(resolved.advertised)}.`
238
+ + ` If none of these is an effort setting, omit effort; do not send ${JSON.stringify("none")}.`
239
+ + " If one is, the bridge failed to recognize it — report that rather than retrying."
238
240
  );
239
241
  }
240
242
  if (resolved.status === "invalid") {
@@ -456,6 +458,7 @@ export async function runDelegate({
456
458
  let resumeError;
457
459
  const unsupportedOptions = [];
458
460
  let servedModel;
461
+ let effectiveEffort;
459
462
  const contextWarnings = [];
460
463
  try {
461
464
  const res = await supervisor.supervise(async () => {
@@ -473,6 +476,11 @@ export async function runDelegate({
473
476
  // (same model twice running) hits this.
474
477
  const openedOnModel = client.sessionModels?.currentModelId === model;
475
478
  if (!openedOnModel) await client.setModel(sessionId, model);
479
+ // The selected model's options as the agent last reported them, read for effectiveEffort.
480
+ // After a switch the opening snapshot describes the model we left, so it is dropped. A set
481
+ // that succeeds replaces the snapshot with its reply, which may carry none, and then nothing
482
+ // is known; a refused set changed nothing, so the snapshot stands.
483
+ let observedOptions = openedOnModel ? client.configOptions : undefined;
476
484
  // fast is an instruction, not a probe. Cursor persists the tier, and persists it per model —
477
485
  // both measured: one fast:true turn leaves the next fresh session reporting fast=true, and a
478
486
  // set_model to another model reports that model's own tier. So the opening snapshot only
@@ -487,6 +495,7 @@ export async function runDelegate({
487
495
  const fastResult = await applyConfig(client, sessionId, "fast", fast);
488
496
  if (fastResult.unsupported && fast) unsupportedOptions.push({ arg: "fast" });
489
497
  else servedModel = servedModelFrom(fastResult.res) ?? servedModel;
498
+ if (!fastResult.unsupported) observedOptions = optionsFrom(fastResult.res);
490
499
  modelOptions = optionsFrom(fastResult.res);
491
500
  }
492
501
  // A model that refuses fast leaves no list. Re-asserting the model just set is inert, and
@@ -494,18 +503,26 @@ export async function runDelegate({
494
503
  if (modelOptions === undefined && effort !== undefined) {
495
504
  const reasserted = await applyConfig(client, sessionId, "model", model);
496
505
  modelOptions = optionsFrom(reasserted.res);
506
+ if (!reasserted.unsupported) observedOptions = modelOptions;
497
507
  servedModel = servedModelFrom(reasserted.res) ?? servedModel;
498
508
  }
499
509
  if (effort !== undefined) {
500
510
  const r = await applyEffort(client, sessionId, model, effort, modelOptions);
511
+ observedOptions = optionsFrom(r);
501
512
  servedModel = servedModelFrom(r) ?? servedModel;
502
513
  }
503
514
  if (context !== undefined) {
504
515
  const r = await applyConfig(client, sessionId, "context", context);
505
516
  if (r.unsupported) unsupportedOptions.push({ arg: "context" });
506
- else servedModel = servedModelFrom(r.res) ?? servedModel;
517
+ else {
518
+ observedOptions = optionsFrom(r.res);
519
+ servedModel = servedModelFrom(r.res) ?? servedModel;
520
+ }
507
521
  }
508
522
  await client.setMode(sessionId, mode);
523
+ // What the agent reported in force as the prompt goes out — never the requested value
524
+ // standing in for a reply that did not confirm it.
525
+ effectiveEffort = effortSettings(observedOptions);
509
526
  // Everything a session/load replay may have written belongs to the previous turn.
510
527
  state.reset();
511
528
  supervisor.promptStarted();
@@ -566,6 +583,9 @@ export async function runDelegate({
566
583
  // Only when the agent served a different model than asked — e.g. "default" routing to a
567
584
  // concrete id, or a cross-model resume. Silence means the request was honored.
568
585
  if (servedModel !== undefined && servedModel !== model) out.effectiveModel = servedModel;
586
+ // Unlike effectiveModel, present whenever known: an omitted effort runs at whatever Cursor
587
+ // saved for the model, and this is the only place the caller can see what that was.
588
+ if (effectiveEffort !== undefined) out.effectiveEffort = effectiveEffort;
569
589
  if (stopReason !== undefined) out.stopReason = stopReason;
570
590
  // sessionTitle stays out of the result: it is a live label (progress) and a forensic one
571
591
  // (timeout errors), not a fact about the finished turn.
package/src/doctor.js CHANGED
@@ -4,7 +4,7 @@ import { AcpClient } from "./acp-client.js";
4
4
  import { resolveAcpSpawn } from "./spawn.js";
5
5
  import { DETACHED, treeKill } from "./proc.js";
6
6
  import { readPackageVersion } from "./version.js";
7
- import { allowedValues } from "./model-options.js";
7
+ import { describeOptions } from "./model-options.js";
8
8
 
9
9
  const HANDSHAKE_TIMEOUT_MS = 15_000;
10
10
  const VERSION_PROBE_TIMEOUT_MS = 10_000;
@@ -98,10 +98,9 @@ async function runDeepHandshake({ spawnSpec, clientFactory, workspace, timeoutMs
98
98
  details.currentModel = client.sessionModels?.currentModelId ?? null;
99
99
  details.modes = (client.sessionModes?.availableModes ?? []).map((m) => m?.id).filter(Boolean);
100
100
  // session/new already returned these. currentModel only — any other model needs a set_model
101
- // first, which this handshake does not send.
102
- details.currentModelOptions = (client.configOptions ?? [])
103
- .filter((o) => typeof o?.id === "string" && o.id !== "model" && o.id !== "mode")
104
- .map((o) => ({ id: o.id, values: allowedValues(o) }));
101
+ // first, which this handshake does not send. name and category are what tell an effort
102
+ // option apart when its id is unfamiliar; currentValue is the level saved for the model.
103
+ details.currentModelOptions = describeOptions(client.configOptions);
105
104
  })();
106
105
  const timeout = new Promise((_, reject) => {
107
106
  timer = setTimeout(() => {
@@ -1,14 +1,21 @@
1
1
  // Config option ids differ per model, and a model rejects any id it does not declare. The set is
2
2
  // knowable only once a model is selected, from the configOptions the agent echoes back.
3
3
 
4
- // Mirrors cursor-agent's own classifier.
5
- const THOUGHT_LEVEL_IDS = new Set(["thinking", "reasoning", "effort", "thought_level"]);
4
+ // ACP marks a thought/reasoning level selector with category "thought_level" — grok-4.7 declares
5
+ // reasoning_effort ("Effort") that way. Categories are optional in ACP, so the ids and names
6
+ // below still classify options from an agent that sends none. A match only nominates an option:
7
+ // the requested value must still appear exactly among the values it advertises.
8
+ const THOUGHT_LEVEL_IDS = new Set(["thinking", "reasoning", "effort", "reasoning_effort", "thought_level"]);
9
+ // Never an effort setting, and doctor reports them as currentModel and modes, so a list of what a
10
+ // model offers leaves them out.
11
+ const SELECTOR_IDS = new Set(["model", "mode"]);
6
12
 
7
13
  export function isThoughtLevel(opt) {
14
+ if (opt?.category === "thought_level") return true;
8
15
  const id = typeof opt?.id === "string" ? opt.id.toLowerCase() : "";
9
16
  if (THOUGHT_LEVEL_IDS.has(id)) return true;
10
17
  const name = typeof opt?.name === "string" ? opt.name.toLowerCase() : "";
11
- return /thinking|reasoning|thought/.test(name);
18
+ return /thinking|reasoning|thought|effort/.test(name);
12
19
  }
13
20
 
14
21
  export function optionsFrom(res) {
@@ -21,15 +28,43 @@ export function allowedValues(opt) {
21
28
  .filter((v) => typeof v === "string");
22
29
  }
23
30
 
31
+ // What a model offers besides the model and mode selectors, as doctor reports it and as an
32
+ // unrecognized effort names it. Optional metadata appears only when the agent sent a string.
33
+ export function describeOptions(options) {
34
+ return (Array.isArray(options) ? options : [])
35
+ .filter((o) => typeof o?.id === "string" && !SELECTOR_IDS.has(o.id))
36
+ .map((o) => ({
37
+ id: o.id,
38
+ ...(typeof o.name === "string" ? { name: o.name } : {}),
39
+ ...(typeof o.category === "string" ? { category: o.category } : {}),
40
+ values: allowedValues(o),
41
+ ...(typeof o.currentValue === "string" ? { currentValue: o.currentValue } : {}),
42
+ }));
43
+ }
44
+
45
+ // The current value of every recognized effort option, keyed by id. All of them rather than one
46
+ // picked: a model can declare a thinking toggle beside a level, and either alone can mislead.
47
+ // Undefined when no recognized option reports a string value.
48
+ export function effortSettings(options) {
49
+ const settings = {};
50
+ for (const o of Array.isArray(options) ? options : []) {
51
+ if (isThoughtLevel(o) && typeof o?.id === "string" && typeof o.currentValue === "string") {
52
+ settings[o.id] = o.currentValue;
53
+ }
54
+ }
55
+ return Object.keys(settings).length > 0 ? settings : undefined;
56
+ }
57
+
24
58
  // Resolve only values the selected model advertised. This keeps future vocabularies working
25
59
  // without aliases or a ranking table: xhigh, extra-high, max and ultra are just exact tokens.
26
- // A reported config list with no thought-level option is authoritative (unsupported); no list,
27
- // an empty list, or a thought-level option with no usable id/values is not.
60
+ // No list, an empty list, or a thought-level option with no usable id/values is unavailable. A
61
+ // list with nothing classified as thought-level is unrecognized — not proof the model has no
62
+ // effort setting: categories are optional and ids get renamed, so the caller is shown the list.
28
63
  export function resolveEffort(options, value) {
29
64
  if (!Array.isArray(options) || options.length === 0) return { status: "unavailable" };
30
65
 
31
66
  const candidates = options.filter(isThoughtLevel);
32
- if (candidates.length === 0) return { status: "unsupported", accepted: [] };
67
+ if (candidates.length === 0) return { status: "unrecognized", advertised: describeOptions(options) };
33
68
 
34
69
  const usable = candidates.filter((o) => typeof o?.id === "string");
35
70
  const accepted = [...new Set(usable.flatMap(allowedValues))];
package/src/server.js CHANGED
@@ -85,6 +85,7 @@ export const delegateOutputShape = {
85
85
  result: z.string(),
86
86
  resultSource: z.enum(["pre-tool-fallback", "none"]).optional(),
87
87
  effectiveModel: z.string().optional(),
88
+ effectiveEffort: z.record(z.string(), z.string()).optional(),
88
89
  stopReason: z.string().optional(),
89
90
  sessionId: z.string(),
90
91
  filesReportedByEditTools: z.array(z.string()).optional(),
@@ -122,7 +123,13 @@ export const doctorHandshakeShape = {
122
123
  currentModel: z.unknown().optional(),
123
124
  modes: z.array(z.unknown()).optional(),
124
125
  // Built here rather than relayed, so it gets a real type where its neighbours get z.unknown().
125
- currentModelOptions: z.array(z.object({ id: z.string(), values: z.array(z.string()) })).optional(),
126
+ currentModelOptions: z.array(z.object({
127
+ id: z.string(),
128
+ name: z.string().optional(),
129
+ category: z.string().optional(),
130
+ values: z.array(z.string()),
131
+ currentValue: z.string().optional(),
132
+ })).optional(),
126
133
  };
127
134
 
128
135
  export const doctorAgentShape = {
@@ -139,7 +146,7 @@ export const doctorOutputShape = {
139
146
  client: z.object({
140
147
  name: z.string().nullable(),
141
148
  version: z.string().nullable(),
142
- capabilities: z.record(z.unknown()),
149
+ capabilities: z.record(z.string(), z.unknown()),
143
150
  }).passthrough(),
144
151
  agent: z.object(doctorAgentShape).passthrough(),
145
152
  runtime: z.object({
@@ -149,7 +156,7 @@ export const doctorOutputShape = {
149
156
  cwd: z.string(),
150
157
  transport: z.literal("stdio"),
151
158
  }),
152
- env: z.record(z.unknown()),
159
+ env: z.record(z.string(), z.unknown()),
153
160
  };
154
161
 
155
162
  export const delegateInputSchema = z.object({