GitHubMcpServer
Allows AI agents to interact with GitHub repositories to fetch metadata, manage settings, track repository activity such as pushes and merges, list user repositories, and create new repositories via the GitHub REST API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GitHubMcpServershow me the details for my 'fast-mcp' repository"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GitHubMcpServer
A Custom GitHub MCP (Model Context Protocol) Server that exposes GitHub API operations as AI-ready tools for LLM agents and applications.
Overview • Features • Installation • Tools • Configuration • Usage
📖 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 |
🌐 CORS Enabled | Ready for browser-based or cross-origin MCP clients |
🔒 Secure Auth | Token-based authentication via |
📋 Prerequisites
Python 3.10+
A GitHub Personal Access Token (PAT) with required scopes
uv(recommended) orpip
Required GitHub Token Scopes
Scope | Purpose |
| Full access to public & private repositories |
| 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 GitHUbMcpServer2. Install Dependencies
Using uv (recommended):
uv syncUsing 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_usernameVariable | Required | Description |
| ✅ | Your GitHub Personal Access Token |
| ✅ | Your GitHub username (repository owner) |
⚠️ Never commit your
.envfile to version control. It is already listed in.gitignore.
▶️ Running the Server
uv run python gitHubMcpServer.pyThe 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 |
|
| ✅ | 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 |
|
| ✅ Current repository name |
|
| New repository name |
|
| New description |
|
| Homepage URL |
|
|
|
|
|
|
|
| Enable/disable Issues tab |
|
| Enable/disable Projects tab |
|
| Enable/disable Wiki tab |
|
| Change default branch name |
|
| Allow squash merging |
|
| Archive the repository |
getRepoActivity
Fetches a list of recent activities (pushes, merges, branch changes) for a repository.
Parameters:
Name | Type | Description |
|
| ✅ Repository name |
|
|
|
|
| Git reference (e.g. |
|
| Filter by username |
|
|
|
|
|
|
Returns: Activity ID, user, type, branch, before/after SHA, timestamp.
geAllUserRepo
Lists all repositories for the authenticated user with pagination and sorting.
Parameters:
Name | Type | Description |
|
| Results per page (default: 30) |
|
| Page number for pagination |
|
| Sort by: |
createRepository
Creates a new GitHub repository under the authenticated user.
Parameters:
Name | Type | Description |
|
| ✅ Repository name |
|
| Short description |
|
|
|
|
| Initialize with a README |
🔌 Connecting an AI Client
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"github": {
"url": "http://localhost:10000/mcp",
"transport": "http"
}
}
}Python MCP Client
from mcp import ClientSession
from mcp.client.http import http_client
async with http_client("http://localhost:10000/mcp") as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
result = await session.call_tool("getUserRepo", {"repoName": "my-repo"})
print(result)📁 Project Structure
GitHUbMcpServer/
├── gitHubMcpServer.py # Main MCP server & all tool definitions
├── config.py # Pydantic settings & .env loader
├── pyproject.toml # Project metadata & dependencies
├── .python-version # Python version pin
├── .gitignore # Git ignore rules
├── uv.lock # Locked dependency versions
└── README.md # Project documentation🤝 Contributing
Contributions, issues and feature requests are welcome!
Fork the repository
Create your feature branch:
git checkout -b feature/amazing-featureCommit your changes:
git commit -m "Add amazing feature"Push to the branch:
git push origin feature/amazing-featureOpen a Pull Request
👤 Author
moksh555 · GitHub Profile
Built with ❤️ using FastMCP & Python
⭐ Star this repo if you find it helpful!
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/moksh555/GitHubMcpServer'
If you have feedback or need assistance with the MCP directory API, please join our Discord server