···11# traverse
2233-interactive code walkthrough diagrams via MCP. share them with anyone.
33+[](https://traverse.dunkirk.sh/diagram/6121f05c-a5ef-4ecf-8ffc-02534c5e767c)
44+55+One of my favorite features about [amp](https://ampcode.com) is their walkthrough feature. It runs a sub agent which goes and breaks your repo into parts and then sends it up to amp's services to get rendered into a nice web page! I got curious and ended up dumping the tool prompt for both the walkthrough subagent and the tool prompt that generates the diagram.
4655-The canonical repo for this is hosted on tangled over at [`dunkirk.sh/traverse`](https://tangled.org/@dunkirk.sh/traverse)
77+Turns out they are using mermaid syntax with ids on each node that are linked to a json object that has the summary in md of each section. Looking into their web ui rendering they have actually designed their own mermaid renderer likely to get better routing with the paths. We can get amazingly close to that with regular mermaid still and that is what this project is!
6877-## try it now
99+This is a mcp server that also launches a web server in the background. You can hook this into whatever ai tool that you want that supports mcp (which is north of 80% of coding tools at this point if not nearing 100%) and start generating walkthroughs! It will initally give you a local url but if you want to share it with others then you can use the share button in the top corner of the page and it will by default share it to my hosted instance at [`traverse.dunkirk.sh`](https://traverse.dunkirk.sh) but if you configure the json settings or add an env variable you can point it to your own selfhosted instance!
1010+1111+## let's try it!
1212+1313+The mcp server must be run with bun since it uses the `Bun.serve` api extensively. If you haven't tried bun yet I would highly recommend it!
814915```sh
1010-bunx @taciturnaxolotl/traverse
1616+bunx @taciturnaxolotl/traverse@latest
1117```
12181313-requires [bun](https://bun.sh). runs an MCP server on stdio and a web server on `localhost:4173`.
1919+By default this runs an MCP server on stdio and a web server on `localhost:4173`.
14201515-## setup
2121+### I want this in my agent of choice!
16221717-add to your MCP client:
1818-1919-**claude code:**
2323+For claude code they have made this fairly easy:
20242125```sh
2222-claude mcp add traverse -- bunx @taciturnaxolotl/traverse
2626+claude mcp add traverse -- bunx @taciturnaxolotl/traverse@latest
2327```
24282525-**claude desktop** — add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
2929+For claude desktop (on mac) you can add the following to `~/Library/Application Support/Claude/claude_desktop_config.json`:
26302731```json
2832{
2933 "mcpServers": {
3034 "traverse": {
3135 "command": "bunx",
3232- "args": ["@taciturnaxolotl/traverse"]
3636+ "args": ["@taciturnaxolotl/traverse@latest"]
3337 }
3438 }
3539}
3640```
37413838-**other MCP clients** — same JSON config, wherever your client reads `.mcp.json` or equivalent.
3939-4040-your AI calls the `walkthrough_diagram` tool with mermaid code + node descriptions, and you get a clickable diagram in your browser.
4141-4242-diagrams persist to sqlite at `~/Library/Application Support/traverse/traverse.db` (macOS) or `$XDG_DATA_HOME/traverse/traverse.db` (linux). override with `TRAVERSE_DATA_DIR`.
4242+For other agents its the same JSON config typically.
43434444-## sharing
4444+## Config
45454646-click the share button on any diagram to upload it to `traverse.dunkirk.sh` and copy a public link.
4646+### json config
47474848-configure the share server in `~/Library/Application Support/traverse/config.json`:
4848+On macos edit/create `~/Library/Application Support/traverse/config.json`. If you are on Linux then `~/.config/traverse/config.json` (or `$XDG_CONFIG_HOME/traverse/config.json`)
49495050```json
5151{
5252- "shareServerUrl": "https://traverse.dunkirk.sh"
5252+ "shareServerUrl": "https://traverse.dunkirk.sh",
5353+ "port": 4173,
5454+ "mode": "local"
5355}
5456```
55575656-or set `TRAVERSE_SHARE_URL`.
5858+### env vars
57595858-## server mode
6060+| var | default | description |
6161+| -------------------- | ----------------------------- | ------------------------------------------ |
6262+| `TRAVERSE_PORT` | `4173` | web server port |
6363+| `TRAVERSE_MODE` | `local` | `local` (mcp + web) or `server` (web only) |
6464+| `TRAVERSE_SHARE_URL` | `https://traverse.dunkirk.sh` | share server url |
6565+| `TRAVERSE_DATA_DIR` | platform default | sqlite db location |
59666060-run your own share server:
6161-6262-```sh
6363-TRAVERSE_MODE=server bun run src/index.ts
6464-```
6565-6666-accepts `POST /api/diagrams` with a diagram JSON body, returns `{ id, url }`.
6767-6868-## env vars
6969-7070-| var | default | description |
7171-|-----|---------|-------------|
7272-| `TRAVERSE_PORT` | `4173` | web server port |
7373-| `TRAVERSE_MODE` | `local` | `local` (mcp + web) or `server` (web only) |
7474-| `TRAVERSE_SHARE_URL` | `https://traverse.dunkirk.sh` | share server url |
7575-| `TRAVERSE_DATA_DIR` | platform default | sqlite db location |
6767+The canonical repo for this is hosted on tangled over at [`dunkirk.sh/traverse`](https://tangled.org/@dunkirk.sh/traverse)
76687769<p align="center">
7870 <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/main/.github/images/line-break.svg" />