A powerful MCP (Model Context Protocol) server that enables AI agents and LLMs to safely manage GitHub repositories through a feature-branch workflow. It provides a complete set of tools for repository exploration, code editing, and pull request management - all while enforcing branch protection rules.
This project was built as an alternative to Claude Code. The inspiration came from the limitation that Claude Code does not provide access to Opus 4.5 on the lower tiers(free/pro). By using this MCP server with any MCP-compatible client, you can get Claude Code-like functionality with any model you want, including Opus 4.5.
Think of it as Claude Code, but:
- Works with Opus 4.5 (or any other model)
- Operates through GitHub's API for safer, auditable changes
- Enforces PR-based workflow instead of direct file system access
RepoMCP exposes GitHub repository operations as MCP tools that can be used by AI assistants like Claude, GPT, or any MCP-compatible client. It enforces a safe, feature-branch workflow where all changes go through pull requests rather than direct commits to protected branches.
Want to test RepoMCP before deploying your own? Use this live demo server:
MCP Endpoint: https://repo-mcp.vercel.app/mcp
Connected Repository: github.com/areeb1501/InstantMCP
Add the endpoint URL to any MCP-compatible client and start exploring. Any changes you make will create branches and PRs on the demo repository.
| Tool | Description |
|---|---|
list_branches |
List all branches in the repository |
create_branch |
Create a new feature branch or reuse an existing one |
delete_branch |
Delete a branch from the repository |
get_file |
Read file contents and metadata from a specific branch |
create_or_update_file |
Create a new file or completely rewrite an existing file |
patch_file |
Apply targeted patches to modify specific sections of a file |
delete_file |
Delete a file from a feature branch |
rename_or_move_file |
Rename or move a file to a new location |
list_repository_tree |
Get complete recursive directory structure |
check_file_exists |
Check if a file or directory exists |
find_files |
Find files by name or path pattern |
search_file_contents |
Search for patterns in file contents using regex |
search_code |
Advanced code search for functions, classes, imports |
get_diff |
Get the diff between two branches |
list_commits |
List recent commits on a branch |
get_commit |
Get detailed information about a specific commit |
list_pull_requests |
List pull requests in the repository |
get_pull_request |
Get detailed information about a specific PR |
create_pull_request |
Create a pull request from a feature branch |
reset_branch_to_commit |
Reset a feature branch to a specific commit |
revert_file_to_commit |
Revert a specific file to its state at a given commit |
show_common_workflows |
Get step-by-step examples of typical workflows |
Let an AI assistant find and fix bugs, typos, or issues across your codebase - all through safe PRs.
Automatically update README files, add missing documentation, or fix outdated information.
Move files, rename modules, and reorganize project structure with AI assistance.
Search codebases for patterns, find TODOs, or analyze code structure before making changes.
Explore unfamiliar codebases, understand project structure, find function definitions, trace imports, and get up to speed quickly on any repository.
Create new features spanning multiple files with proper branch management.
Update configuration files, package versions, or environment settings safely.
- Safe Repository Access: Blocks direct pushes to protected branches (main, master, production)
- Consistent Workflow: Enforces feature-branch workflow for all changes
- AI-Friendly Operations: Provides structured tools that AI can use reliably
- Efficient Editing:
patch_fileallows targeted edits without regenerating entire files - Code Discovery: Search and explore codebases before making changes
- History Management: Revert files or reset branches when needed
pip install -r requirements.txtCopy the example environment file and fill in your values:
cp .env.example .envLocal development:
python server.pyOr with uvicorn:
uvicorn server:app --reload --port 8000The MCP endpoint will be available at: http://localhost:8000/mcp
The fastest way to get started - deploy in under 5 minutes:
-
Fork/Clone this repository to your GitHub account
-
Go to Vercel and create a new project
-
Import the repository from your GitHub account
-
Add environment variables in the Vercel project settings:
Variable Description GITHUB_TOKENYour GitHub Personal Access Token (create one here) REPO_OWNERYour GitHub username or organization name REPO_NAMEThe repository you want to manage -
Deploy - Vercel will automatically build and deploy
-
Start using it - Your MCP endpoint is ready at:
https://your-project.vercel.app/mcp
You can now connect this URL to any MCP-compatible client and start using Opus 4.5 (or any model) with full GitHub repository access.
For local development or testing, expose your localhost using ngrok:
# Terminal 1: Start the server
python server.py
# Terminal 2: Expose with ngrok
ngrok http 8000ngrok will provide a public URL like https://abc123.ngrok.io. Your MCP endpoint will be at: https://abc123.ngrok.io/mcp
1. list_branches() -> See existing branches
2. create_branch("feature") -> Create/reuse feature branch
3. get_file("src/app.py") -> Read existing code
4. patch_file(...) -> Make targeted edits
5. get_diff("main", "feature") -> Review changes
6. create_pull_request(...) -> Open PR for review
- Python 3.12+
- GitHub Personal Access Token with repo permissions
- FastAPI, FastMCP, and other dependencies (see requirements.txt)
MIT