Problem MCP on remote server
Before submitting your bug report
- [ ] I've tried using the "Ask AI" feature on the Continue docs site to see if the docs have an answer
- [x] I'm not able to find a related conversation on GitHub discussions that reports the same bug
- [x] I'm not able to find an open issue that reports the same bug
- [ ] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: windows
- Continue version: 1.3.24 / 1.2.10
- IDE version: vscode
- Model: -
- config:
mcpServers:
- name: context7
command: npx
args:
- "-y"
- "@upstash/context7-mcp"
Description
I'm using a remote server (Linux) in VScode, and when I use mcp in the config.yaml, I get the error:
Failed to connect to "context7" Error: command "cmd.exe" not found. To use this MCP server, install the cmd.exe CLI.
Then I tried adding a new mcp using the available features.
.continue/mcpServers/new-mcp-server.yaml
and got the error
ENOENT: no such file or directory, open 'C:\Users\xxxxx\AppData\Local\Programs\Microsoft VS Code\vscode-remote:\tunnel%2Btunnel-dev\workspace\test-project.continue\mcpServers\new-mcp-server.yaml'. > vscode-remote://tunnel%2Btunnel-dev/workspace/test-project/.continue/mcpServers/new-mcp-server.yaml
To reproduce
No response
Log output
Same problem but I'm running VSCode in WSL which should not try to use cmd.exe or anything windows related at all. Any idea how to fix it?
I got it to work!
- Add the MCP configuration directly to the config.yaml, Instead of as a separate file in .continue/mcpServers/foo.yaml. This solved the ENOENT error for me.
- Use
command: "bash"instead ofcommand: "npx" - Give bash a folder to work from:
cwd: '~'orcwd: "${workspaceFolder}"Otherwise you'll get 'bash not found'
This was my settings.yaml
... your original settings like name/models/context etc...
mcpServers:
- name: Angular
command: "bash"
cwd: "${workspaceFolder}"
args:
- "-c" #you need this so you can pass the rest of the command as an argument
- "npx -y @angular/cli mcp" #or whatever your MCP server wants
@koesper thanks for sharing your solution.
When I tried it I get the following error:
Failed to connect to "chrome-devtools"
Error: MCP error -32000: Connection closed
My config.yaml with mcp config:
mcpServers:
- name: chrome-devtools
command: bash
cwd: '${workspaceFolder}'
args:
- -c
- npx -y chrome-devtools-mcp@latest
@gund Allright, it looks like you are at least one step closer than you were before :D can you try the arguments with quotes around it?
mcpServers:
- name: chrome-devtools
command: bash
cwd: '${workspaceFolder}'
args:
- "-c"
- "npx -y chrome-devtools-mcp@latest"
@gund Allright, it looks like you are at least one step closer than you were before :D can you try the arguments with quotes around it?
mcpServers: - name: chrome-devtools command: bash cwd: '${workspaceFolder}' args: - "-c" - "npx -y chrome-devtools-mcp@latest"
Yep I tried with and without quotes - the result is the same error as above unfortunately...
Heya, wanted to tack onto this - instead of having the servers execute in the WSL content, i set the CWD to windows System32:
- name: GitLab
command: npx
cwd: "C:/Windows/System32/"
args:
- mcp-remote
- "https://gitlab.com/api/v4/mcp"
env: {}
This fixed the Error: MCP error -32000: Connection closed i was getting, same as above
Heya, wanted to tack onto this - instead of having the servers execute in the WSL content, i set the CWD to windows System32:
I get that it tries to execute on the host and you can make it work there, but the entire bug is that it should not even try to execute on the host when you are in a remote env like WSL or SSH or Container - it should always run on the remote host because you do not want to install anything on your host in the first place.
For example I do not even have nodejs on my windows host and I do not want to install or run anything there, that defeats the entire purpose of having WSL.
This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.
This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!