github-mcp-server

mg3994/github-mcp-server

3.2

If you are the rightful owner of github-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Model Context Protocol (MCP) server implementation in Rust that provides GitHub integration capabilities for AI assistants.

Tools
1
Resources
0
Prompts
0

GitHub MCP Server

A Model Context Protocol (MCP) server implementation in Rust that provides GitHub integration capabilities for AI assistants.

Features

  • GitHub API authentication with personal access tokens
  • Repository operations (list, search, file access)
  • Issue management (create, update, list)
  • Pull request operations
  • Comprehensive error handling and rate limiting
  • Configurable through environment variables

Installation

Prerequisites

  • Rust 1.70 or later
  • A GitHub personal access token

Building from Source

git clone https://github.com/mg3994/github-mcp-server.git
cd github-mcp-server
cargo build --release

Configuration

The server can be configured using environment variables:

VariableDefaultDescription
GITHUB_API_URLhttps://api.github.comGitHub API base URL
REQUEST_TIMEOUT30Request timeout in seconds
LOG_LEVELinfoLogging level (trace, debug, info, warn, error)
MAX_RETRIES3Maximum retry attempts for failed requests
RATE_LIMIT_BUFFER10Rate limit buffer percentage

Usage

Running the Server

# Using default configuration
./target/release/github-mcp-server

# With custom log level
./target/release/github-mcp-server --log-level debug

MCP Tools

The server provides the following MCP tools:

github_auth

Authenticate with GitHub using a personal access token.

Parameters:

  • token (string): GitHub personal access token

Example:

{
  "name": "github_auth",
  "arguments": {
    "token": "ghp_your_token_here"
  }
}

More tools will be documented as they are implemented.

Development

Running Tests

cargo test

Running with Debug Logging

RUST_LOG=debug cargo run

License

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

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

Security

  • GitHub tokens are stored in memory only and never persisted to disk
  • All GitHub API requests use HTTPS
  • Input validation is performed on all tool parameters