Github MCP doesn't work in dev containers

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When using devcontainers, the Github MCP link from the documentation doesn’t work

Steps to Reproduce

Head to https://cursor.com/docs/context/mcp/directory
Click add to cursor, add Personal Access Token
Open a devcontainer, attempt to activate the mcp

Expected Behavior

Github should activate using the streaming mcp server

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.3.35
VSCode Version: 1.105.1
Commit: cf8353edc265f5e46b798bfb276861d0bf3bf120
Date: 2026-01-13T07:39:18.564Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.2.0

Additional Information

We are using Dev containers

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. stdio-type MCP servers run inside the devcontainer (this is expected behavior since v0.50+). But the GitHub MCP uses the docker run command, and the Docker CLI is usually not available inside the container, so you get spawn docker ENOENT.

Possible fixes:

  1. Add Docker CLI to the devcontainer (recommended)

In devcontainer.json, add this feature:

{
  "features": {
    "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
  }
}

This gives the container access to the host Docker engine.

  1. Use the npx version of GitHub MCP instead of Docker

In mcp.json:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your_token"
      }
    }
  }
}

This requires Node.js in the devcontainer.

Try option 2 first since it’s simpler. Let me know if it still doesn’t work.

Thanks!

Option 2 worked with one caveat, you need to install NodeJS with NPM in the container for it to work.

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.