# CodeCartographer

Turns an unfamiliar repository into layered architecture, behavioral contracts and a reimplementation spec. Each phase is validated before the next one starts.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: HuginnIndustries
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/HuginnIndustries/CodeCartographer
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/codecartographer

## What it does

The server walks an agent through phases: architecture, defect scan, behavioral contracts, protocols, porting, and a reimplementation spec. Every phase drops a templated artifact into `.codecarto/findings/` instead of leaving results in the chat. A fresh session or a context compaction resumes from `status.yaml`.

Before moving on, the pipeline checks the phase. Each output carries a `## Validation` table where the phase marks its criteria PASS, PARTIAL or FAIL with supporting notes, and two mechanical checks compare the evidence against the actions and the declared secondary outputs. A FAIL, a missing file or an unreadable verdict stops the run. The model grades itself, and the checks keep that honest.

The final `reimplementation-spec.md` is language-agnostic and lists modules, acceptance scenarios and open questions. Hand it to another agent to rebuild from. Running it needs Node.js 20 or newer, since the package starts through `npx`.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add codecartographer -- npx -y codecartographer-pi
```

### Codex

**Platform CLI**
```bash
codex mcp add codecartographer -- npx -y codecartographer-pi
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "codecartographer": {
            "command": "npx",
            "args": [
                "-y",
                "codecartographer-pi"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "codecartographer": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "codecartographer-pi"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add codecartographer npx -y codecartographer-pi
```

## When to use it
- map an unfamiliar repository into layers
- catch defects before users hit them
- extract behavioral contracts from server code
- produce a spec for rebuilding in another language
- keep analysis progress across context compaction

## Example prompts
- Run the CodeCartographer pipeline over this repo and show me the architecture
- Start the defect scan phase and write findings to `.codecarto/findings/`
- Build `reimplementation-spec.md` from the finished phases

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
