GitHub MCP Server

GitHub MCP Server

gh_mcp_server•bykousen

A Spring Boot-based Model Context Protocol server that exposes GitHub operations as tools for MCP clients such as Claude Desktop, using the GitHub CLI to perform them.

License: MIT License•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Exposes repository operations such as listing and searching repositories, getting repository details, listing and creating branches, retrieving file contents and commit history.
  • •Supports issue and pull request management, including listing, creating, editing, commenting, closing, merging, and viewing details.
  • •Provides workflow, release, and user operations, such as listing workflows and workflow runs, managing releases, and getting authenticated user details.
  • •Uses the GitHub CLI for authentication and operations, offering a lightweight pure-Java alternative to the official GitHub MCP server without requiring Docker.

BEST FOR

  • •Users wanting to interact with GitHub repositories, issues, and pull requests through natural language in Claude Desktop.
  • •Developers who prefer a lightweight, Docker-free MCP server for GitHub operations.
  • •Teams managing CI/CD workflows and releases via an AI assistant.

ABOUT GH_MCP_SERVER

GitHub MCP Server is cataloged as an MCP server attributed to kousen. A Spring Boot-based Model Context Protocol server that exposes GitHub operations as tools for MCP clients such as Claude Desktop, using the GitHub CLI to perform them. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for GitHub MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What are the prerequisites for running this server?

It requires Java 21 or higher, the GitHub CLI installed and authenticated, and Gradle (wrapper included).

How many GitHub operations does the server provide?

It exposes 26 GitHub operations in total.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 926d9ba5e366 · 采集于 2026-11-13 09:46:33 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

GitHub MCP Server

A Spring Boot-based Model Context Protocol (MCP) server that provides GitHub integration tools for AI assistants like Claude Desktop.

Overview

This server implements the Model Context Protocol to expose GitHub operations as tools that can be used by MCP clients. It leverages the GitHub CLI (gh) to perform various GitHub operations including repository management, issue tracking, pull request management, and more. This provides a lightweight alternative to the official GitHub MCP server that doesn't require Docker.

Quick Start for Claude Desktop

To use this server with Claude Desktop, add the following to your Claude configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "github": {
      "command": "java",
      "args": ["-jar", "/path/to/gh_mcp_server/build/libs/gh_mcp_server.jar"],
      "env": {}
    }
  }
}

Replace /path/to/gh_mcp_server with the actual path to your project directory.

Features

Repository Operations

  • List repositories for authenticated user
  • Search repositories on GitHub
  • Get detailed repository information
  • List branches in a repository
  • Create new branches
  • Get file contents from repositories
  • Get commit history

Issue Management

  • List issues (open, closed, or all)
  • Get detailed issue information
  • Create new issues
  • Close issues
  • Add comments to issues
  • Edit issue title and body

Pull Request Management

  • List pull requests
  • Get detailed pull request information
  • Create new pull requests
  • Merge pull requests (merge, squash, or rebase)
  • Close pull requests
  • Add comments to pull requests

Workflow and Actions

  • List workflows in a repository
  • List workflow runs with optional filtering
  • View detailed workflow run information

Release Management

  • List releases
  • View release details
  • Create new releases (with draft/prerelease options)

User Operations

  • Get authenticated user details

Prerequisites

  • Java 21 or higher - Uses modern Java features (virtual threads, records, pattern matching)
  • GitHub CLI (gh) - Must be installed and authenticated
  • Gradle - Wrapper included in project

Why Use This MCP Server?

  • 🚀 Lightweight: No Docker required, pure Java implementation
  • 🔧 Comprehensive: 26 GitHub operations covering complete workflows
  • ⚡ Fast: Direct GitHub CLI integration with optimized JSON responses
  • 🧪 Well-Tested: 75+ test cases ensuring reliability
  • 🛡️ Secure: Leverages existing GitHub CLI authentication

