๐ง GitHub MCP Tool Server
April 17, 2025 ยท View on GitHub
This repo contains a lightweight MCP (Model Context Protocol) server that exposes simple GitHub utilities โ allowing AI applications like Cursor or Claude to interact with GitHub repositories.
โจ Features
- โ
get_repo_summary(repo_url)โ Fetches basic metadata of a GitHub repository - โ
get_recent_commits(repo_url, count)โ Lists the most recent commits to a repo
๐ Getting Started
๐ฆ Requirements
- Python 3.10+
uvpackage manager (recommended)- GitHub Personal Access Token (optional, but prevents rate limiting)
โ๏ธ Installation
# Clone the repo
git clone https://github.com/rajpanjabi/MCP.git
cd MCP
# Create virtual environment
uv venv .venv
source .venv/bin/activate
# Install dependencies
uv pip install httpx mcp
๐ก Optionally, create a
.envfile or export your GitHub token:
export GITHUB_PAT=ghp_yourTokenHere
๐ ๏ธ Usage with MCP
You can run this server using:
uv run github_tool_mcp_server.py
It will launch in stdio mode and wait for tool calls via an MCP-compatible orchestrator like Claude Desktop or Cursor.
๐ฅ๏ธ Cursor Integration (Optional)
Add the following to your cursor.config.json:
{
"mcpServers": {
"github": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/your/project",
"run",
"github.py"
]
}
}
}
Replace
/absolute/path/to/your/projectwith your actual directory.
๐งช Example Tools
๐ 1. get_repo_summary
{
"name": "get_repo_summary",
"arguments": {
"repo_url": "https://github.com/username/repositoryname"
}
}
Output:
**username/repositoryname**
Description: Lorem ipsum nhwjsrecv dweicdjv
Stars: 10 | Forks: 2
Language: JavaScript | Open Issues: 1
Updated: 2024-11-22T18:22:33Z
๐ต๏ธ 2. get_recent_commits
{
"name": "get_recent_commits",
"arguments": {
"repo_url": "https://github.com/username/repositoryname",
"count": 3
}
}
Output:
[abc1234] by Raj: Added README structure
[def5678] by Raj: Fixed deployment config
[xyz9999] by Raj: Initial commit