GitHub MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add -e "GITHUB_ACCESS_TOKEN=${GITHUB_ACCESS_TOKEN}" -e "OWNER_NAME=${OWNER_NAME}" github-mcp-server -- uv run gitHubMcpServer.py
Required:GITHUB_ACCESS_TOKENOWNER_NAME
README.md

A Custom GitHub MCP Server that exposes GitHub API operations as AI-ready tools

GitHubMcpServer

A Custom GitHub MCP (Model Context Protocol) Server that exposes GitHub API operations as AI-ready tools for LLM agents and applications.

OverviewFeaturesInstallationToolsConfigurationUsage


📖 Overview

GitHubMcpServer is a lightweight, high-performance MCP server built with FastMCP that bridges AI models and the GitHub REST API. It allows AI agents (such as Claude, GPT-4, etc.) to interact with GitHub repositories directly — fetching metadata, managing settings, tracking activity, listing and creating repositories — all through a standardized MCP interface over HTTP.

┌──────────────────────────┐        ┌───────────────────────────┐
│   AI Agent / LLM Client  │ ──────▶│   GitHubMcpServer         │
│  (Claude, GPT, etc.)     │◀────── │   FastMCP  •  Port 10000  │
└──────────────────────────┘        └──────────────┬────────────┘
                                                   │
                                       ┌───────────▼────────────┐
                                       │   GitHub REST API v3   │
                                       │   api.github.com       │
                                       └────────────────────────┘

✨ Features

Feature Description
🔍 Get Repository Info Fetch detailed metadata for any repository
✏️ Update Repository Settings Modify name, description, visibility, merge strategies & more
📊 Track Repository Activity Query push history, branch changes, merges with filtering
📂 List All Repositories Paginate and sort all user repositories
🆕 Create Repositories Spin up new repos with custom configuration
Async & Non-blocking Built with httpx and async/await for high performance
🌐 CORS Enabled Ready for browser-based or cross-origin MCP clients
🔒 Secure Auth Token-based authentication via .env file

📋 Prerequisites

  • Python 3.10+
  • A GitHub Personal Access Token (PAT) with required scopes
  • `uv` (recommended) or pip

Required GitHub Token Scopes

Scope Purpose
repo Full access to public & private repositories
read:user Read authenticated user profile data

💡 Generate your token at: GitHub → Settings → Developer Settings → Personal Access Tokens


🚀 Installation

1. Clone the Repository

git clone https://github.com/moksh555/GitHUbMcpServer.git
cd GitHUbMcpServer

2. Install Dependencies

Using uv (recommended):

uv sync

Using pip:

pip install "fastmcp>=3.1.1" httpx pydantic-settings

⚙️ Configuration

Create a .env file in the project root:

GITHUB_ACCESS_TOKEN=ghp_your_personal_access_token_here
OWNER_NAME=your_github_username
Variable Required Description
GITHUB_ACCESS_TOKEN Your GitHub Personal Access Token
OWNER_NAME Your GitHub username (repository owner)

⚠️ Never commit your .env file to version control. It is already listed in .gitignore.


▶️ Running the Server

uv run python gitHubMcpServer.py

The server starts on http://localhost:10000 using HTTP transport with CORS support.


🛠️ Available MCP Tools

`getUserRepo`

Retrieves detailed information for a specific GitHub repository.

Parameters:

Name Type Required Description
repoName string The name of the repository

Returns: ID, name, URL, privacy status, description, creation/update timestamps, primary language, open issues count.


`updateRepo`

Updates settings for an existing repository. Only provide fields you want to change.

Parameters:

Name Type Description
repoName string ✅ Current repository name
name string New repository name
description string New description
homepage string Homepage URL
private bool true for private, false for public
visibility string public or private
has_issues bool Enable/disable Issues tab
has_projects bool Enable/disable Projects tab
has_wiki bool Enable/disable Wiki tab
default_branch string Change defa

Tools (2)

getUserRepoRetrieves detailed information for a specific GitHub repository.
updateRepoUpdates settings for an existing repository.

Environment Variables

GITHUB_ACCESS_TOKENrequiredYour GitHub Personal Access Token
OWNER_NAMErequiredYour GitHub username (repository owner)

Configuration

claude_desktop_config.json
{ "mcpServers": { "github": { "command": "uv", "args": [ "run", "gitHubMcpServer.py" ], "env": { "GITHUB_ACCESS_TOKEN": "your_token", "OWNER_NAME": "your_username" } } } }

Try it

Get the repository information for my project 'GitHubMcpServer'.
Update the description of my repository 'my-project' to 'An AI-managed repository'.
Change the visibility of my repository 'test-repo' to private.
Check the current settings and default branch for my repository 'my-repo'.

Frequently Asked Questions

What are the key features of GitHub MCP Server?

Fetch detailed metadata for any repository. Modify repository settings including visibility and merge strategies. Query push history and branch changes. List and paginate all user repositories. Create new repositories with custom configuration.

What can I use GitHub MCP Server for?

Automating repository setup and configuration for new projects. Programmatically updating repository metadata and settings via AI. Monitoring repository activity and branch status through LLM agents. Managing repository visibility and feature flags (issues, wiki, projects) at scale.

How do I install GitHub MCP Server?

Install GitHub MCP Server by running: uv sync

What MCP clients work with GitHub MCP Server?

GitHub MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep GitHub MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare