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:
Brydon DeWitt 2026-05-23 15:02:55 -04:00
parent 3738732156
commit 9544b4e2ab

View File

@ -124,27 +124,28 @@ for VSCODE_MCP in "${VSCODE_MCP_PATHS[@]}"; do
MCP_SERVER_CMD="node"
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 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['$MCP_KEY'] = {
type: 'stdio',
command: '$MCP_SERVER_CMD',
args: $MCP_SERVER_ARGS
};
fs.writeFileSync(path, JSON.stringify(config, null, 2) + '\n');
let changed = false;
if (!config.servers['$MCP_KEY']) {
config.servers['$MCP_KEY'] = { type: 'stdio', command: '$MCP_SERVER_CMD', args: $MCP_SERVER_ARGS };
changed = true;
}
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"
fi
log "VS Code MCP entries ensured: $VSCODE_MCP"
break
fi
done