cursor-delegate-mcp 2.7.0 → 2.9.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,46 @@ All notable changes to this project are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.9.0] - 2026-11-22
10
+
11
+ ### Fixed
12
+
13
+ - A missing cursor-agent on Windows is reported as `spawn-failed` with the install hint, and
14
+ `doctor` reports `found: false`. Launched through cmd.exe it read as `agent-exit` quoting cmd's
15
+ "is not recognized" line, and `doctor` reported `found: true`.
16
+ - `cancel` with `force` returns as soon as the turn settles, in about 60 ms, instead of waiting out
17
+ its 5 s grace.
18
+
19
+ ## [2.8.0] - 2026-11-08
20
+
21
+ ### Added
22
+
23
+ - Antigravity plugin, listed as Delegate to Cursor:
24
+ `agy plugin install https://github.com/andreilungeanu/cursor-delegate-mcp`. It sets
25
+ `timeoutSeconds` to 21660 s, a minute past the hard cap; Antigravity otherwise ends a tool call
26
+ after 180 s.
27
+
28
+ ### Changed
29
+
30
+ - Copilot CLI installs from the plugin marketplace:
31
+ `copilot plugin marketplace add andreilungeanu/cursor-delegate-mcp`, then
32
+ `copilot plugin install cursor-delegate@cursor-delegate-mcp`. Copilot deprecates direct
33
+ repository installs. Copilot's manifest moved from the repository root to
34
+ `.github/plugin/plugin.json`.
35
+
36
+ ### Fixed
37
+
38
+ - The Copilot plugin's server starts. Copilot runs it inside the plugin folder, a copy of this
39
+ repository, where `npx -y cursor-delegate-mcp@X.Y.Z` matched the pin to the folder's own
40
+ `package.json` and failed with `'cursor-delegate-mcp' is not recognized`. The Copilot, Codex and
41
+ Antigravity configs pin `npm:cursor-delegate-mcp@X.Y.Z`, which npx always fetches. Existing
42
+ installs pick it up with `copilot plugin update cursor-delegate`.
43
+
44
+ ### Internal
45
+
46
+ - The test suite passes under Windows' default PowerShell execution policy and removes its
47
+ temporary plugin folders.
48
+
9
49
  ## [2.7.0] - 2026-11-07
10
50
 
11
51
  ### Changed
package/README.md CHANGED
@@ -40,7 +40,7 @@ Composer and Grok draw from the **Cursor Models usage pool**, separate from thir
40
40
 
41
41
  ## Features
42
42
 
43
- - 🤝 **Native plugins** — install into Claude Code, ChatGPT/Codex, or GitHub Copilot CLI and just say *"delegate this to Cursor"*. The shared skill teaches your agent how to delegate well.
43
+ - 🤝 **Native plugins** — install into Claude Code, ChatGPT/Codex, Google Antigravity, or GitHub Copilot CLI and just say *"delegate this to Cursor"*. The shared skill teaches your agent how to delegate well.
44
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.
45
45
  - 📦 **Clean, named results** — final answer, changed files, session id, and the plan, returned as one compact JSON payload. Nothing to scrape.
46
46
  - 📋 **Plan first** — `plan` mode: Cursor drafts a plan, you review it, then the same session implements it.
@@ -74,10 +74,21 @@ codex plugin marketplace add andreilungeanu/cursor-delegate-mcp
74
74
  codex plugin add cursor-delegate@cursor-delegate-mcp
75
75
  ```
76
76
 
77
+ ### Google Antigravity
78
+
79
+ ```shell
80
+ agy plugin install https://github.com/andreilungeanu/cursor-delegate-mcp
81
+ ```
82
+
83
+ Restart the Antigravity app to load it. If you added `cursor-delegate` to `mcp_config.json` by hand, remove that entry.
84
+
85
+ Without the CLI, use the manual config under [Client-specific config locations](#client-specific-config-locations).
86
+
77
87
  ### GitHub Copilot CLI
78
88
 
79
89
  ```shell
