@@ -120,13 +120,62 @@ command -v devpod >/dev/null 2>&1 && echo " ✓ devpod" || echo "
120120command -v devcontainer > /dev/null 2>&1 && echo " ✓ devcontainer" || echo " ✗ devcontainer — npm install -g @devcontainers/cli"
121121command -v gh > /dev/null 2>&1 && echo " ✓ gh (codespaces)" || echo " ✗ gh (codespaces) — https://cli.github.com/"
122122
123+ # ---------------------------------------------------------------------------
124+ # Auto-configure MCP clients
125+ # ---------------------------------------------------------------------------
126+
127+ configure_mcp_client () {
128+ local config_file=" $1 "
129+ local client_name=" $2 "
130+
131+ if [ ! -f " $config_file " ]; then
132+ mkdir -p " $( dirname " $config_file " ) "
133+ cat > " $config_file " << MCPEOF
134+ {
135+ "mcpServers": {
136+ "devcontainer-mcp": {
137+ "command": "${INSTALL_DIR} /devcontainer-mcp",
138+ "args": ["serve"]
139+ }
140+ }
141+ }
142+ MCPEOF
143+ echo " ✓ ${client_name} — created ${config_file} "
144+ elif command -v python3 > /dev/null 2>&1 ; then
145+ python3 -c "
146+ import json
147+ path = '${config_file} '
148+ with open(path) as f:
149+ data = json.load(f)
150+ servers = data.setdefault('mcpServers', {})
151+ if 'devcontainer-mcp' not in servers:
152+ servers['devcontainer-mcp'] = {'command': '${INSTALL_DIR} /devcontainer-mcp', 'args': ['serve']}
153+ with open(path, 'w') as f:
154+ json.dump(data, f, indent=2)
155+ print(' ✓ ${client_name} — added to ${config_file} ')
156+ else:
157+ print(' ✓ ${client_name} — already configured')
158+ " 2> /dev/null || echo " ⚠ ${client_name} — could not update ${config_file} "
159+ else
160+ echo " ⚠ ${client_name} — exists but python3 not available to merge"
161+ fi
162+ }
163+
164+ echo " "
165+ echo " ==> Configuring MCP clients..."
166+
167+ # GitHub Copilot CLI
168+ configure_mcp_client " ${HOME} /.copilot/mcp-config.json" " GitHub Copilot"
169+
170+ # VS Code
171+ if [[ " $( uname -s) " == " Darwin" ]]; then
172+ configure_mcp_client " ${HOME} /Library/Application Support/Code/User/mcp.json" " VS Code"
173+ elif [[ " $( uname -s) " == " Linux" ]]; then
174+ configure_mcp_client " ${HOME} /.config/Code/User/mcp.json" " VS Code"
175+ fi
176+
177+ # Cursor
178+ configure_mcp_client " ${HOME} /.cursor/mcp.json" " Cursor"
179+
123180echo " "
124- echo " Done! Configure your MCP client:"
125- echo ' {'
126- echo ' "mcpServers": {'
127- echo ' "devcontainer-mcp": {'
128- echo " \" command\" : \" ${INSTALL_DIR} /devcontainer-mcp\" ,"
129- echo ' "args": ["serve"]'
130- echo ' }'
131- echo ' }'
132- echo ' }'
181+ echo " Done! devcontainer-mcp is ready to use."
0 commit comments