GitHub MCP Server

GitHub MCP Server

Enables AI assistants to interact with GitHub repositories via the REST API, supporting repository listing, detail retrieval, and issue management.

Category
Visit Server

README

šŸš€ GitHub MCP Server

A production-ready Model Context Protocol (MCP) Server built with Python that enables AI assistants and MCP clients to interact with GitHub repositories through the GitHub REST API.

This project demonstrates how to build a custom MCP server capable of performing GitHub operations such as listing repositories, retrieving repository information, managing issues, and extending to pull requests, workflows, and code management.


šŸ“Œ Features

Repository Management

  • List all repositories for the authenticated user
  • Retrieve repository details
  • Access repository metadata

Issue Management

  • List repository issues
  • Create new issues
  • Close existing issues (future enhancement)

MCP Integration

  • Built using the official MCP Python SDK
  • Compatible with MCP Inspector
  • JSON-RPC based communication
  • Local STDIO transport support

šŸ—ļø Architecture

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│   MCP Client        │
│ (Inspector / AI)    │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
           │
           ā–¼
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│   GitHub MCP Server │
│      (Python)       │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
           │
           ā–¼
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│   GitHub REST API   │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
           │
           ā–¼
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│   GitHub Account    │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

šŸ“‚ Project Structure

github-mcp/
│
ā”œā”€ā”€ server.py
ā”œā”€ā”€ .env
ā”œā”€ā”€ pyproject.toml
ā”œā”€ā”€ uv.lock
ā”œā”€ā”€ .gitignore
└── README.md

āš™ļø Prerequisites

  • Python 3.10+
  • UV Package Manager
  • GitHub Account
  • GitHub Personal Access Token (PAT)
  • Node.js (for MCP Inspector)

šŸ”‘ GitHub Token Setup

Generate a Personal Access Token from:

https://github.com/settings/tokens

Recommended permissions:

Repository Access
Issues: Read & Write
Contents: Read
Pull Requests: Read & Write

Create a .env file:

GITHUB_TOKEN=your_github_token_here

šŸ“¦ Installation

Clone the repository:

git clone <repository-url>
cd github-mcp

Initialize project:

uv init

Install dependencies:

uv add mcp requests python-dotenv

ā–¶ļø Running the Server

Start the MCP server:

uv run server.py

The server will wait for MCP client connections.


šŸ” Using MCP Inspector

Start MCP Inspector:

npx @modelcontextprotocol/inspector

Open:

http://localhost:6274

Connection Settings:

Transport : STDIO

Command:
uv

Arguments:
run server.py

Click Connect.


šŸ› ļø Available Tools

list_repositories

Returns all repositories accessible by the authenticated user.

Example

{}

Response

[
  {
    "name": "github-mcp",
    "full_name": "username/github-mcp",
    "private": false
  }
]

get_repository

Returns details for a specific repository.

Input

{
  "owner": "username",
  "repo": "github-mcp"
}

Response

{
  "name": "github-mcp",
  "description": "GitHub MCP Server",
  "stars": 10,
  "forks": 2
}

šŸ”„ MCP Request Flow

User
 │
 ā–¼
MCP Client
 │
 ā–¼
Tool Call
 │
 ā–¼
GitHub MCP Server
 │
 ā–¼
GitHub REST API
 │
 ā–¼
Response Returned

🚧 Planned Enhancements

  • Create GitHub Issues
  • Close Issues
  • Pull Request Management
  • Branch Management
  • File Operations
  • GitHub Actions Integration
  • Repository Search
  • Code Search
  • OAuth Authentication
  • Remote MCP Deployment

🧠 Learning Outcomes

This project demonstrates:

  • Model Context Protocol (MCP)
  • MCP Tools
  • JSON-RPC Communication
  • GitHub REST API Integration
  • Authentication using PAT
  • MCP Inspector Usage
  • Production MCP Architecture
  • Local MCP Server Development

šŸ“„ License

MIT License


šŸ‘Øā€šŸ’» Author

Built as a learning and production-ready MCP project for understanding MCP architecture, GitHub integrations, and AI tooling ecosystems.

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
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
Qdrant Server

Qdrant Server

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

Official
Featured