Compare commits

...
Author SHA1 Message Date
陈大猫 513500b119 Merge branch 'main' into cursor/fix-mcp-unpack-re2js-4e70 2026-10-25 00:42:58 +08:00
Cursor Agentand陈大猫 ac4fcb0d5f fix(mcp): unpack re2js for external MCP bridge (#3910)
External MCP scripts launch from app.asar.unpacked with
ELECTRON_RUN_AS_NODE, so require("re2js") cannot resolve a copy that
exists only inside app.asar.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
2026-10-24 16:05:08 +00:00
2 changed files with 10 additions and 0 deletions

No files matched your search

+3
View File
@@ -195,6 +195,9 @@ module.exports = {
'node_modules/@cursor/sdk-*/**/*',
'node_modules/sqlite3/**/*',
'node_modules/@modelcontextprotocol/sdk/**/*',
// External MCP scripts run from asarUnpack via ELECTRON_RUN_AS_NODE and
// must resolve re2js from a real directory (issue #3910).
'node_modules/re2js/**/*',
'lib/**/*.cjs',
'lib/**/*.json',
'node_modules/zod/**/*',
+7
View File
@@ -128,6 +128,13 @@ test("asarUnpack no longer references removed legacy agent packages", () => {
test("asarUnpack keeps MCP server runtime deps unpacked", () => {
// @modelcontextprotocol/sdk is now a direct dep and the MCP server hard-requires it.
assert.ok(config.asarUnpack.includes("node_modules/@modelcontextprotocol/sdk/**/*"));
// externalMcpRedaction.cjs requires re2js. The launcher runs from
// app.asar.unpacked with ELECTRON_RUN_AS_NODE, which cannot see modules
// that exist only inside app.asar (issue #3910).
assert.ok(
config.asarUnpack.includes("node_modules/re2js/**/*"),
"external MCP bridge must unpack re2js so the stdio launcher can resolve it",
);
});
test("asarUnpack keeps Cursor SDK runtime deps unpacked", () => {