80
- copilot plugin install andreilungeanu/cursor-delegate-mcp
90
+ copilot plugin marketplace add andreilungeanu/cursor-delegate-mcp
91
+ copilot plugin install cursor-delegate@cursor-delegate-mcp
81
92
  ```
82
93
 
83
94
  ### Any other MCP client
@@ -161,9 +172,19 @@ OpenCode does **not** use `mcpServers`. Local servers go under `mcp`, with `type
161
172
  </details>
162
173
 
163
174
  <details>
164
- <summary><strong>Google Antigravity</strong> — <code>~/.gemini/config/mcp_config.json</code> or workspace <code>.agents/mcp_config.json</code></summary>
175
+ <summary><strong>Google Antigravity</strong> (without the plugin) — <code>~/.gemini/config/mcp_config.json</code> or workspace <code>.agents/mcp_config.json</code></summary>
165
176
 
166
- Same `mcpServers` block as the generic snippet above. In the IDE: **…** on the agent panel → **MCP Servers** → **Manage MCP Servers** → **View raw config**. Antigravity 2.0, IDE, and CLI share the Gemini config file. You may need to approve the server's tools on first run.
177
+ ```json
178
+ {
179
+ "mcpServers": {
180
+ "cursor-delegate": {
181
+ "command": "npx",
182
+ "args": ["-y", "cursor-delegate-mcp"],
183
+ "timeoutSeconds": 21660
184
+ }
185
+ }
186
+ }
187
+ ```
167
188
 
168
189
  </details>
169
190
 
@@ -181,25 +202,6 @@ Same shape as OpenCode: `type: "local"` and `command` as one array. In the VS Co
181
202
 
182
203
  </details>
183
204
 
184
- <details>
185
- <summary><strong>Zed</strong> — Settings → AI → MCP Servers, or <code>context_servers</code> in Zed settings</summary>
186
-
187
- ```json
188
- {
189
- "context_servers": {
190
- "cursor-delegate": {
191
- "command": "npx",
192
- "args": ["-y", "cursor-delegate-mcp"],
193
- "env": {}
194
- }
195
- }
196
- }
197
- ```
198
-
199
- Zed's native agent uses this. External ACP agents in Zed read their own MCP config unless you forward Zed's servers.
200
-
201
- </details>
202
-
203
205
  ## License
204
206
 
