chore: wire exa mcp server into global vscode config via install.sh
install.sh now ensures both all-agents and exa are present in the VS Code global mcp.json on every machine.
This commit is contained in:
parent
3738732156
commit
9544b4e2ab
@ -124,27 +124,28 @@ for VSCODE_MCP in "${VSCODE_MCP_PATHS[@]}"; do
|
|||||||
MCP_SERVER_CMD="node"
|
MCP_SERVER_CMD="node"
|
||||||
MCP_SERVER_ARGS="[\"--experimental-strip-types\", \"$DOTFILES_AGENTS/mcp/index.ts\"]"
|
MCP_SERVER_ARGS="[\"--experimental-strip-types\", \"$DOTFILES_AGENTS/mcp/index.ts\"]"
|
||||||
|
|
||||||
if [[ ! -f "$VSCODE_MCP" ]]; then
|
|
||||||
printf '{\n "servers": {\n "%s": {\n "type": "stdio",\n "command": "%s",\n "args": %s\n }\n }\n}\n' \
|
|
||||||
"$MCP_KEY" "$MCP_SERVER_CMD" "$MCP_SERVER_ARGS" > "$VSCODE_MCP"
|
|
||||||
log "Created VS Code global MCP config: $VSCODE_MCP"
|
|
||||||
elif node -e "const c=JSON.parse(require('fs').readFileSync('$VSCODE_MCP','utf8')); process.exit(c.servers && c.servers['$MCP_KEY'] ? 0 : 1)" 2>/dev/null; then
|
|
||||||
skip "VS Code MCP entry '$MCP_KEY' already present in $VSCODE_MCP"
|
|
||||||
else
|
|
||||||
node -e "
|
node -e "
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = '$VSCODE_MCP';
|
const path = '$VSCODE_MCP';
|
||||||
const config = JSON.parse(fs.readFileSync(path, 'utf8'));
|
const config = fs.existsSync(path) ? JSON.parse(fs.readFileSync(path, 'utf8')) : {};
|
||||||
config.servers = config.servers || {};
|
config.servers = config.servers || {};
|
||||||
config.servers['$MCP_KEY'] = {
|
let changed = false;
|
||||||
type: 'stdio',
|
if (!config.servers['$MCP_KEY']) {
|
||||||
command: '$MCP_SERVER_CMD',
|
config.servers['$MCP_KEY'] = { type: 'stdio', command: '$MCP_SERVER_CMD', args: $MCP_SERVER_ARGS };
|
||||||
args: $MCP_SERVER_ARGS
|
changed = true;
|
||||||
};
|
}
|
||||||
fs.writeFileSync(path, JSON.stringify(config, null, 2) + '\n');
|
if (!config.servers['exa']) {
|
||||||
|
config.servers['exa'] = { type: 'http', url: 'https://mcp.exa.ai/mcp' };
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
if (changed) {
|
||||||
|
fs.writeFileSync(path, JSON.stringify(config, null, 2) + '\n');
|
||||||
|
console.log('VS Code MCP config updated: ' + path);
|
||||||
|
} else {
|
||||||
|
process.stdout.write('');
|
||||||
|
}
|
||||||
"
|
"
|
||||||
log "VS Code MCP entry merged: $VSCODE_MCP"
|
log "VS Code MCP entries ensured: $VSCODE_MCP"
|
||||||
fi
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user