- Home
- MCP servers
- GitHub
GitHub
- typescript
1
GitHub Stars
typescript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"yuki-koma2-my-mcp-servers": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"mcp/github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_TOKEN_HERE"
}
}
}
}You can run a Dockerized GitHub MCP Server to interact with GitHub APIs for file operations, repo management, and advanced searches, all through a standardized Model Context Protocol interface. This setup lets you automate repository tasks securely via a consistent MCP client workflow without building your own API layer.
How to use
To use this MCP server, connect via an MCP client that communicates over stdio. You’ll issue tool requests to perform actions such as creating or updating files, searching repositories, and managing issues or pull requests. The server handles token-based authentication and translates your MCP requests into GitHub API calls, returning structured results or error messages that help you troubleshoot.
How to install
Prerequisites you need installed on your system before running the server: Docker and Docker Compose.
- Install Docker from https://docker.com (or your platform’s package source) and ensure the daemon is running.
- Install Docker Compose if it’s not included with your Docker installation (version 1.27+ recommended).
- Prepare a GitHub Personal Access Token with the required scopes.
- Go to GitHub Settings → Developer settings → Personal access tokens.
- Select repo scope for full control of private repos or public_repo for public repos only.
- Copy the generated token for use in the next steps.
- Create a .env file with your token.
GITHUB_PERSONAL_ACCESS_TOKEN=ghp_your_token_here
- Build the Docker image for the MCP server.
# Docker image build
docker build -t mcp/github -f src/github/Dockerfile .
- Run the MCP server using Docker. You can pass the token via an environment variable.
docker run -it --rm -e GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PERSONAL_ACCESS_TOKEN -p 5000:5000 mcp/github
- Alternatively, start with Docker Compose after preparing an environment file.
# Prepare environment
cp .env.template .env
nano .env
# Start services in detached mode
docker-compose up -d
Cursor usage and MCP setup
To connect a Cursor-based workflow, configure the MCP server entry as a stdio client. You’ll start the MCP server through Docker and expose it for stdio communication.
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"mcp/github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}
Security and best practices
Use a token with the least privilege necessary for your tasks. Monitor rate limits and rotate tokens regularly. Do not expose your access token in client configurations or logs.
Notes and troubleshooting
-
The MCP server is designed to communicate over stdio. Use a compatible MCP client to issue requests and handle responses.
-
If you encounter authentication errors, verify that the token has the correct scope and that it is correctly passed to the container as an environment variable.
Available tools
create_or_update_file
Create or update a single file in a GitHub repository, including the new content and commit message.
push_files
Push multiple files in a single commit to a repository.
search_repositories
Search GitHub repositories by query to locate relevant code or projects.
create_repository
Create a new GitHub repository.
get_file_contents
Retrieve the contents of a file or a directory from a repository.
create_issue
Create a new issue in a repository.
create_pull_request
Create a new pull request.
fork_repository
Fork a repository into your account.
create_branch
Create a new branch in a repository.
list_commits
List commits on a specific branch.
list_issues
List all issues in a repository.
update_issue
Update an existing issue.
add_issue_comment
Add a comment to an issue.
search_code
Search for code across repositories.
search_issues
Search issues and pull requests.
search_users
Search GitHub users.
get_issue
Get details for a specific issue.
get_pull_request
Get details for a specific pull request.
list_pull_requests
List pull requests in a repository.
create_pull_request_review
Create a review for a pull request.
merge_pull_request
Merge a pull request.
get_pull_request_files
List files changed in a pull request.
get_pull_request_status
Get the status of a pull request.
update_pull_request_branch
Update the branch associated with a pull request.
get_pull_request_comments
Get comments on a pull request.
get_pull_request_reviews
Get reviews on a pull request.