Setup

  1. Install GitHub CLI

    # macOS
    brew install gh
    
    # or download from https://cli.github.com/
    
  2. Authenticate with GitHub

    gh auth login
    
  3. Clone and build the project

    git clone <repository-url>
    cd gh_mcp_server
    ./gradlew build
    

    Note: The build automatically creates a version-independent symlink gh_mcp_server.jar → gh_mcp_server-1.0.0.jar

  4. Configure Claude Desktop

    After building, configure Claude to use this MCP server. You have two options:

    Option A: Using the JAR file (Recommended)

    {
      "mcpServers": {
        "github": {
          "command": "java",
          "args": ["-jar", "/path/to/gh_mcp_server/build/libs/gh_mcp_server.jar"],
          "env": {}
        }
      }
    }
    

    Note: A symlink gh_mcp_server.jar points to the current version (gh_mcp_server-1.0.0.jar). This provides version-independent deployment. For version-specific deployment, use the full versioned filename instead.

    Option B: Using Gradle

    {
      "mcpServers": {
        "github": {
          "command": "./gradlew",
          "args": ["bootRun"],
          "cwd": "/path/to/gh_mcp_server",
          "env": {}
        }
      }
    }
    
  5. Restart Claude Desktop to load the new server configuration

Usage Examples

After configuring Claude Desktop, you can use natural language to interact with GitHub:

Repository Management

  • "List my repositories" → Shows your repositories with details
  • "List my private repositories" → Filter by visibility (public/private/internal)
  • "Search for Spring Boot repositories with over 1000 stars"
  • "Show me details about the microsoft/vscode repository"
  • "Get the last 5 commits from my project repository"
  • "What branches exist in my project repository?"

Issue Tracking

  • "List open issues in my project" → Lists current open issues
  • "Show me issue #123 details" → Gets specific issue information
  • "Create a new issue titled 'Bug: Login fails' with description..."
  • "Close issue #123 and add a comment 'Fixed in latest release'"

Pull Request Management

  • "List all pull requests in the kubernetes/kubernetes repository"
  • "Show me details for PR #456"
  • "Create a pull request from my feature-branch to main"
  • "Merge PR #789 using squash strategy"

CI/CD and Releases

  • "Show me all workflows in this repository" → Lists GitHub Actions
  • "What's the status of recent workflow runs?"
  • "List releases for the golang/go repository"
  • "Create a new release v2.1.0 as a draft"

File Operations

  • "Get the contents of package.json from my project"
  • "Show me the README file from the main branch"

Verification

If the server fails to start, check that:

  • Java 21+ is installed and in your PATH
  • GitHub CLI is installed and authenticated (gh auth status)
  • The JAR file path in the configuration is correct
  • Claude Desktop has been restarted

Testing the Server

To test the server independently (without Claude):

./gradlew bootRun

The server will start in STDIO mode and wait for MCP protocol messages. However, for normal usage, the server should be configured to run automatically by Claude Desktop as shown above.

Development Commands

# Build the project and run all tests
./gradlew build

# Run tests (command syntax validation only)
./gradlew test

# Run tests including GitHub CLI integration tests
./gradlew test -Dtest.gh.integration=true

# Format code with Spotless (Google Java Format)
./gradlew spotlessApply

# Check code formatting without applying changes
./gradlew spotlessCheck

# Clean build artifacts
./gradlew clean

# Run the server locally for testing
./gradlew bootRun

Test Coverage

The project includes comprehensive test coverage:

  • 75+ test cases validating all 26 GitHub operations
  • Command syntax tests - Verify exact gh command construction
  • Edge case tests - Handle special characters, Unicode, null values
  • Integration tests - Optional real GitHub CLI execution
  • Error handling tests - Validate graceful failure modes

See src/test/java/com/kousenit/gh_mcp_server/TEST_README.md for detailed testing documentation.

Configuration

The server uses Spring Boot's default configuration. You can customize settings in src/main/resources/application.properties.

Key Configuration Options

  • github.defaultBranch - Default branch name for operations (default: main)
  • spring.threads.virtual.enabled - Enable virtual threads for better performance (default: true)
  • MCP server runs in STDIO mode for CLI integration

Available Operations (26 Total)

Repository Operations

  • listRepositories - List user's repositories with optional visibility filter (public/private/internal)
  • searchRepositories - Search GitHub repositories
  • getRepository - Get detailed repository information
  • getCommitHistory - Get repository commit history with configurable limit
  • listBranches - List repository branches
  • createBranch - Create a new branch

