git-mcp
Provides tools for interacting with GitHub's REST API, enabling AI agents to search repositories, read files, list issues, manage pull requests, and retrieve user information directly from GitHub.
Click on "Deploy 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., "@git-mcp search code for FastMCP"
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.
git-mcp
A Model Context Protocol (MCP) server in Python that connects to GitHub via the REST API.
git-mcp lets Cursor (or any MCP-compatible AI client) talk to GitHub directly — search repos, read files, list issues, inspect pull requests, and more — without copying data into chat manually.
How it works
Cursor starts the server as a background process via your MCP config.
The server communicates over stdio (standard input/output).
When you ask something like “show open issues in my repo”, Cursor calls a tool on the server.
The server uses PyGithub and your GitHub token to call the GitHub REST API and returns JSON to the AI.
Cursor / AI ──stdio MCP──▶ git-mcp server ──REST API──▶ GitHub
│
└── GITHUB_TOKEN (.env)Tools are actions the AI can take. Resources (github://user, github://repos) are read-only context the AI can pull in automatically.
Related MCP server: GitHub MCP Server
Features
Tools
Tool | Description |
| Repository metadata |
| Branch list |
| Read a file (or list a directory) |
| Recent commits |
| Issues (excludes PRs) |
| Issue details + comments |
| Create an issue |
| Pull request list |
| PR details, reviews, and files |
| Repository search |
| Code search |
| User profile |
Resources
github://user— authenticated user profilegithub://repos— repositories you can access
Setup
1. Create a GitHub token
Create a Personal Access Token with scopes needed for your workflow (typically repo for private repos, or public_repo for public-only).
2. Install
cd git-mcp
python -m venv .venv
pip install -e .Activate the venv if you prefer (optional on Windows):
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activateOn Windows, if Activate.ps1 is blocked by execution policy, skip activation and use the venv Python directly:
.\.venv\Scripts\python.exe -m git_mcp.serverCopy .env.example to .env and set your token:
cp .env.example .env3. Run locally
git-mcp
# or
python -m git_mcp.serverCursor configuration
Add to your Cursor MCP settings (Settings → MCP → Add new MCP server, or edit ~/.cursor/mcp.json):
{
"mcpServers": {
"github": {
"command": "E:\\mission-x\\cursorWork\\git-mcp\\.venv\\Scripts\\python.exe",
"args": ["-m", "git_mcp.server"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}Adjust the Python path to your virtual environment. You can also rely on a .env file in the project root instead of putting the token in mcp.json.
Example tool calls
list_issues(owner="octocat", repo="Hello-World", state="open", limit=5)
get_pull_request(owner="octocat", repo="Hello-World", pr_number=1)
search_code(query="FastMCP in:file language:python")Ask in Cursor:
List the 5 most recent open issues in
myorg/myrepoand summarize them.
Cursor calls list_issues, gets structured JSON back, and summarizes — no manual tab switching.
git-mcp vs git vs GitHub CLI
git-mcp |
|
| |
Purpose | AI ↔ GitHub via MCP | Local repo operations | GitHub from terminal |
Used by | Cursor agent automatically | You in terminal | You in terminal |
Good for | Issues, PRs, search, remote files | Commit, push, branch locally | GitHub workflows from shell |
git-mcp is GitHub API integration for AI, not a replacement for local git commands like commit or push.
Requirements
Python 3.10+
mcp(Python SDK, v1.x)PyGithubpython-dotenv
Available Tools
12 toolscreate_issueC
Create a new issue in a repository.
Inputs: repo (required), owner (required), title (required), body, +1 more. Returns: result
get_file_contentB
Read a file from a repository. Optionally specify ref (branch, tag, or commit SHA).
Inputs: path (required), repo (required), owner (required), ref. Returns: result
get_issueC
Get full details and comments for an issue.
Inputs: repo (required), owner (required), issue_number (required). Returns: result
get_pull_requestB
Get pull request details including reviews and changed files.
Inputs: repo (required), owner (required), pr_number (required). Returns: result
get_repositoryB
Get metadata for a GitHub repository.
Inputs: repo (required), owner (required). Returns: result
get_user_infoC
Get public profile information for a GitHub user.
Inputs: username (required). Returns: result
list_branchesC
List branches in a repository.
Inputs: repo (required), owner (required), limit. Returns: result
list_commitsC
List recent commits, optionally filtered by branch.
Inputs: repo (required), owner (required), limit, branch. Returns: result
list_issuesB
List issues in a repository. Pull requests are excluded.
Inputs: repo (required), owner (required), limit, state, +1 more. Returns: result
list_pull_requestsC
List pull requests in a repository.
Inputs: repo (required), owner (required), limit, state. Returns: result
search_codeC
Search code across GitHub. Example query: 'addClass in:file language:js repo:jquery/jquery'.
Inputs: query (required), limit. Returns: result
search_repositoriesC
Search GitHub repositories.
Inputs: query (required), limit. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool targets a distinct resource and action with no overlap. Issues, branches, commits, pull requests, repositories, code search, and user info are all clearly separated, and list_issues explicitly excludes pull requests to avoid confusion.
All tools follow a consistent verb_noun snake_case pattern (e.g., create_issue, list_branches, get_file_content). The verbs and nouns are logically chosen, making the set predictable and easy to navigate.
With 12 tools, the server is well-scoped for interacting with GitHub repositories. Each tool serves a clear purpose without unnecessary bloat, fitting the typical range for a focused MCP server.
The tool set is heavily read-oriented (list, get, search) but lacks essential write operations for a full lifecycle. Missing update/delete for issues, no create for pull requests or repositories, and no branch creation or commit tools, leaving significant gaps for agent workflows.
Maintenance
Related MCP Connectors
Access the GitHub API, enabling file operations, repository management, search functionality, and…
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Manage repositories, users, releases, and automate GitHub workflows
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with GitHub repositories through the GitHub API, allowing file operations, repository management, issue tracking, and code search through natural language commands.334MIT
- AlicenseAqualityNot gradedmaintenanceEnables AI agents to interact with GitHub repositories through the GitHub REST API for managing files, issues, and repository metadata. It supports both read operations like searching code and write operations such as creating repositories and updating issue comments.9-
- AlicenseAqualityDmaintenanceEnables interaction with GitHub repositories, issues, pull requests, code search, branches, and GitHub Actions workflows.8MIT
- FlicenseCqualityDmaintenanceEnables AI assistants to interact with GitHub repositories via the REST API, supporting repository listing, detail retrieval, and issue management.2-