Github MCP Server Java
About
A production-ready MCP server that connects any MCP-compatible AI agent to the GitHub API. Manage repositories, issues, pull requests, and search — all through natural language.
Details
- Author
- parthloglogn
- Categories
- Other, Developer Tools, Project Management
Jump to
Setup
Install Github MCP Server Java in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/parthloglogn/github-mcp-java
Follow the installation instructions in the repository README, then restart your MCP client.
A production-ready MCP server that connects any MCP-compatible AI agent to the GitHub API. Manage repositories, issues, pull requests, and search — all through natural language.
A production-ready MCP server that connects any MCP-compatible AI agent to the GitHub API. Manage repositories, issues, pull requests, and search — all through natural language.
Transport:HTTP/SSE on port 8080, compatible with Cursor and Claude Desktop out of the box.
# 1. Build mvn clean package # 2. Set credentials export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_... # 3. Run (SSE transport — port 8080) java -jar target/github-mcp-server-1.0.0.jar # 4. Verify curl http://localhost:8080/health # 5. Inspect all tools npx @modelcontextprotocol/inspector http://localhost:8080/sse
Get your token fromGitHub Settings→ Developer settings → Personal access tokens. For GitHub Enterprise, setGITHUB_HOSTto your instance URL.
MCP Client (Cursor / Claude Desktop / other) │ HTTP/SSE transport (/sse + /mcp/message) ▼ Tool class (@McpTool — thin delegation layer, validates required params) ▼ Service interface + impl (business logic, error mapping, pagination) ▼ GitHubRestClient (typed HTTP gateway, PAT auth, exception handling) ▼ GitHub REST API
- client/— GitHub integration boundary (HTTP, Bearer-Auth, error handling)
- service/— domain logic (filtering, mapping, pagination)
- tools/— MCP-facing surface (descriptions, param validation, delegation)
- Spring Boot — runtime and transport wrapper only
Every tool returns a consistentApiResponse<T>envelope:
{ "success": true, "data": { ... } } { "success": false, "errorCode": "REPO_NOT_FOUND", "errorMessage": "..." }
- Go toGitHub Settings → Developer settings → Personal access tokens
- Click"Generate new token (classic)"
- Select the following scopes:
- repo— Full control of private repositories
- workflow— Update GitHub Action workflows
- read:org— Read org and team membership
- gist— Create gists
- notifications— Access notifications
- read:user— Read user profile data
{ "mcpServers": { "github": { "url": "http://localhost:8080/sse" } } }
Claude Desktop (claude_desktop_config.json)
{ "mcpServers": { "github": { "url": "http://localhost:8080/sse" } } }
On macOS:~/Library/Application Support/Claude/claude_desktop_config.json
{ "github.copilot.chat.mcp.servers": { "github": { "url": "http://localhost:8080/sse" } } }
{ "github.copilot.chat.mcp.servers": { "github": { "command": "java", "args": ["-jar", "/path/to/github-mcp-server-1.0.0.jar"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..." } } } }
# Build image docker build -t github-mcp-server:latest . # Run docker run --rm -p 8080:8080 \ -e GITHUB_PERSONAL_ACCESS_TOKEN=ghp_... \ github-mcp-server:latest
If GitHub Enterprise runs in Docker on the same host, usehost.docker.internal:
-e GITHUB_HOST=http://host.docker.internal:3000
com.github.mcp ├── GithubMcpApplication.java @SpringBootApplication ├── config/ │ ├── GitHubProperties.java @ConfigurationProperties — token, host, readOnly, toolsets │ └── WebConfig.java Web configuration ├── client/ │ ├── GitHubRestClient.java GET/POST/PATCH/DELETE HTTP gateway; typed exceptions │ └── GitHubGraphqlClient.java GraphQL client ├── controller/ │ └── HealthController.java Health check endpoint (GET /health) ├── exception/ │ ├── GitHubMcpException.java Base exception │ └── GlobalExceptionHandler.java Global error handler ├── dto/ │ ├── common/ ApiResponse · PagedResponse │ ├── request/ Request DTOs │ └── response/ Response DTOs ├── service/ Interfaces + impl — business logic, error mapping, pagination └── tools/ ├── RepositoryTools.java (11 tools) ├── IssueTools.java (11 tools) ├── PullRequestTools.java (10 tools) ├── SearchTools.java (4 tools) └── UserTools.java (3 tools)
- GITHUB_PERSONAL_ACCESS_TOKENis set correctly
- The token has not expired
- The token has the required scopes (seeConfiguration)
- For GitHub Enterprise: confirmGITHUB_HOSTis set to your instance URL
The repository may be private and the token lacksreposcope, or the owner/name is incorrect.
The server connects toapi.github.com(or yourGITHUB_HOST). Ensure the JVM process has outbound network access.
Copilot / Claude can't see the server
- Confirm the server is running:curl http://localhost:8080/health
- Confirm the MCP SSE endpoint is alive:curl http://localhost:8080/sse
- Check that the URL in the client config points tohttp://localhost:8080/sse
This project is a Java / Spring AI port of the officialGitHub MCP Serverwritten in Go.
Official GitHub MCP server for repository search, issues, pull requests, code context, and GitHub workflows in MCP-compatible AI clients.
Interact with GitHub repositories, including issues, pull requests, commits, releases, and actions.
Provides tools for mapping and analyzing GitHub repositories using a Personal Access Token for authentication.
Integrates with GitHub, allowing LLMs to interact with repositories, issues, and pull requests via the GitHub API.
Interact with GitHub repositories, issues, pull requests, and more. Requires a GitHub personal access token.
Interact with the GitHub API to create and manage repositories, including setting descriptions, topics, and website URLs.
An MCP server for interacting with GitHub, allowing you to manage repositories, issues, and pull requests.
Repository analysis, issues, pull requests, and code structure exploration
Token-efficient MCP server for GitHub source code exploration via tree-sitter AST parsing
Interact with the GitHub API using PyGithub to manage repositories, issues, and pull requests.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