Issue Management

  • listIssues - List issues in repository
  • getIssue - Get specific issue details
  • createIssue - Create new issue
  • closeIssue - Close an issue
  • commentOnIssue - Add comment to issue
  • editIssue - Edit issue title/body

Pull Request Management

  • listPullRequests - List pull requests
  • getPullRequest - Get PR details
  • createPullRequest - Create new pull request
  • mergePullRequest - Merge PR (merge/squash/rebase)
  • closePullRequest - Close pull request
  • commentOnPullRequest - Add PR comment

Workflow & CI/CD

  • listWorkflows - List repository workflows
  • listWorkflowRuns - List workflow runs with filtering
  • getWorkflowRun - Get workflow run details

Release Management

  • listReleases - List repository releases
  • getRelease - Get release details
  • createRelease - Create new release (draft/prerelease options)

File & User Operations

  • getFileContents - Get file contents from repository
  • getMe - Get authenticated user details

All operations return optimized JSON responses and support comprehensive error handling.

Troubleshooting

Common Issues

"gh: command not found"

Authentication errors

  • Run gh auth login to authenticate
  • Check status with gh auth status
  • Ensure you have access to the repositories you're trying to access

Server startup failures

  • Verify Java 21+ is installed: java --version
  • Check the JAR file path in Claude configuration
  • Look for error messages in Claude Desktop logs
  • Ensure the server isn't already running on another instance

Command timeouts

  • Large repositories or slow networks may cause timeouts
  • Default timeout is 30 seconds per operation
  • Check your internet connection and GitHub API status

Permission denied errors

  • Ensure GitHub CLI has proper permissions for the repository
  • For organization repositories, check if you have appropriate access
  • Some operations require write permissions (create, edit, merge, close)

Performance Tips

  • Use specific repository and owner names for faster responses
  • Limit search results with appropriate limit parameters
  • The server uses virtual threads for optimal concurrent performance
  • GitHub CLI handles rate limiting automatically

Getting Help

  • Check GitHub CLI documentation: gh help
  • Review MCP protocol: https://modelcontextprotocol.io/
  • For server issues, enable debug logging in application.properties

Deployment Considerations

JAR Versioning

The build process generates JAR files with version numbers in the filename (e.g., gh_mcp_server-1.0.0.jar). When deploying or updating:

  1. Initial Deployment: Use the current version in your Claude Desktop configuration:

    "args": ["-jar", "/path/to/gh_mcp_server/build/libs/gh_mcp_server-1.0.0.jar"]
    
  2. Version Updates: When updating to a new version, you must:

    • Build the new version: ./gradlew build
    • Update your Claude Desktop configuration with the new JAR filename
    • Restart Claude Desktop to load the new version
  3. Version-Independent Deployment: For easier deployment, you can:

    • Use the auto-generated symlink gh_mcp_server.jar (created automatically during build)
    • Use the Gradle option (automatically uses latest build)
    • Use a deployment script that handles version updates

    Automatic Symlink Management: The build process automatically creates and maintains the symlink:

    • ./gradlew build creates gh_mcp_server.jar → gh_mcp_server-X.Y.Z.jar
    • ./gradlew clean build recreates the symlink with the correct version
    • No manual symlink management required

Configuration Management

  • Keep your Claude Desktop configuration in version control
  • Document the specific JAR version being used in production
  • Consider using environment variables for paths in deployment scripts

Technology Stack

  • Spring Boot 3.5.0 - Application framework
  • Spring AI 1.0.0 - AI integration and MCP server capabilities
  • Java 21 - Programming language with virtual threads support
  • GitHub CLI - GitHub API integration
  • Gradle - Build tool
  • Spotless - Code formatting with Google Java Format

Key Implementation Features

  • Virtual Threads (Java 21) - Efficient concurrent I/O operations
  • ProcessBuilder - Secure command execution with timeout support
  • Records (Java 17) - Immutable data structures for command results
  • Pattern Matching - Modern Java syntax for type checking
  • String Templates - Using String.formatted() for cleaner string construction

License

This project is licensed under the MIT License - see the LICENSE file for details.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for GitHub MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/gh_mcp_server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools