codegraph
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@codegraphWhat breaks if I change src/utils.ts?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
codegraph
Turn a TypeScript / JavaScript / Vue repository into an explorable knowledge graph — a WebGL viewer for humans, and an MCP server for coding agents.
繁體中文版:README.zh-TW.md

Why
grep answers "where does this string appear". It does not answer "what breaks if I change this", "which files are the risky hubs", or "what is this codebase shaped like". codegraph extracts the structure once and lets both you and your agent query it.
Related MCP server: lsp-intelligence
Features
Fast AST extraction — no type checker, ~1,600 files in under 5 seconds.
React + Vue — parses
.ts/.tsx/.js/.jsx/.mts/.ctsand the<script>blocks of.vueSFCs.Real alias resolution —
tsconfig/jsconfigpaths, solution-stylereferences, andresolve.aliasin vite/vue/webpack configs.WebGL viewer — force-directed layout in a web worker, type filters, search, neighbour inspection.
MCP server — six tools that let Claude Code (or any MCP client) query the graph instead of grepping.
Requirements
Node >= 20, pnpm (npm/yarn work too).
Quick start
pnpm install
# 1. extract a repo into web/public/graph.json
pnpm extract /path/to/your/repo
# 2. explore it
pnpm dev # http://localhost:5173CLI
pnpm extract <repo-path> [--out <file>] [--exclude dir1,dir2]Flag | Default | Meaning |
|
| where to write the graph |
| – | extra directory names to skip, comma separated |
Always skipped: node_modules, .git, .next, dist, build, out, coverage, .turbo, .vercel, .output, storybook-static, and all .d.ts files.
Tip: exclude generated code. Indexing a Prisma client adds thousands of
Typenodes that drown out everything else —--exclude generatedis a common first move.
The graph
Node | Extracted from |
| directory tree |
| function declarations, arrow functions assigned to a binding |
| corresponding declarations |
| remaining top-level bindings |
Edge | Meaning |
| folder → folder / file |
| file → symbol it declares |
| file → file |
| caller → callee |
| file → component it uses (JSX elements, Vue SFC imports) |
| class |
Full JSON schema: docs/graph-schema.md.
MCP server
Let a coding agent query the graph:
pnpm mcp # serves web/public/graph.json over stdio
pnpm mcp path/to/graph.json # or an explicit graphRegister it with Claude Code:
claude mcp add codegraph -- pnpm --dir /path/to/codegraph mcp /path/to/graph.jsonTool | Answers |
| which repo is loaded, counts by type |
| name → node ids |
| direct neighbours of a node |
| transitive dependents / dependencies |
| most-connected, riskiest-to-change nodes |
| files nobody imports (dead-code candidates) |
Parameters and sample output: docs/mcp-tools.md.
Everyday recipes
Concrete things this is actually useful for, in rough order of payoff.
1. Size up a change before you start
You are asked to change a shared util. Is it a 10-minute job or a two-day one?
pnpm extract .
pnpm mcp & # then ask your agent, or read the numbers yourselfimpact on lib/utils.ts at depth 2 returned 191 dependents on a 400-file app. That is the difference between "quick fix" and "needs a plan", and you know it before writing any code.
2. Land in an unfamiliar repo
New job, new client, inherited project. Run the extractor, open the viewer, then call hubs. The top ten files by degree are the ones worth reading first — they are where the codebase's actual decisions live. The folder clusters in the viewer show you the module boundaries nobody documented.
3. Give your coding agent a map
Registered as an MCP server, an agent stops grepping and starts asking. "What calls getCurrentUser?" becomes one node_info call instead of three greps and a guess. This matters most on repos too big to fit in a context window.
claude mcp add codegraph -- pnpm --dir /path/to/codegraph mcp /path/to/graph.json4. Find dead code before a cleanup sprint
orphans lists files with no incoming imports/renders. Filter out your framework's entry points (route files, config, tests) and what remains is a real deletion candidate list — with the caveat that dynamic imports are invisible, so verify each one.
5. Check whether a design-system component is actually used
renders edges count component usage across JSX and Vue SFCs. Before deprecating <Button>, node_info tells you how many files render it. Before adding a "reusable" component, hubs --type File tells you whether the last three were ever reused.
6. Review a dependency change with your eyes
Extract before and after a refactor, and diff the two graph.json files. Node ids are stable for unchanged code, so the diff is exactly the structural change — new imports, removed calls, a module that quietly gained fifteen dependents.
pnpm extract . --out /tmp/before.json
git switch my-refactor && pnpm extract . --out /tmp/after.json
diff <(jq -S .edges /tmp/before.json) <(jq -S .edges /tmp/after.json)7. Spot the architecture drifting
Run it monthly and watch the hub list. When a utils.ts climbs from 30 to 95 connections, it has stopped being a utility and become a hidden god-module. Graphs make that visible far earlier than code review does.
Benchmarks
Measured on an M-series Mac, extraction only.
Repo | Kind | Files | Nodes | Edges | Time |
EachTour | Next.js | 400 | 1,853 | 4,624 | 0.8s |
coding-brostech | TypeScript | 1,610 | 8,093 | 10,455 | 4.7s |
web-casino | React + Vite | 332 | 1,291 | 2,837 | 0.5s |
fortune-frontend | Vue 2 CLI (pug) | 176 | 604 | 1,210 | 0.4s |
crm-admin | Vue 2 CLI | 137 | 721 | 1,175 | 0.3s |
Limitations
Read these before trusting an edge.
No type checker. Call edges resolve by name: a declaration in the same file, otherwise a name imported into it. Dynamic dispatch, re-exports, and method calls on typed receivers are missed; identically-named symbols can produce a wrong edge.
Vue templates are not parsed.
rendersedges for SFCs come from one SFC importing another, so they work with html, pug, or jsx templates — but globally registered components (never imported) are invisible.Monorepos are not handled. Only the tsconfig/bundler configs at the repo root are read. Point the extractor at one package at a time.
No incremental updates. Every run is a full re-parse.
TS/JS/Vue only. Svelte, Python, Go and friends are not supported.
The viewer loads the whole JSON. Tens of thousands of nodes render, but ForceAtlas2 needs time to settle and the result is a hairball without clustering.
Roadmap
Incremental extraction (file hash + watcher)
Clustering / level-of-detail in the viewer
Svelte and Astro support
Optional type-checker-backed resolution for accurate call edges
Contributing
Issues and PRs welcome.
pnpm test # vitest, 42 tests over fixture repos
npx tsc --noEmitTests run the extractor against the small React and Vue fixtures in tests/fixtures/, and drive the MCP server over a real stdio transport. Both must pass before a PR.
License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityAmaintenanceA local MCP server that gives AI coding agents symbol definitions, dependency graphs, and a live architecture vocabulary for TypeScript/JavaScript repos, with no network or embeddings.Last updated22MIT
- Alicense-qualityDmaintenanceMCP server providing 29 tools across 5 layers for semantic TypeScript/JavaScript code intelligence, enabling AI agents to find references, trace impacts, guard APIs, and explain errors without text-search false positives.Last updated91MIT
- Alicense-qualityCmaintenanceAn MCP server that indexes TypeScript/JavaScript codebases into precise call and import graphs using the TypeScript compiler API, allowing Claude or any MCP client to query definitions, callers, callees, and perform impact analysis.Last updatedMIT
- Alicense-qualityDmaintenanceMCP server that builds a queryable graph of codebases using Language Server Protocol analysis, enabling AI agents to understand code relationships, call chains, and impact across multiple languages.Last updated1MIT
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
A MCP server built for developers enabling Git based project management with project and personal…
MCP server for generating rough-draft project plans from natural-language prompts.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/RexHung0302/codegraph'
If you have feedback or need assistance with the MCP directory API, please join our Discord server