home / mcp / github mcp server
Docker-friendly MCP server that manages GitHub repositories with a single PAT for creating repos, upserting files, and handling branches.
Configuration
View docs{
"mcpServers": {
"augustolamim-_mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_TOKEN",
"github-mcp"
],
"env": {
"GITHUB_TOKEN": "YOUR_GITHUB_TOKEN"
}
}
}
}You can run and use the GitHub MCP Server to manage GitHub repositories through a single personal access token. It runs as a Model Context Protocol (MCP) server, enabling Codex or compatible MCP clients to create repositories, manage files, create branches, and identify the authenticated user, all through MCP endpoints. This server is designed to be Docker-friendly and integrates with a token-based workflow to perform repository operations programmatically.
You connect to the GitHub MCP Server using an MCP client that speaks the MCP protocol over stdio. The server expects a GitHub personal access token with at least the repo scope, provided via the GITHUB_TOKEN environment variable. Once connected, you can perform a sequence of operations such as creating repositories, upserting files on branches, creating branches, and identifying the authenticated identity.
Prerequisites you need before installation are a supported runtime environment and the ability to run containers.
Local development setup with Node and TypeScript tooling.
If you are running locally without Docker, install the Node-based development workflow.
If you prefer containerized execution, use Docker to build and run the server.
npm install
npm run devdocker build -t github-mcp .
docker run -i --rm -e GITHUB_TOKEN=... github-mcpTo connect Codex to the GitHub MCP Server, configure Codex to start the server via MCP over stdio. Use the following configuration snippet to launch the server in a Docker container and expose the required environment variable.
{
"mcpServers": {
"github-mcp": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "GITHUB_TOKEN", "github-mcp"]
}
}
}[mcp_servers.github-mcp]
command = "docker"
args = ["run", "-i", "--rm", "--env-file", "pathToEnv", "github-mcp"]Create a repository under the authenticated user or a specified organization.
Create or update files on a branch with a commit message.
Create a new branch from any ref, defaulting to main when no ref is specified.
Return the identity associated with the provided PAT.