fix: load Cursor plugin MCP servers#6365

closed1
main
fix/cursor-native-mcp-config
openedAug 12, 2026byTt3-code-botBot
View on GitHubTwo-way sync enabledPR last imported 21d ago

summary

  • discover cached Cursor plugins that provide MCP servers
  • pass those plugin roots to Cursor Agent with --plugin-dir in ACP mode
  • keep t3code's internal t3-code MCP bridge unchanged

testing

  • pnpm exec vp check apps/server/src/provider/acp/CursorAcpSupport.ts apps/server/src/provider/acp/CursorMcpServers.ts apps/server/src/provider/acp/CursorMcpServers.test.ts
  • pnpm --filter t3 typecheck
  • pnpm exec vp test run apps/server/src/provider/acp/CursorMcpServers.test.ts apps/server/src/provider/acp/CursorAcpSupport.test.ts --reporter=dot --no-file-parallelism

request provenance

  • requested by: @zortos293

Note

Low Risk Small, localized change to Cursor ACP spawn args and filesystem discovery, with unit tests and no auth or data-path changes.

Overview Cursor ACP sessions now discover cached public Cursor plugins that declare MCP servers (mcp.json or .mcp.json under each plugin version) and pass their roots to cursor-agent via --plugin-dir before the acp subcommand.

Discovery defaults to ~/.cursor/plugins/cache/cursor-public (overridable for tests) and ignores plugins without MCP config. makeCursorAcpRuntime applies this when building the spawn input; the internal t3-code MCP bridge is unchanged.

Reviewed by Cursor Bugbot for commit 82ad879504a4576093b43edad389a27cfe29aa3d. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix Cursor plugin MCP servers loading by discovering and injecting --plugin-dir arguments

  • Adds discoverCursorPluginDirectories in CursorMcpServers.ts to scan ~/.cursor/plugins/cache/cursor-public for plugin version directories containing mcp.json or .mcp.json.
  • Adds addCursorPluginDirectories helper that inserts --plugin-dir <path> argument pairs before the final arg in the spawn input.
  • Updates makeCursorAcpRuntime in CursorAcpSupport.ts to call both helpers so the Cursor process is spawned with the correct plugin directories.
📊 Macroscope summarized 82ad879. 2 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

Added 1 commit

  • fix: load Cursor plugin MCP servers82ad879
……@@ -0,0 +1,46 @@
2+import * as NodeFS from "node:fs";
3+import * as NodePath from "node:path";
4+
5+import { Effect } from "effect";
MmacroscopeappBoton lines 5–5Aug 12, 2026

Effect library modules should be imported from their subpath as a namespace rather than as a consolidated named import from "effect" (the sibling CursorAcpSupport.ts already does this). Effect.sync and the Effect.Effect type are both available from the subpath namespace.

Posted via Macroscope — Effect Service Conventions

……@@ -0,0 +1,46 @@
27+ if (!NodeFS.existsSync(pluginsRoot)) return [];
28+
29+ const directories: string[] = [];
30+ for (const slug of NodeFS.readdirSync(pluginsRoot, { withFileTypes: true })) {

🟠 High acp/CursorMcpServers.ts:30

readdirSync calls inside Effect.sync throw uncaught EACCES/ENOENT errors when the cache root or a plugin slug directory is unreadable or removed between existsSync and traversal. The thrown error becomes an Effect defect that aborts makeCursorAcpRuntime, so no Cursor ACP session can start even though plugin discovery is optional. Consider wrapping each directory traversal in try/catch and skipping unavailable entries instead of letting the error propagate.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
text
1In file @apps/server/src/provider/acp/CursorMcpServers.ts around line 30:
2
3`readdirSync` calls inside `Effect.sync` throw uncaught `EACCES`/`ENOENT` errors when the cache root or a plugin slug directory is unreadable or removed between `existsSync` and traversal. The thrown error becomes an Effect defect that aborts `makeCursorAcpRuntime`, so no Cursor ACP session can start even though plugin discovery is optional. Consider wrapping each directory traversal in try/catch and skipping unavailable entries instead of letting the error propagate.
Synced from GitHub

closing this revision: follow-up review found that scanning the raw plugin cache can re-enable disabled or stale plugin versions. current Cursor Agent already merges native MCP sources in ACP mode, so this is not a safe fix.

Ccursor[bot]reviewed · 2 inline threadsAug 12, 2026
Synced from GitHub

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 82ad879504a4576093b43edad389a27cfe29aa3d. Configure here.

……@@ -0,0 +1,46 @@
39+ ) {
40+ directories.push(pluginRoot);
41+ }
42+ }

All plugin hashes loaded

Medium Severity

discoverCursorPluginDirectories pushes every hash directory under a plugin slug that contains mcp.json or .mcp.json. Cursor’s cache can retain more than one hash during atomic updates or after stalled installs, so ACP spawn can receive multiple --plugin-dir entries for the same plugin and register duplicate MCP servers.

Reviewed by Cursor Bugbot for commit 82ad879504a4576093b43edad389a27cfe29aa3d. Configure here.

……@@ -0,0 +1,46 @@
42+ }
43+ }
44+ return directories.sort();
45+ });

Discovery failures block sessions

Medium Severity

Plugin discovery runs as a hard dependency of makeCursorAcpRuntime via throwing sync filesystem calls inside Effect.sync. Permission errors, TOCTOU races while the cache updates, or a bad directory entry defect the effect and prevent Cursor ACP session or text-generation startup, even though plugin MCP loading is optional.

Additional Locations (1)

Reviewed by Cursor Bugbot for commit 82ad879504a4576093b43edad389a27cfe29aa3d. Configure here.

Synced from GitHub

Approvability

Verdict: Needs human review

1 blocking correctness issue found. This PR introduces new capability for discovering and loading Cursor plugin MCP servers, changing runtime behavior in the ACP session spawn process. There is also an unresolved High severity finding about uncaught filesystem errors that could block sessions. New feature enablement with potential reliability issues warrants human review.

You can customize Macroscope's approvability policy. Learn more.