RepoImmune MCP Server

RepoImmune MCP Server

Enables querying a repository's resolved bug history through six read-only tools, allowing agents to check patches against past failures, retrieve regression tests, and replay behavior cases to prevent regressions.

Category
Visit Server

README

<p align="center"> <img src="assets/logo.svg" width="420" alt="RepoImmune — repository regression immunity"> </p>

<p align="center"><strong>Give your coding agent a memory of every bug your repository already fixed.</strong></p>

<p align="center"> <a href="https://github.com/Alex0AI/RepoImmune/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/Alex0AI/RepoImmune/actions/workflows/ci.yml/badge.svg"></a> <a href="https://github.com/Alex0AI/RepoImmune/releases"><img alt="Release" src="https://img.shields.io/github/v/release/Alex0AI/RepoImmune"></a> <a href="LICENSE"><img alt="Apache 2.0" src="https://img.shields.io/badge/license-Apache--2.0-58f2ac"></a> </p>

RepoImmune turns a repository's resolved bugs into code-native, evidence-backed checks that can be queried by humans and coding agents.

Input Processing Output
A GitHub repository or PR diff Retrieve historical issue → fix → test → AST evidence Exact regression location, source links, protected tests, and the historical fix

RepoImmune live demo: patch evidence and capsule replay

60-second quick start

git clone https://github.com/Alex0AI/RepoImmune.git
cd RepoImmune
python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS/Linux: source .venv/bin/activate
python -m pip install -e .
repoimmune init .
repoimmune check --diff examples/reintroduce-astropy-12907.diff --memory examples/memory
repoimmune replay astropy-12907 --memory examples/memory
repoimmune report --format html

The demo is offline, keyless, and dependency-free at runtime. The check intentionally exits 2 because it finds a real historical regression from Astropy PR #12907.

What is executable memory?

A Behavior Card is not a chat summary. It binds an invariant to before/after code, AST form, exact symbols, regression tests, commits, source URLs, license, evidence class, and an optional replay capsule. RepoImmune refuses to promote a mined candidate when the evidence chain is incomplete.

flowchart LR
  I[Issue / report] --> B[Buggy commit]
  B --> F[Failing behavior]
  F --> P[Fix PR / commit]
  P --> T[Regression test]
  T --> S[AST + symbol change]
  S --> V[Repository invariant]
  V --> C[Patch immunity check]

The included vertical slice detects this exact reversion:

- cright[-right.shape[0]:, -right.shape[1]:] = right
+ cright[-right.shape[0]:, -right.shape[1]:] = 1

It reports the precise line, explains why the all-ones block was historically wrong, links the issue/PR/merge commit, and names the pytest cases added with the fix.

CLI

repoimmune init .
repoimmune mine --repo owner/project
repoimmune check --diff HEAD~1
repoimmune recall "pagination returns duplicate rows"
repoimmune explain <behavior-card-id>
repoimmune replay <capsule-id>
repoimmune report --format html
repoimmune validate <card.json>

check emits Markdown, JSON, or SARIF. mine saves conservative candidates only; it never calls an LLM and does not claim a Behavior Card from a title alone.

Agent and CI integrations

  • The composite GitHub Action analyzes pull-request diffs read-only and uploads SARIF/Markdown evidence.
  • The stdio MCP server exposes six structured, read-only tools: search_past_failures, explain_code_history, check_patch_against_memory, list_invariants_for_file, get_regression_test, and replay_behavior_case.
  • The open Agent Skill asks an agent to recall history before risky edits and again before claiming completion. It grants no commit, push, merge, or test-bypass authority.
  • The static demo works without login or an API key.

Evidence classes

Every result is explicitly one of:

  • verified: directly replayed or mechanically corroborated with primary code/test evidence.
  • externally_reported: trusted upstream or benchmark execution record, not reproduced here.
  • heuristic: useful candidate or similarity signal, not proof.
  • inconclusive: conflicting or incomplete evidence.

A similarity score is never presented as proof. Findings always show the matched code and source evidence.

Why this is different

  • Agent/chat memory: remembers conversations or repository facts; RepoImmune mines code history and creates mechanical checks that outlive any agent session.
  • SWE-bench: evaluates whether an agent can repair an issue; RepoImmune converts resolved issues into durable prevention assets.
  • Static analysis: starts from general rules; RepoImmune learns repository-specific invariants from that repository's real failures.
  • Test generation: may create tests; RepoImmune preserves the causal chain among report, buggy/fixed code, test, and invariant.
  • git blame: tells who and when; RepoImmune explains why behavior must survive and can check it.

See research-landscape.md for the evidence-backed comparison.

Security model

Issue text, PR comments, code, patches, and repository metadata are untrusted data. RepoImmune never evaluates them as instructions. Mining uses bounded HTTPS responses; refs and repository names are validated; capsule runs use fixed argv without a shell, reject absolute paths and symlinks, and time out. Unknown repositories' install scripts or tests are never run by default. See SECURITY.md and docs/threat-model.md.

Current scope and honest limits

The alpha deeply supports Python AST and pytest evidence. TypeScript/TSX has an optional pinned tree-sitter adapter for normalized structure and call extraction; JavaScript uses deterministic token structure, and Jest/Vitest can be recorded as test evidence. Whole-program interprocedural reachability, automatic upstream environment reconstruction, and broad language support are roadmap items. Dataset-scale cards are externally_reported until replayed; the bundled Astropy vertical slice is the only locally verified behavioral capsule in v0.1.0.

Reproducibility

python scripts/build_research_snapshot.py --limit 500 --cards 120
python scripts/run_experiments.py
pytest
coverage run -m pytest && coverage report
ruff check . && mypy src/repoimmune

All published counts are regenerated into research/results.json; classifications and limitations are preserved, including unsuccessful or inconclusive cases. Data provenance lives in DATA_SOURCES.md, THIRD_PARTY.md, and research/data-card.md.

The committed v0.1 snapshot contains 500 candidates, 120 Behavior Cards, 12 repositories, and 30 lightweight structural capsules. On deterministic mutations it detected 120/120 exact historical reversions and 120/120 protected assertion deletions; same-symbol fixed-form refactors produced 9/120 false positives (7.5%). Title-derived retrieval reached Recall@5/MRR 1.0/1.0, but this is explicitly a same-source plumbing test. Independent mining precision and controlled Agent A/B remain inconclusive.

Contributing

Read CONTRIBUTING.md, the roadmap, and the Behavior Card schema before proposing a new miner or evidence source. Apache-2.0 licensed.

中文说明:README.zh-CN.md

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