fullcourtdefense-cli 1.21.9 → 1.21.10
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/dist/commands/mcpGateway.js +25 -4
- package/dist/version.json +1 -1
- package/package.json +1 -1
|
@@ -1061,6 +1061,30 @@ function writeJsonMcpServer(file, serverName, nodeExe, commandArgs) {
|
|
|
1061
1061
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
1062
1062
|
fs.writeFileSync(file, `${JSON.stringify(json, null, 2)}\n`, 'utf8');
|
|
1063
1063
|
}
|
|
1064
|
+
// VS Code uses a DIFFERENT MCP schema than Cursor/Claude/Windsurf:
|
|
1065
|
+
// - .vscode/mcp.json (and the user-profile mcp.json): top-level `servers` key.
|
|
1066
|
+
// - settings.json: nested under `mcp.servers`.
|
|
1067
|
+
// Writing `mcpServers` (the Cursor/Claude key) leaves VS Code silently ignoring
|
|
1068
|
+
// the config, so the gateway never actually runs. These writers target the
|
|
1069
|
+
// correct key for each VS Code file shape.
|
|
1070
|
+
function writeVscodeMcpServer(file, serverName, nodeExe, commandArgs) {
|
|
1071
|
+
const json = readJsonObject(file);
|
|
1072
|
+
const isSettings = file.endsWith('settings.json');
|
|
1073
|
+
if (isSettings) {
|
|
1074
|
+
if (!json.mcp || typeof json.mcp !== 'object')
|
|
1075
|
+
json.mcp = {};
|
|
1076
|
+
if (!json.mcp.servers || typeof json.mcp.servers !== 'object')
|
|
1077
|
+
json.mcp.servers = {};
|
|
1078
|
+
json.mcp.servers[serverName] = { type: 'stdio', command: nodeExe, args: commandArgs };
|
|
1079
|
+
}
|
|
1080
|
+
else {
|
|
1081
|
+
if (!json.servers || typeof json.servers !== 'object')
|
|
1082
|
+
json.servers = {};
|
|
1083
|
+
json.servers[serverName] = { type: 'stdio', command: nodeExe, args: commandArgs };
|
|
1084
|
+
}
|
|
1085
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
1086
|
+
fs.writeFileSync(file, `${JSON.stringify(json, null, 2)}\n`, 'utf8');
|
|
1087
|
+
}
|
|
1064
1088
|
function removeTomlSection(content, tableName) {
|
|
1065
1089
|
const lines = content.split(/\r?\n/);
|
|
1066
1090
|
const out = [];
|
|
@@ -2206,10 +2230,7 @@ async function installVscodeMcpGatewayCommand(args, config) {
|
|
|
2206
2230
|
if (targets.length === 0)
|
|
2207
2231
|
targets.push(vscodeMcpPath(true));
|
|
2208
2232
|
for (const file of targets) {
|
|
2209
|
-
|
|
2210
|
-
writeJsonMcpServer(file, serverName, nodeExe, commandArgs);
|
|
2211
|
-
else
|
|
2212
|
-
writeMcpServerConfig(file, serverName, nodeExe, commandArgs);
|
|
2233
|
+
writeVscodeMcpServer(file, serverName, nodeExe, commandArgs);
|
|
2213
2234
|
}
|
|
2214
2235
|
console.log('AgentGuard MCP Gateway installed for VS Code.');
|
|
2215
2236
|
for (const file of targets)
|
package/dist/version.json
CHANGED