2026年1月10日 星期六

Fix vs code MCP configuration error of WSL - npx command not found

For vscode/vscode-insiders copilot chat MCP configuration https://github.com/microsoft/vscode/issues/255220 ## Solution I ### Install Node.js on Windows - vs code created a mcp.json in default location: ``` C:/Users/spencer/AppData/Roaming/Code/User/mcp.json ``` ## Solution II ### Create a new mcp.json in your workspace - {path\_to\_project}/.vscode/mcp.json ## Solution III ### Edit the default mcp.json in User space - path: ``` bash vim ~/.vscode-server-insiders/data/User/mcp.json vim ~/.vscode-server/data/User/mcp.json ``` ``` json { "servers": { "context7": { "type": "stdio", "command": "npx", "args": [ "@upstash/context7-mcp@latest" ] }, "Github": { "type": "http", "url": "https://api.githubcopilot.com/mcp/", "headers": { "Authorization": "${input:Authorization}" } } }, "inputs": [ { "id": "Authorization", "type": "promptString", "description": "Authentication token (PAT or App token)", "password": true } ] } ```

沒有留言: