Github-MCP-Server
mani24singh/Github-MCP-Server
A production-ready GitHub stats server with error handling, streaming HTTP, and Claude Desktop integration
Instalação
npx convez-ai mani24singh/Github-MCP-Server1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
README
A tradução para o português deste README ainda está na fila.
GitHub MCP Server
A simple Model Context Protocol (MCP) server built with FastMCP that integrates with the GitHub API.
Features
Tools
get_github_user
Fetch public GitHub profile information:
- Name
- Bio
- Followers
- Public Repositories
- Location
- Profile URL
get_github_repos
Fetch a user's most recently updated public repositories:
- Repository Name
- Language
- Stars
- Description
Resource
github://user/{username}
Provides a GitHub user's profile as an MCP Resource, allowing MCP clients such as Claude to use it as context.
Tech Stack
- Python
- FastMCP
- MCP SDK
- HTTPX
- GitHub REST API
Installation
Clone the repository:
git clone https://github.com/mani24singh/Github-MCP-Server.git
cd Github-MCP-Server
Install dependencies:
uv sync
Run the Server
Local (Claude Desktop / stdio)
uv run python server.py
HTTP Mode
uv run python server.py http
MCP endpoint:
http://localhost:8000/mcp
Testing with MCP Inspector
Start Inspector:
uv run mcp dev server.py
Open the generated Inspector URL from the terminal and connect using the provided session token.
Example Tool Call
Tool:
get_github_user
Input:
{
"username": "torvalds"
}
Error Handling
The server uses MCP-native error handling via:
McpError
ErrorData
INVALID_PARAMS
INTERNAL_ERROR
Handled scenarios include:
- Empty username
- Invalid GitHub user
- API timeout
- GitHub rate limits
- Unexpected API errors
Claude Desktop Configuration
Find your Claude Desktop configuration file and add:
{
"mcpServers": {
"github-stats": {
"command": "<path-to-uv>",
"args": [
"run",
"--directory",
"<project-directory>",
"python",
"server.py"
]
}
}
}
Example UV path on Windows:
C:\Users\<username>\anaconda3\Scripts\uv.exe
Restart Claude Desktop after updating the configuration.
Remote MCP Server
When hosting publicly, Claude can connect directly via URL:
{
"mcpServers": {
"github-stats": {
"url": "http://your-server-ip:8000/mcp"
}
}
}
Start the server:
uv run python server.py http
For production deployments, place a reverse proxy such as Nginx in front and enable HTTPS.
Project Structure
Github-MCP-Server/
├── server.py
├── pyproject.toml
├── uv.lock
├── README.md
└── .gitignore
What This Project Demonstrates
- MCP Tools
- MCP Resources
- MCP Error Handling
- MCP Inspector
- Claude Desktop Integration
- GitHub API Integration
- Local (stdio) Transport
- Streamable HTTP Transport
License
MIT