Skip to content

Cline gets: MCP error -32000: Connection closed #413

Open
@csm10495

Description

@csm10495

Describe the bug

I'm using Cline and VS Code. In my mcp settings file I have:

{
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "ghcr.io/github/github-mcp-server"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "REDACTED"
      }
    }
  }
}

This is matching up with the options generally used for claude.

Affected version

Please run docker run -i --rm ghcr.io/github/github-mcp-server ./github-mcp-server --version and paste the output below

GitHub MCP Server
Version: v0.3.0
Commit: 7aced2b0a16d18a441d6bbf33e6487f7c042df6e
Build Date: 2025-05-14T21:33:51Z

Steps to reproduce the behavior

Try using that with cline in vscode. Then click connect. I get something like:

Image

Interestingly enough, running via docker directly starts the mcp server just fine as far as i can tell:

GITHUB_PERSONAL_ACCESS_TOKEN=REDACTED docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
GitHub MCP Server running on stdio

Expected vs actual behavior

Using the steps for claude generally work for cline, but not in this case.

Logs

Inside the vscode output for the extension host i see:

2025-05-19 11:20:09.355 [error] [Window] [Extension Host] Failed to restart connection for github: McpError: MCP error -32000: Connection closed
    at frt._onclose (/Users/cmachalo/.vscode/extensions/saoudrizwan.claude-dev-3.16.1/dist/extension.js:2957:94794)
    at Art._transport.onclose (/Users/cmachalo/.vscode/extensions/saoudrizwan.claude-dev-3.16.1/dist/extension.js:2957:94403)
    at ChildProcess.<anonymous> (/Users/cmachalo/.vscode/extensions/saoudrizwan.claude-dev-3.16.1/dist/extension.js:2959:1353)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1104:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions