Skip to content

[Bug]: incorrect installation of the official github MCP #270

@justinabrahms

Description

@justinabrahms

What happened?

The GitHub MCP server fails to authenticate when installed via mcpm, returning 401 Bad credentials errors for all API calls despite having a valid GitHub Personal Access Token configured.

Root Cause:
The Docker command in the server metadata (~/.mcpm/servers/github/metadata.json) uses incorrect syntax for passing environment variables. The -e flag is passed with only the token value instead of the KEY=VALUE format.

Current (broken) configuration in metadata.json:

"args": [
  "run",
  "-i",
  "--rm",
  "-e",
  "${GITHUB_PERSONAL_ACCESS_TOKEN}",
  "ghcr.io/github/github-mcp-server"
]

This generates:

docker run -i --rm -e ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ghcr.io/github/github-mcp-server

Docker interprets this as creating an environment variable named ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx with no value, rather than setting GITHUB_PERSONAL_ACCESS_TOKEN to that value.

Steps to Reproduce:

  1. Install GitHub MCP server via mcpm: mcpm install github
  2. Configure GITHUB_PERSONAL_ACCESS_TOKEN in mcpm
  3. Enable the server for a client: mcpm client edit claude-code (or any other client)
  4. Try to use any GitHub MCP tool (e.g., get_me, list_repositories)
  5. Observe 401 Bad credentials error

Verification that token is valid:

curl -H "Authorization: Bearer ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" https://api.github.com/user
# Returns user data successfully

What did you expect?

The -e flag should pass the variable name and value together in KEY=VALUE format:

Correct configuration:

"args": [
  "run",
  "-i",
  "--rm",
  "-e",
  "GITHUB_PERSONAL_ACCESS_TOKEN=${GITHUB_PERSONAL_ACCESS_TOKEN}",
  "ghcr.io/github/github-mcp-server"
]

This should generate:

docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ghcr.io/github/github-mcp-server

The GitHub MCP server should authenticate successfully and all API calls should work.

MCPM Version

2.9.0

OS

macOS

Logs

**Error from MCP tool call:**

MCP error -32603: failed to get user: GET https://api.github.com/user: 401 Bad credentials []


**Docker container environment inspection:**

$ docker inspect <container_id> --format '{{range .Config.Env}}{{println .}}{{end}}' | grep GITHUB
ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


The environment variable is being set with the token as the variable name instead of `GITHUB_PERSONAL_ACCESS_TOKEN=<token>`.

**After manual fix:**
After manually updating `~/.mcpm/servers/github/metadata.json` (line 48) and `~/.claude.json` with the correct syntax, the GitHub MCP server authenticates successfully and returns the correct username.

---

**Impact:**
- GitHub MCP server is completely non-functional when installed via mcpm
- Affects all Docker-based installations of the GitHub MCP server
- This issue is propagated to all client configurations that mcpm generates

**Suggested Fix:**
Update the `metadata.json` for the GitHub MCP server in mcpm's server repository:


  "args": [
    "run",
    "-i",
    "--rm",
    "-e",
-   "${GITHUB_PERSONAL_ACCESS_TOKEN}",
+   "GITHUB_PERSONAL_ACCESS_TOKEN=${GITHUB_PERSONAL_ACCESS_TOKEN}",
    "ghcr.io/github/github-mcp-server"
  ],

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