TS/JS-accurate repo map for coding agents: a ts-morph import/symbol graph, 8 MCP query tools.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Every file on that list really imports it. grep gets 40% of them wrong.
Token cost of the hidden first step in every agent task β find the relevant code β
on a real 154-file Next.js app (vercel/ai-chatbot, sha 2becdb4):
| The agent needs to know⦠| Reading files | agentmap | Saved |
|---|---|---|---|
| Does a helper for this already exist? | 14,740 | 19 | 99.9% |
| Load the whole repo into context | 150,281 | 1,127 | 99.3% |
| What breaks if I change this file? | 81,038 | 616 | 99.2% |
| Where is this symbol defined? | 1,950 | 20 | 99% |
| What files make up this feature? | 6,121 | 1,025 | 83.3% |
| Give me a repo overview | 3,065 | 1,127 | 63.2% |
| What does this one file import? | 583 | 517 | 11.3% |
| All 7 combined | 257,778 | 4,451 | 98.3% |
Holds on zod too (367 files, 99.2%) and
taxonomy (125 files, 96.0%).
Captured output, pinned shas β benchmark/RESULTS.md
Fewer tokens is worthless if they're the wrong ones. Separate eval, ground truth derived live from real repos:
| agentmap | git grep | |
|---|---|---|
| What depends on this file? | 100% precision | 59.9% precision |
| Where is this defined? (top-1) | 100% | 32% |
| Where is this defined? (top-3) | 100% | 80% |
| Tokens to find a definition | 1.9Γ fewer | β |
n=42 dependents / n=75 definitions across zod, zustand, hono. Re-run: npm run eval Β· method β EVAL.md
| You want | Run | Saves |
|---|---|---|
| "Do we already have this?" | agentmap --find formatCurrency | 99.9% |
| "What breaks if I touch this?" | agentmap --relates lib/auth.ts | 99.2% |
| "Where is this defined?" | agentmap --find ChatMessage | 99% |
| "Give me the repo, cheap" | agentmap --map --tokens 2000 | 99.3% |
| Don't want to pick? | agentmap --any <anything> | β |
--any routes it for you: file β symbol β feature β live content search.
Cold build ~1.2s. Cached query ~0.1s. No server, no vector DB, no API key.
Most repo-map tools stop at building the map. These two hooks are why it stays useful: the map rebuilds itself after every commit, and the agent gets nudged to the map the moment it reaches for a dependency-shaped grep. Claude Code users can get both from the plugin.
100% local. Zero network calls, zero telemetry β not one
fetch/httpin the source. β οΈ Install the scoped name; unscopednpx agentmapis someone else's package.
First run caches to .claude/agentmap/map.json (--install-hooks gitignores it). Later runs
serve that cache only on a clean tree at an unchanged HEAD β with uncommitted
.ts/.tsx/.js/β¦ edits it silently rebuilds, so you never query a stale snapshot.
From a checkout, every command also works as node agentmap.mjs β¦.
Built on ts-morph β the real TypeScript compiler, not text matching or tree-sitter
guessing. It resolves tsconfig path aliases, vite/webpack aliases, #imports subpaths,
and monorepo workspaces. Where grep sees a string, agentmap sees the resolved module.
That's also why barrels don't fool it: export * from "./x" looks identical to a real
definition to a text search, so your agent edits the re-export and changes nothing. agentmap
follows the chain and names the file that actually declares it.
cat + grep β taxonomy's file-import task hit
β313%, and it stays in the table.--relates returns the full blast radius, so it costs more than a bare grep -l file
list. That's why the same command reads as 99.2% saved in the benchmark and more
expensive in the eval: the benchmark's baseline is an agent that cats all 65 dependent
files, the eval's is a file list nobody reads. Against the list, agentmap trades tokens for
precision β 100% vs 59.9%, so ~4 in 10 files on the grep list don't belong.
Complete-and-correct over short-and-wrong, but it is a trade β EVAL.md.chars / 4), applied identically to both sides.Many "repo context" tools are a photocopy: they dump your repository (or a slice of it) into the prompt once and walk away β the copy goes stale the moment you edit a file, and nothing makes the agent actually read it. agentmap is queryable and ranked instead: the agent interrogates it flag-by-flag rather than swallowing a dump.
It also reports an edgeCoverage map-health signal and warns loudly when a repo's imports
mostly don't resolve, so a broken map is never quietly framed as success.
The self-refreshing side β a post-commit rebuild plus a PreToolUse hook that steers the agent
to the map before it serial-greps β is genuinely useful, but it isn't unique: CodeGraph
(colbymchenry/codegraph, ~62kβ
(2026-07-26)) ships a native
OS-event file watcher (FSEvents/inotify) with debounced auto-sync and an installer that
auto-configures eight agent CLIs. agentmap's honest edge over the multi-language graph tools is
narrower and sharper: TS/JS resolution the others approximate, with a published accuracy eval.
| agentmap | Aider repo map | RepoMapper | Repomix | code2prompt | |
|---|---|---|---|---|---|
| Ranking algorithm | Personalized PageRank (file + symbol graphs) | PageRank (graph ranking) | Importance heuristics | None (file order) | None (file order) |
| Languages | TS/JS + Vue SFC (via ts-morph) | Many (tree-sitter) | Many (tree-sitter) | Language-agnostic (text) | Language-agnostic (text) |
| Token-budget output | Yes β --map [--tokens N] ranked digest | Yes (built into Aider's context) | Partial | Yes (size caps) | Yes (templates/caps) |
| TS/JS resolution depth | Compiler-grade β tsconfig paths + vite/webpack alias + #imports + workspaces (ts-morph) | Basename/regex heuristics | Basename/regex heuristics | N/A (text) | N/A (text) |
| Retrieval-accuracy eval | Yes β published EVAL.md vs live ground truth | No | No | No | No |
| Agent-loop wiring | Yes β post-commit auto-refresh + PreToolUse hook | In-process (Aider only) | No | MCP server (no auto-refresh, no nudge) | No |
| Dependencies | ts-morph only | Python + tree-sitter stack | Python + tree-sitter | Node | Rust binary |
| Install | npx @raymondchins/agentmap | pip install aider-chat | pip install | npx/global | cargo/binary |
Comparison as of 2026-07-27, from each project's own docs. These are moving targets β if a cell is out of date, that's a bug: open an issue.
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/agentmap)<a href="https://allmcps.com/mcp/agentmap"><img src="https://allmcps.com/api/badge/agentmap?style=directory" alt="Agentmap on AllMCPs" /></a>