whygraph MCP server
Commit Nov 13, 2026Provides AI editors with code rationale by synthesizing git history, pull requests, and call-graph context.
Also known as mtrdesign/whygraph
- Stars
- 4
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 13, 2026
- License
- —
What is whygraph MCP?
whygraph provides AI editors with code rationale by synthesizing git history, pull requests, and call-graph context.
Summary generated from the project's README
About whygraph MCP server
WhyGraph acts as a rationale layer for AI editors by explaining the reasoning behind code changes rather than just describing the syntax. It works by synthesizing data from git history, GitHub pull requests, commits, and blame information to provide context on why specific code exists. Developers can use this through an HTTP MCP endpoint that connects their editor to the server, or via a local web portal that includes a code graph Explorer and a Chat assistant.
Users can set up the service using a CLI command or a Docker-based installation. Once running, the portal allows you to add project folders and manage GitHub API keys and tokens directly within the web interface settings. The system maintains a persistent cache and uses git hooks to keep project information fresh. It provides structured rationale cards that detail the purpose, constraints, tradeoffs, and risks associated with different code chunks.
What you can do with it
- 1Understand code reasoningAsk an AI editor to explain the historical purpose and constraints of a specific code block.
- 2Analyze repository historyRequest a summary of the pull requests and issues that led to current implementation decisions.
- 3Query repository contextChat with an assistant to get answers about a specific repository using built-in tools.
Written from the project's README. Every use case is checked against a quote from it.
README
View on GitHubwhygraph
Rationale layer over CodeGraph: explains why code exists, not just what it does.
For each chunk of code, WhyGraph collects evidence from git history and GitHub - commits, blame, PRs, the issues those PRs closed - then serves it to AI editors over MCP, plus an on-demand rationale card (purpose, why, constraints, tradeoffs, risks) with a persistent cache.
The WhyGraph portal puts the same data in a local web panel: one server for all your projects, with an Explorer over the code graph and a Chat assistant that answers questions about the repo by calling WhyGraph's own tools. Each project also gets an HTTP MCP endpoint for your editor.
📖 Full documentation → https://mtrdesign.github.io/whygraph/
Installation, configuration, the CLI and MCP reference, the Docker delivery, and the service model all live there. This README is just the elevator pitch.
Quickstart
Install WhyGraph once, start the portal, and add your repos from the browser:
whygraph up --add-folder ~/Work # start the portal, sharing the folder that holds your repos
# open http://127.0.0.1:8765, then add a project: configure, initialize, first scan
The portal initializes each repo, connects your agents over HTTP MCP, runs every scan, and keeps projects fresh from git hooks. Enter API keys and tokens under Settings - variables in your shell do not reach it.
The only-Docker install needs nothing but Docker on the host - one command pulls the image and installs the shims from inside it. The tag in the URL is the version you get:
curl -fsSL https://raw.githubusercontent.com/mtrdesign/whygraph/v2.4.0/scripts/install.sh | sh
See the Getting Started guide for the install and the Quickstart for the walkthrough.
Develop
uv sync # bootstrap .venv and install deps
uv run pytest # full test suite, in parallel
uv run whygraph version # CLI sanity check
make dev-local # develop natively: portal (:8777) + Vite HMR (:5174); open :5174
make dev-docker # the same inside the image, through the real shim
make prod # the image exactly as released, through the shim
make check # everything CI runs, plus e2e and the release smoke test
make check-fast # the same without the image build and the smoke test
A Makefile wraps the common dev tasks; run make to list them, and see Developing WhyGraph. See CLAUDE.md for the architecture and conventions.
whygraph MCP questions
What information does WhyGraph provide for code chunks?
It collects evidence from git history and GitHub, including commits, blame, PRs, and the issues those PRs closed.
How can I install WhyGraph using Docker?
You can use a single curl command to pull the image and install the shims.
Does the WhyGraph portal support multiple projects?
Yes, the portal acts as one server for all your projects and includes an Explorer and a Chat assistant.