github -go
An unofficial implementation of an mcp server for github in go. Used internally at Metoro.
claude mcp add --transport stdio metoro-io-github-mcp-server-go go run main.go \ --env GITHUB_PERSONAL_ACCESS_TOKEN="your_github_token"
How to use
This MCP server provides a Go implementation of the GitHub Model Context Protocol (MCP), enabling AI assistants to interact with the GitHub API to perform common repository operations. After starting the server with your GitHub token configured, you can leverage the available tools to search repositories, create repositories, manage branches, read and write files, and handle issues and commits. The server authenticates via an environment variable or an Authorization header, and supports both standard HTTP requests and Gin context integration for authentication passthrough, ensuring flexibility across frameworks.
To use the tools, supply the appropriate authentication token and issue commands through the MCP interface. The server exposes tools such as search_repositories, create_repository, fork_repository, create_branch, get_file_contents, create_or_update_file, push_files, create_issue, get_issue, list_issues, update_issue, add_issue_comment, list_commits, search_code, search_issues, and search_users. Each tool corresponds to a GitHub API operation, allowing you to perform tasks ranging from repository creation to content manipulation and issue management directly via MCP calls.
How to install
Prerequisites:
- Go 1.21 or higher
- A GitHub personal access token with appropriate permissions
Installation steps:
- Install Go if you haven't already (https://golang.org/dl/).
- Retrieve the MCP server package:
go get github.com/metoro-io/github-mcp-server-go
-
Ensure your environment variable for authentication is set, or prepare to pass tokens via HTTP headers (see Authentication section in README).
-
Run the server from the project directory:
go run main.go
Optional: Build a binary for deployment:
go build -o github-mcp-server
Note: If you prefer to build and run with a specific module layout, adjust the path to main.go accordingly.
Additional notes
Environment and authentication:
- Set GITHUB_PERSONAL_ACCESS_TOKEN for environment-based authentication.
- Alternatively, you can provide the token via the HTTP Authorization header (Bearer token or just the token).
- The server supports context passthrough for HTTP requests and Gin frameworks, enabling seamless integration with existing web services.
Operational tips:
- Ensure the GitHub token has scopes required by the operations you intend to perform (repo, workflow, admin:repo_hook, etc. as needed).
- When using push_files or create_or_update_file, provide precise file paths and contents to avoid unintended overwrites.
- Use list_issues and search_* tools with appropriate filters to manage large repositories efficiently.
Common issues:
- If the server fails to authenticate, verify that the token is valid and has the necessary scopes.
- Ensure network access to GitHub APIs and that rate limits are considered in long-running automation.
Related MCP Servers
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go