continue icon indicating copy to clipboard operation
continue copied to clipboard

Problem MCP on remote server

Open daunt opened this issue 1 year ago • 9 comments

Before submitting your bug report

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


daunt avatar Nov 15 '25 06:11 daunt

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?

gund avatar Nov 17 '25 12:11 gund

I got it to work!

  1. 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.
  2. Use command: "bash" instead of command: "npx"
  3. Give bash a folder to work from: cwd: '~' or cwd: "${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 avatar Nov 19 '25 14:11 koesper

@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 avatar Nov 19 '25 16:11 gund

@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"

koesper avatar Nov 20 '25 08:11 koesper

@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...

gund avatar Nov 20 '25 09:11 gund

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

Image

osirisOfGit avatar Dec 16 '25 01:12 osirisOfGit

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.

gund avatar Dec 16 '25 11:12 gund

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.

github-actions[bot] avatar Mar 17 '26 02:03 github-actions[bot]

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!

github-actions[bot] avatar Mar 27 '26 02:03 github-actions[bot]