github-mcp

github-mcp

Enables AI assistants to interact with GitHub repositories, issues, pull requests, and content via the Model Context Protocol.

Category
Visit Server

README

GitHub MCP Server

GitHub MCP Server

A Model Context Protocol (MCP) server that provides GitHub integration tools for AI assistants. This server implements a set of tools that allow AI models to interact with GitHub repositories, issues, pull requests, and content.

Features

  • Repository Management
    • List repositories
    • Get repository details
  • Issue Management
    • List issues
    • Create issues
  • Pull Request Management
    • List pull requests
    • Create pull requests
  • Content Management
    • Get file content
    • List directory contents

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/github-mcp.git
cd github-mcp
  1. Install the package:
pip install -e .

Authentication

This server uses githubauthlib for secure GitHub authentication. The library retrieves GitHub tokens from your system's keychain:

  • macOS: Uses Keychain Access
  • Windows: Uses Credential Manager
  • Linux: Uses libsecret

To set up authentication:

  1. Install the required system dependencies:

    • macOS: No additional setup required

    • Windows: No additional setup required

    • Linux: Install libsecret

      # Ubuntu/Debian
      sudo apt-get install libsecret-tools
      
      # Fedora
      sudo dnf install libsecret
      
  2. Configure your GitHub credentials:

    • The server will automatically use your Git credentials from the system keychain

    • If no credentials are found, you'll need to configure Git with your GitHub credentials:

      git config --global credential.helper store
      # Then perform a Git operation that requires authentication
      

Usage

  1. Start the server:
python -m github_mcp.server

The server will start on http://localhost:8000 by default.

  1. Configure Cursor IDE:
    • Open Cursor IDE settings

    • Add the following MCP server configuration:

      {
        "mcp": {
          "servers": [
            {
              "name": "github-mcp",
              "url": "http://localhost:8000/sse"
            }
          ]
        }
      }
      

API Endpoints

  • GET /: Server information and available tools
  • POST /tool: Synchronous tool calls
  • GET /sse: Server-Sent Events endpoint for streaming responses

Available Tools

Repository Tools

  • list_repositories: List GitHub repositories
    • Parameters:
      • visibility (optional): "all", "public", or "private"
      • sort (optional): "created", "updated", "pushed", or "full_name"
  • get_repository: Get repository details
    • Parameters:
      • owner: Repository owner
      • repo: Repository name

Issue Tools

  • list_issues: List repository issues
    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • state (optional): "open", "closed", or "all"
      • labels (optional): List of label names
  • create_issue: Create a new issue
    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • title: Issue title
      • body (optional): Issue description
      • labels (optional): List of label names
      • assignees (optional): List of assignee usernames

Pull Request Tools

  • list_pull_requests: List repository pull requests
    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • state (optional): "open", "closed", or "all"
      • sort (optional): "created", "updated", "popularity", or "long-running"
  • create_pull_request: Create a new pull request
    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • title: Pull request title
      • body (optional): Pull request description
      • head: Source branch
      • base (optional): Target branch (default: "main")
      • draft (optional): Create as draft (default: false)

Content Tools

  • get_file_content: Get file content
    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • path: File path
      • ref (optional): Branch/tag/commit reference
  • list_directory: List directory contents
    • Parameters:
      • owner: Repository owner
      • repo: Repository name
      • path (optional): Directory path (default: "")
      • ref (optional): Branch/tag/commit reference

Development

  1. Install development dependencies:
pip install -e ".[dev]"
  1. Run tests:
pytest
  1. Run linting:
ruff check .

License

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

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Acknowledgments

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured