This project is a minimal GitHub-backed Model Context Protocol (MCP) server written in Go and designed for Vercel's Go runtime.
It uses:
- the official Go MCP SDK for Streamable HTTP transport
- GitHub's REST API via
go-github - a stateless MCP endpoint at
/mcp, which is the simplest fit for Vercel's serverless model
If you only need GitHub inside an MCP host, the absolute fastest option is GitHub's hosted remote MCP server:
https://api.githubcopilot.com/mcp/
But if you want your own server in Go and want to deploy it on Vercel, the shortest path is:
- Use the official MCP Go SDK.
- Serve MCP over Streamable HTTP instead of stdio.
- Run the handler in stateless mode so it works cleanly on Vercel.
- Use a single GitHub token from
GITHUB_TOKEN.
github_get_authenticated_usergithub_list_repositoriesgithub_get_repositorygithub_search_repositoriesgithub_search_codegithub_search_commitsgithub_list_organization_repositoriesgithub_list_repository_branchesgithub_get_filegithub_create_issuegithub_list_issuesgithub_get_issuegithub_add_issue_commentgithub_list_pull_requestsgithub_get_pull_requestgithub_create_branchgithub_upsert_file
That gives you a useful first slice quickly, including repository discovery, code and commit search, metadata lookups, issue and pull request workflows, and repository write operations. The search tools are especially useful for agents that need to find code before fetching specific files, while the write-oriented tools let an MCP client create a working branch and then commit file changes through the same GitHub token. You can add more tools with the same pattern.
Set your token:
export GITHUB_TOKEN=ghp_your_token_here
export MCP_API_KEY=replace_with_a_long_random_valueRun locally:
go run .The server listens on http://localhost:3000 by default.
Health check:
curl http://localhost:3000/healthzSample authenticated MCP request:
curl -X POST http://localhost:3000/mcp \
-H "Authorization: Bearer $MCP_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Equivalent query-parameter form:
curl -X POST "http://localhost:3000/mcp?api_key=$MCP_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'The MCP endpoint is:
POST /mcp
/mcp requires an API key via either:
Authorization: Bearer <MCP_API_KEY>
or:
?api_key=<MCP_API_KEY>
The server will fail to start unless MCP_API_KEY is set.
This server uses stateless Streamable HTTP. That is intentional for Vercel compatibility.
- Push this repo to GitHub.
- Import it into Vercel.
- Add the environment variables
GITHUB_TOKENandMCP_API_KEY. - Deploy.
The Vercel Go preset is selected in vercel.json, and Vercel will detect the root go.mod and main.go.
- Use a fine-grained token if possible.
- For read-only usage, remove the write tools (
github_create_issue,github_add_issue_comment,github_create_branch,github_upsert_file) or use a token without write permissions. - Some MCP clients still assume stateful SSE behavior. For a Vercel-hosted Go server, stateless Streamable HTTP is the safer deployment model.
- This project is licensed under Apache 2.0. See LICENSE.