Credentials. Keep the token in the environment and out of committed files; it acts as you on GitHub.
Who it is forA developer on GitHub Enterprise or a host that needs a local stdio server.
The problemSome setups cannot reach or authenticate to the hosted server.
The outcomeA local GitHub MCP server running in Docker with a token from your environment.
What you need first
- A GitHub account
- An MCP host such as VS Code, Claude Code or Cursor
- For local use: Docker and a GitHub personal access token
Steps
- Install Docker and create a personal access token
- Store it in your shell with
export GITHUB_PAT=your_token_hereand add any .env file to .gitignore - For Claude Code:
claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PAT -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server - Restart the host and test a simple query
Prompt for your agent
Set up github/github-mcp-server locally in Docker for Claude Code using my GITHUB_PAT environment variable, confirm it lists my repos, and tell me which toolsets are on by default.
Caveat.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for github/github-mcp-server and "Run the GitHub MCP server locally in Docker"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer