mcp-diff-system

mcp-diff-system

Fetches, summarizes, and reviews GitHub code diffs with asynchronous processing for large diffs.

Category
Visit Server

README

mcp-diff-system

An MCP server that fetches, summarizes and reviews GitHub code diffs — built with FastMCP and deployed on AWS Fargate, with an SQS worker plane so that LLM calls never block the request/response cycle.

Built in phases. Each phase is tagged, runs on its own, and ends with something demonstrable. See ROADMAP.md for the full plan and docs/diagrams for the target architecture.

Current phase: 1 — walking skeleton. One tool, get_diff, hitting the real GitHub API. No auth, no AWS, no LLM.


The core design decision

A large diff takes 30–90 seconds to summarize. ALB idle timeouts — and MCP client patience — are both shorter than that.

So the summarize/review tools (Phase 3) don't call the LLM inline. They persist the diff, enqueue a job, and return a job_id in ~50ms. A separate worker tier, autoscaled on queue depth, does the slow work. One large diff can then never hold a connection open or starve capacity for anyone else.

get_diff stays synchronous, because a GitHub API call is a fast network round trip and the async job machinery would be overhead for no benefit.


Phase 1: running it

Requires Python 3.11+.

pip install -e ".[dev]"
cp .env.example .env        # optionally add a GitHub token

A token is optional for public repos, but without one GitHub allows only 60 requests/hour instead of 5000. You will hit that.

Start the server:

python -m src.api.server        # HTTP transport on :8000

Or poke at the tools interactively:

fastmcp dev src/api/server.py   # opens MCP Inspector

Then call get_diff with, say, repo=psf/requests, base=v2.31.0, head=v2.32.0.

Connecting Claude Desktop

{
  "mcpServers": {
    "diff": {
      "command": "python",
      "args": ["-m", "src.api.server"],
      "cwd": "/absolute/path/to/mcp-diff-system"
    }
  }
}

Tests

pytest
ruff check src tests

Two things about GitHub's diff API

Both are easy to get wrong, and both are pinned by tests in tests/test_github_client.py:

  1. The diff media type goes in the Accept header, not a query parameter. Send Accept: application/vnd.github.diff. Get this wrong and GitHub quietly returns JSON instead of a diff — no error, just garbage flowing downstream.

  2. Rate limiting is a 403, not a 429. The signal is x-ratelimit-remaining: 0. Keying off that header beats string-matching the response body.


Roadmap

Phase Adds Status
0 Repo skeleton, CI, lint, tests Done
1 FastMCP server, get_diff Done
2 S3 + DynamoDB + SQS job plane (stub worker, no LLM) Next
3 Diff chunker + Anthropic client — real summaries
4 Circuit breakers, retries, DLQ, idempotent claim
5 JWT auth, atomic Redis rate limiting, payload guard
6 Correlation IDs, CloudWatch metrics, X-Ray
7 Terraform, dual ECS services, autoscaling, OIDC CI/CD

License

MIT

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
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
Qdrant Server

Qdrant Server

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

Official
Featured