A Model Context Protocol (MCP) server for GitHub, implemented in Go. This server allows LLMs to interact with GitHub repositories, issues, pull requests, and more through a standardized interface.
- Comprehensive GitHub API Access: See Tools below
- Setup Command: Easy automatic setup for AI assistants
--auto-approve
allows to pre-fill the auto-approval checkbox--write-access
enables write access for remote operations- Copies the binary into a stable location
- Updates the tool MCP server config (cline and claude-desktop are supported)
- Security Controls:
- Write access is disabled by default for safety
- Fine-grained auto-approval options
- "get_diff"
- diff between two commits
- ? Should this be in the output of
compare_commits
?
- GitHub Personal Access Token with appropriate permissions
You can download pre-built binaries for your platform from the GitHub Releases page.
# Download the latest release - for "linux_amd64" in this case
RELEASE="$(curl -s https://api.github.com/repos/geropl/github-mcp-go/releases/latest)"
DOWNLOAD_URL="$(echo $RELEASE | jq -r '.assets[] | select(.name | contains("linux_amd64")) | .browser_download_url')"
curl -L -o ./github-mcp-go $DOWNLOAD_URL
chmod +x ./github-mcp-go
# Setup the mcp server (can be called in .gitpod.yml, dotfiles repo, etc.)
./github-mcp-go setup --write-access="${GITHUB_MCP_WRITE_ACCESS:-false}" --auto-approve=allow-read-only || true
rm -f ./github-mcp-go
If you prefer to build from source:
# Prerequisites: Go 1.23 or later
# Clone the repository
git clone https://github.com/geropl/github-mcp-go.git
cd github-mcp-go
# Build the server
go build -o github-mcp-go .
The server requires a GitHub Personal Access Token to authenticate with the GitHub API:
export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here
The server includes a convenient setup command to install and configure the MCP server for use with AI assistants:
# Set up for Cline with auto-approval for read-only tools
./github-mcp-go setup --auto-approve allow-read-only --tool cline
# Set up for Claude Desktop with auto-approval for specific tools
./github-mcp-go setup --auto-approve search_repositories,get_file_contents --tool claude-desktop
# Set up with write access enabled
./github-mcp-go setup --write-access --tool cline
# Show setup help
./github-mcp-go setup --help
# Run the server directly (read-only mode)
./github-mcp-go serve
# Run the server with write access enabled
./github-mcp-go serve --write-access
# Show help
./github-mcp-go --help
The --auto-approve
flag can be used to specify which tools should be auto-approved as a comma-separated list. allow-read-only
is a special value to add all read-only tools to the auto-approve list (safe, no state changes).
The --write-access
flag enables write access for remote operations. This allows tools that modify remote repositories to be used. By default, write access is disabled for safety.
search_repositories
: Search for GitHub repositoriescreate_repository
: Create a new GitHub repositoryfork_repository
: Fork a GitHub repository
create_pull_request
: Create a new pull requestget_pull_request
: Get detailed information about a pull requestget_pull_request_diff
: Get the diff of a pull request
get_file_contents
: Get the contents of a file or directorycreate_or_update_file
: Create or update a filepush_files
: Push multiple files in a single commit
create_issue
: Create a new issuelist_issues
: List issues with filtering optionsupdate_issue
: Update an existing issueadd_issue_comment
: Add a comment to an issueget_issue
: Get details of a specific issuelist_issue_comments
: List comments on an issue
list_branches
: List branches in a repositoryget_branch
: Get details about a specific branchcreate_branch
: Create a new branchmerge_branches
: Merge one branch into anotherdelete_branch
: Delete a branch
get_commit
: Get details of a specific commitlist_commits
: List commits in a repositorycompare_commits
: Compare two commits or branchesget_commit_status
: Get the combined status for a specific commitcreate_commit_comment
: Add a comment to a specific commitlist_commit_comments
: List comments for a specific commitcreate_commit
: Create a new commit directly
search_code
: Search for code across repositoriessearch_issues
: Search for issues and pull requestssearch_commits
: Search for commits across repositories
list_workflows
: List all workflows in a repositoryget_workflow
: Get detailed information about a specific workflowlist_workflow_runs
: List workflow runs for a repository or specific workflowget_workflow_run
: Get detailed information about a specific workflow rundownload_workflow_run_logs
: Download and process logs for a workflow runlist_workflow_jobs
: List jobs for a workflow runget_workflow_job
: Get detailed information about a specific job
The project follows Semantic Versioning. New releases are automatically built and published to GitHub Releases when a new tag is pushed to the repository.
For detailed instructions on creating a new release, see RELEASE.md.
Pre-built binaries are available for:
- Linux (amd64, arm64)
- macOS (amd64, arm64)
- Windows (amd64)
The project uses table-driven tests with go-vcr for recording HTTP interactions:
go test ./...
This project is licensed under the MIT License - see the LICENSE file for details.