205
207
  MIT © [Andrei Lungeanu](https://github.com/andreilungeanu)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cursor-delegate-mcp",
3
- "version": "2.7.0",
3
+ "version": "2.9.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
@@ -3,7 +3,7 @@ import { EventEmitter } from "node:events";
3
3
  import { StringDecoder } from "node:string_decoder";
4
4
  import { JsonRpcPeer } from "./jsonrpc.js";
5
5
  import { createRequestRouter } from "./request-router.js";
6
- import { resolveAcpSpawn } from "./spawn.js";
6
+ import { commandExists, resolveAcpSpawn } from "./spawn.js";
7
7
  import { DETACHED, isChildAlive, treeKill } from "./proc.js";
8
8
  import { VERSION } from "./version.js";
9
9
  import { makeError } from "./errors.js";
@@ -47,6 +47,10 @@ export class AcpClient extends EventEmitter {
47
47
 
48
48
  start() {
49
49
  const { command, args, options } = this.spawnSpec;
50
+ const opts = /** @type {{ shell?: boolean, env?: NodeJS.ProcessEnv }} */ (options);
51
+ if (opts?.shell && !commandExists(command, opts.env)) {
52
+ return Promise.reject(makeError("spawn-failed", `Failed to spawn agent (${command}): not found on PATH. Install Cursor CLI and run 'cursor-agent login'.`));
53
+ }
50
54
  this._stderrChunks = [];
51
55
  this._stderrLength = 0;
52
56
  const stderrDecoder = new StringDecoder("utf8");
package/src/doctor.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import process from "node:process";
2
2
  import { spawn } from "node:child_process";
3
3
  import { AcpClient } from "./acp-client.js";
4
- import { resolveAcpSpawn } from "./spawn.js";
4
+ import { commandExists, resolveAcpSpawn } from "./spawn.js";
5
5
  import { DETACHED, treeKill } from "./proc.js";
6
6
  import { readPackageVersion } from "./version.js";
7
7
  import { describeOptions } from "./model-options.js";
@@ -40,6 +40,8 @@ export function probeAgentVersion(spawnSpec, timeoutMs = VERSION_PROBE_TIMEOUT_M
40
40
  const isJsScript = isJsLauncher(launcher);
41
41
  const execCommand = isJsScript ? process.execPath : command;
42
42
  const execArgs = isJsScript ? [launcher, "--version"] : ["--version"];
43
+ // Through a shell, a missing launcher still spawns (the shell does) and would read as found.
44
+ if (options?.shell && !isJsScript && !commandExists(launcher, options.env)) return Promise.resolve({ found: false, version: null });
43
45
  return new Promise((resolve) => {
44
46
  let settled = false;
45
47
  let stdout = "";
package/src/server.js CHANGED
@@ -323,7 +323,12 @@ export function buildServer({ runDelegate: runDelegateInjected, runDoctor: runDo
323
323
  // finally removes its handle when the turn actually settles.
324
324
  return cancelResult("cancelled", sessionId);
325
325
  }
326
- await new Promise((r) => setTimeout(r, forceGraceMs));
326
+ // Watched rather than slept through: cursor-agent can stop a cancelled turn well inside the
327
+ // grace, and the delegation's finally drops its handle the moment the turn settles.
328
+ const graceEnds = Date.now() + forceGraceMs;
329
+ while (Date.now() < graceEnds && inFlight.get(sessionId)?.size) {
330
+ await new Promise((r) => setTimeout(r, Math.min(50, Math.max(1, graceEnds - Date.now()))));
331
+ }
327
332
  const stillRunning = inFlight.get(sessionId);
328
333
  if (!stillRunning || stillRunning.size === 0) return cancelResult("cancelled", sessionId);
329
334
  // Snapshot before awaiting stop. A resume that registers during teardown must not be
package/src/spawn.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import process from "node:process";
2
+ import { existsSync, statSync } from "node:fs";
3
+ import path from "node:path";
2
4
 
3
5
  export function splitArgs(raw) {
4
6
  const args = [];
@@ -33,3 +35,22 @@ export function resolveAcpSpawn() {
33
35
  const win32 = process.platform === "win32";
34
36
  return { command, args, options: { shell: win32, ...(win32 ? { env: agentEnv() } : {}) } };
35
37
  }
38
+
39
+ // Through a shell the spawn itself always succeeds: cmd.exe starts, fails to find the launcher and
40
+ // exits 1 with a localized "is not recognized" line, so Node's spawn 'error' event never fires and
41
+ // a missing cursor-agent reads as an agent crash. Resolving the launcher first is what lets that
42
+ // case be reported as not installed. Mirrors cmd's lookup: a path is checked as given, a bare name
43
+ // against each PATH entry, both with and without each PATHEXT extension. Pass the env the child
44
+ // will get: on win32 that is agentEnv(), not process.env.
45
+ export function commandExists(command, env = process.env) {
46
+ const name = String(command || "").replace(/^["']|["']$/g, "");
47
+ if (!name) return false;
48
+ const pathKey = Object.keys(env).find((k) => k.toUpperCase() === "PATH");
49
+ const extKey = Object.keys(env).find((k) => k.toUpperCase() === "PATHEXT");
50
+ const exts = ["", ...String((extKey && env[extKey]) || ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean)];
51
+ const isFile = (p) => { try { return existsSync(p) && statSync(p).isFile(); } catch { return false; } };
52
+ const hit = (base) => exts.some((ext) => isFile(base + ext) || isFile(base + ext.toLowerCase()));
53
+ if (/[\\/]/.test(name)) return hit(name);
54
+ const dirs = String((pathKey && env[pathKey]) || "").split(path.delimiter).filter(Boolean);
55
+ return dirs.some((dir) => hit(path.join(dir.replace(/^"|"$/g, ""), name)));
56
+ }