GitPilot MCP

GitPilot MCP

An autonomous agent that automates GitHub contributions end-to-end, from issue analysis and code changes to pull requests, conflict resolution, and review updates.

Category
Visit Server

README

GitPilot MCP

An autonomous MCP-powered agent that automates GitHub contributions end-to-end, from issue analysis and code changes to pull requests, conflict resolution, and review updates.


๐Ÿš€ Overview

GitPilot MCP is an Autonomous GitHub Contribution Agent built using the Model Context Protocol (MCP). It helps developers and contributors automate the full open-source workflow:

  • Forking repositories
  • Analyzing issues
  • Making code changes
  • Running tests
  • Creating pull requests
  • Syncing with upstream changes
  • Handling merge conflicts
  • Updating PRs based on maintainer feedback

The agent is designed to be minimal, safe, and extensible, without overengineering.


โœจ Key Features

  • ๐Ÿ” Fork & clone GitHub repositories
  • ๐ŸŒฟ Create and manage feature branches
  • ๐Ÿ”„ Sync fork with upstream when new PRs are merged
  • ๐Ÿง  Semantic code understanding using RAG
  • โœ๏ธ Generate minimal, clean git diffs
  • ๐Ÿงช Run tests and retry fixes automatically
  • ๐Ÿ“ฆ Commit & push changes
  • ๐Ÿ”€ Create pull requests programmatically
  • ๐Ÿ› ๏ธ Update existing PRs after review feedback
  • โš ๏ธ Detect merge conflicts before PR updates

๐Ÿง  Architecture (High Level)

Issue โ†’ Code Context (RAG) โ†’ Patch โ†’ Tests โ†’ Commit โ†’ PR
              โ†‘
      Sync / Review Feedback

The system follows real-world open-source contribution practices.


๐Ÿ“‚ Project Structure

mcp-github/
โ”‚
โ”œโ”€โ”€ main.py        # MCP server & tools
โ”œโ”€โ”€ rag.py         # RAG indexing and search
โ”œโ”€โ”€ config.py      # GitHub token & workspace
โ”œโ”€โ”€ .rag/          # Vector store (local)
โ””โ”€โ”€ README.md

๐Ÿงฉ Installation & Setup

Make sure you have the following installed:

  • Python 3.10+
  • Git
  • Claude Desktop (latest version)
  • Ollama (for embeddings)

Step 1: Install uv

uv is used for dependency management and isolated execution.

pip install uv

Step 2: Clone the Repository

git clone https://github.com/<your-username>/GitPilot-MCP.git
cd GitPilot-MCP

Step 3: Initialize the Project (uv)

Initialize the project environment:

uv init

Step 4: Install Dependencies

Add all required dependencies:

uv add fastmcp gitpython pygithub python-dotenv numpy faiss-cpu ollama

Step 5: For MCP tools testing

uv run fastmcp dev main.py

โš™๏ธ MCP Server Configuration

Use the following configuration to run the MCP server locally via uv + fastmcp in Claude-desktop:

paste this configuration in claudee-desktop-config file.

{
  "mcpServers": {
    "GitPilot-MCP": {
      "command": "<PATH_TO_PYTHON>/Scripts/uv.exe",
      "args": [
        "run",
        "--project",
        "<PATH_TO_PROJECT_ROOT>",
        "--directory",
        "<PATH_TO_PROJECT_ROOT>",
        "fastmcp",
        "run",
        "main.py"
      ],
      "transport": "stdio"
    }
  }
}

๐Ÿ” Configuration

Create a config.py file:

GITHUB_TOKEN = "your_github_personal_access_token"
WORKSPACE = "./workspace"

โš ๏ธ The token must have permissions to fork repositories and create pull requests.


๐Ÿ› ๏ธ Available MCP Tools

Some important tools exposed by the agent:

  • fork_repo
  • clone_repo
  • create_branch
  • sync_with_upstream
  • index_repo
  • get_repo_context
  • apply_patch
  • run_tests
  • retry_fix_with_tests
  • commit_and_push
  • create_pull_request
  • check_for_conflicts
  • update_pr_after_feedback

Each tool is single-responsibility and composable.


๐Ÿงช Testing Workflow

  1. Apply generated patch
  2. Run tests (pytest -q by default)
  3. Retry fixes automatically if tests fail
  4. Stop immediately once tests pass

๐Ÿ”„ Handling Maintainer Feedback

When a maintainer requests changes:

  • Generate a new patch
  • Apply it to the same branch
  • Commit & push

The existing PR updates automatically. No new PRs are created.


๐Ÿงฉ Design Principles

  • โœ… Minimal diffs
  • โœ… Short, inline comments only when necessary
  • โœ… No hard refresh or destructive git actions
  • โœ… No silent failures
  • โœ… Extensible for future improvements

๐Ÿšง Limitations

  • Repository indexing may be limited on very large repos
  • Conflict resolution is assisted, not fully automatic
  • Designed for local / controlled environments (remote hardening can be added later)

๐Ÿ”ฎ Future Improvements

  • Scoped repository indexing
  • PR comment parsing
  • CI status polling
  • Refresh-token support
  • Remote multi-user MCP deployment

๐Ÿ“œ License

MIT License (or as per your choice)


๐Ÿ™Œ Acknowledgements

Built using:

  • FastMCP
  • GitPython
  • PyGitHub
  • Ollama (for embeddings)
  • Qdrant / FAISS (vector search)

๐Ÿ‘จโ€๐Ÿ’ป Author

Divyanshu Giri

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured