Maps any repo into an architecture diagram (Mermaid/Graphviz) and enforces architecture rules in CI
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Understand any codebase in 60 seconds. An MCP server that turns any repository into an architecture diagram.
Point your LLM at a folder and get back an architecture map: languages, frameworks, entry points, modules, and an import graph β rendered as a Mermaid diagram you can drop into a PR, a doc, or an onboarding guide.
It is model-agnostic. It speaks the Model Context Protocol over stdio, so it works with Claude Code, Claude Desktop, Cursor, Cline, Copilot, or the OpenAI Agents SDK β no Claude-specific dependency.
The server extracts hard facts. The model does the reasoning.
repo-cartographer never tries to "understand" your code semantically. It parses deterministic facts β file tree, import edges, manifests, framework detection, entry points β and hands your LLM structured JSON plus a draft diagram. Your model turns those facts into the final narrative and a refined diagram.
That split keeps the server small, fast, testable, and portable β and it means the diagram is grounded in what's actually in the repo, not hallucinated.
Running generate_diagram against this repo produces (a draft the model then refines):
A self-contained, shareable HTML render is committed under examples/ (both a high-level and a file-level detail view).
Requires Node.js 18+.
The server communicates over stdio; AI clients launch it that way. You can also use it directly from a terminal β see below.
The same binary is dual-mode: with no arguments it's the MCP server; with a subcommand it's a plain CLI for humans and CI.
Zip-friendly: if you point it at an extracted "Download ZIP" folder (repo-main/ wrapper and all), it detects the wrapper and maps the real repo root β noted in the output, never silent.
Two output notations, one strategy: Mermaid because that's where people read it (GitHub renders it natively in PR comments and READMEs), DOT because that's what their tools eat (pipe it into Graphviz, Backstage, or anything else: dot -Tsvg architecture.dot). Both come with the same shareable HTML page and role-colored modules. When the repo has a .cartographer.yml, its diagram: section supplies the defaults for --level, --format and -o; explicit flags always win.
check reads a rules file and flags forbidden cross-boundary imports and dependency cycles β deterministically, no LLM involved, so it's safe to gate a merge:
Adopting on an existing codebase? Record today's violations as an accepted baseline, so only new ones fail the build:
Commit that file; later runs auto-detect it and pass unless a PR introduces a new violation.
A composite action (action.yml) runs check on every PR β failing the
build on an error-level violation and posting a sticky comment with the diagram and
any violations:
This repo dogfoods it in .github/workflows/architecture.yml.
Full design + phases: docs/github-action.md.
Then ask: "Use repo-cartographer to map ./my-project and draw me an architecture diagram."
Add to claude_desktop_config.json:
Same server, a different model β the whole point of MCP:
| Tool | What it returns |
|---|---|
map_repo(path, level?, format?, outPath?) | The one-shot flow. Point it at a folder and get a downloadable architecture diagram (architecture.html + .mermaid/.dot) plus a facts summary and the draft source inline β in a single call. |
scan_repo(path) | Languages, frameworks, entry points, top-level modules (with role guesses), and a manifest summary β as JSON facts. |
build_import_graph(path) | Intra-repo import/require edges for JS/TS + Python. Nodes are files, auto-collapsed to module level for large repos. |
generate_diagram(path, level?, format?) | A draft diagram. level = "high" (modules, default) or "detail" (files grouped by module); format = "mermaid" (default) or "dot" (Graphviz). |
render_diagram(source, outPath, format?) | Writes a self-contained, styled .html (renders via CDN: Mermaid, or Viz for DOT) plus the raw .mermaid/.dot file. |
| Resource | |
|---|---|
about://author | Who built this and how to reach them (Markdown). |
Most of the time you just want map_repo β "path in, diagram out." Reach for the four granular tools only when you want to compose the steps yourself (e.g. let the model refine the diagram source between generate_diagram and render_diagram).
node_modules, .git, dist, build, venv, __pycache__, vendor, and other build/dependency/cache directories (plus all hidden dirs).Tests cover the deterministic core β import resolution (JS/TS + Python), module
collapsing, cycle detection, rule globs, baseline diffing, Mermaid rendering and
the check end-to-end path. They run against src/ via tsx, so there is no
build step and no test framework dependency.
Built by Gopi K Aitham (builditwithgk) β see about://author, or scaleup-solutions.in. Available for freelance and contract work on AI, agent, and MCP tooling.
MIT
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/repo-cartographer)<a href="https://allmcps.com/mcp/repo-cartographer"><img src="https://allmcps.com/api/badge/repo-cartographer?style=directory" alt="Repo Cartographer on AllMCPs" /></a>