You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3D interactive codebase visualization for TypeScript projects. Parses your codebase, builds a dependency graph, computes architectural metrics, and serves an interactive 3D map in your browser. Also works as an MCP server for LLM-assisted code understanding.
5
+
**3D interactive codebase visualization for TypeScript projects.**
6
+
7
+
Parse your codebase, build a dependency graph, compute architectural metrics, and explore it all in an interactive 3D map. Also works as an MCP server for LLM-assisted code understanding.
-**11 architectural metrics** — PageRank, betweenness, coupling, cohesion, tension, churn, complexity, blast radius, dead exports, test coverage, escape velocity
51
+
-**3D module clouds** — transparent spheres group files by directory with Phong shading and zoom-based fade
52
+
-**MCP server** — 8 tools for LLM-assisted code understanding (Claude Code, Cursor, VS Code)
53
+
-**REST API** — 9 endpoints for programmatic access
54
+
-**Search** — find any file and fly the camera to it
55
+
-**Detail panel** — click any node for full metrics
56
+
-**Configurable** — node size, link color, physics, cloud opacity
16
57
17
-

58
+
## Installation
18
59
19
-
## Install
60
+
Run directly with npx (no install needed):
20
61
21
62
```bash
22
63
npx codebase-visualizer ./src
@@ -39,26 +80,23 @@ npx codebase-visualizer ./src
39
80
# => 3D map ready at http://localhost:3333
40
81
```
41
82
42
-
Opens an interactive 3D force-directed graph in your browser with 8 views, 3D module clouds, a group legend, search, detail panel, and configurable settings.
43
-
44
-
### MCP Mode (for LLMs)
83
+
### MCP Mode
45
84
46
85
```bash
47
86
npx codebase-visualizer --mcp ./src
48
87
```
49
88
50
-
Starts a stdio MCP server exposing 8 tools for LLM-assisted code understanding. No browser, no HTTP.
89
+
Starts a stdio MCP server. No browser, no HTTP.
51
90
52
-
### CLI Options
91
+
### Options
53
92
54
-
```
55
-
codebase-visualizer <path> # Parse and visualize
56
-
--mcp # MCP stdio mode (no browser)
57
-
--port <number> # Web server port (default: 3333)
58
-
--help # Show help
59
-
```
93
+
| Flag | Description | Default |
94
+
|------|-------------|---------|
95
+
|`<path>`| Path to TypeScript codebase | required |
96
+
|`--mcp`| MCP stdio mode | off |
97
+
|`--port <n>`| Web server port |`3333`|
60
98
61
-
## MCP Setup
99
+
## MCP Integration
62
100
63
101
### Claude Code
64
102
@@ -90,97 +128,92 @@ Add to `.cursor/mcp.json` or `.vscode/mcp.json`:
- When clouds are enabled: color swatch + group name + file count + importance percentage for each group (up to 8 groups, sorted by PageRank)
168
+
Bottom-left legend shows view-specific color coding. When clouds are enabled, adds color swatch + group name + file count + importance % for up to 8 groups sorted by PageRank.
136
169
137
-
### Other UI
170
+
##Metrics
138
171
139
-
-**Search**: find any file by name, fly camera to it
140
-
-**Detail Panel**: click any node to see full metrics — PageRank, coupling, fan-in/out, complexity, blast radius, dead exports, test coverage
1.**Parser** extracts files, exported functions, and import relationships using the TypeScript Compiler API. Resolves tsconfig path aliases (`@/` imports), respects `.gitignore`, detects test file associations.
181
-
2.**Graph builder**creates nodes (files + functions) and edges (import deps + test associations) using graphology. Detects circular dependencies via iterative DFS.
182
-
3.**Analyzer** computes PageRank, betweenness centrality, coupling, cohesion, tension, escape velocity, churn, complexity, blast radius, dead exports, test coverage, and group-level aggregations.
183
-
4.**Server** serves the 3D visualization via Next.js (browser mode) or exposes graph queries via MCP stdio (LLM mode).
213
+
1.**Parser**— extracts files, functions, and imports via the TypeScript Compiler API. Resolves path aliases, respects `.gitignore`, detects test associations.
214
+
2.**Graph**— builds nodes and edges with [graphology](https://graphology.github.io/). Detects circular deps via iterative DFS.
215
+
3.**Analyzer**— computes all 11 metrics plus group-level aggregations.
216
+
4.**Server**— serves the 3D visualization via [Next.js](https://nextjs.org/) + [3d-force-graph](https://github.com/vasturiano/3d-force-graph), or exposes queries via MCP stdio.
0 commit comments