codemap-3d

codemap-3d

MCP server that parses source code into a graph of symbols and relationships, enabling code structure visualization and blast radius analysis via interactive 3D force-graph.

Category
访问服务器

README

codemap-3d

3D code structure visualizer — CLI + MCP server powered by tree-sitter.

Parses source code into a graph of symbols and relationships (functions, classes, imports, call sites) and renders an interactive 3D visualization using 3d-force-graph.

Supported Languages

Language Extensions
JavaScript/TypeScript .js .mjs .cjs .jsx .ts .tsx
Python .py
Go .go
Java .java
Kotlin .kt .kts
PHP .php
Dart .dart

Installation

# Clone and link globally
git clone <repo-url>
cd code-visualizer
npm install
npm run build
npm link

# Now available everywhere:
codemap <path>

Development mode (no build needed)

npx tsx src/index.ts <path>

Commands

codemap <path> — Generate visualization

Analyzes a directory and generates a static 3D visualization.

codemap ./my-project
codemap ./my-project -t cyberpunk --open
codemap ./my-project -f json -o ./report
Option Description Default
-o, --output <dir> Output directory output
-f, --format <type> Output format: html, json html
-t, --theme <name> Theme: clarity, cyberpunk clarity
--open Auto-open in browser
--no-files Exclude file nodes from graph

Interactive controls:

  • Fuzzy search — VS Code-style search with dropdown suggestions, keyboard navigation (arrow keys + enter), click to center camera on node
  • Filter buttons — toggle Files, Classes, Functions, Methods visibility
  • Node click — opens info panel with details, incoming/outgoing connections, and Center buttons to navigate to connected nodes
  • Export Graph — download graph data as JSON
  • Graph summary — sidebar showing node and edge counts

codemap blast <path> — Blast radius visualization

Visualizes the blast radius of git changes on the current branch. Shows the same 3D graph with visual indicators for how close each node is to the changed code.

  • Changed nodes: original color + red 2D ring outline + black center dot
  • Nearby nodes: original color + fading red ring based on distance
  • Unaffected nodes: faded when "Fade unaffected nodes" is enabled
codemap blast ./my-project
codemap blast ./my-project -b develop --open
codemap blast ./my-project -t cyberpunk -o ./blast-report
Option Description Default
-o, --output <dir> Output directory output
-t, --theme <name> Theme: clarity, cyberpunk clarity
-b, --base <branch> Base branch to diff against auto-detect
--open Auto-open in browser
--no-files Exclude file nodes from graph

Interactive controls in the blast radius view:

  • Changed Files panel — expandable list of changed files; each file expands to show individual changed nodes (functions, classes, methods) with kind badges
  • Per-node filtering — toggle individual files or nodes on/off to isolate specific changes; file checkbox shows indeterminate state when partially selected
  • Center button — zoom the camera to any changed node; also available on connections in the info panel
  • Blast direction — Incoming (default, shows callers/importers), Both, or Outgoing (shows callees/dependencies)
  • Max blast distance slider — limit blast radius depth (1–10, default 3)
  • Fade unaffected nodes — checkbox (on by default) to fade nodes and links outside the blast radius
  • Impact alert — top bar indicator showing how many nodes are affected
  • Export Graph — download graph + blast radius data as JSON
  • Fuzzy search — same VS Code-style search as the explorer view, with center-on-click

codemap serve <path> — Live dev server

Starts a dev server with file watching and live reload via WebSocket.

codemap serve ./my-project
codemap serve ./my-project -p 8080 --open
Option Description Default
-p, --port <number> Server port 3333
-t, --theme <name> Theme: clarity, cyberpunk clarity
--open Auto-open in browser

MCP Server

codemap-3d exposes an MCP server for integration with AI tools (Claude, Cursor, etc.).

Setup

node dist/server.js

Add to your MCP client config (e.g. Claude Desktop, Claude Code):

{
  "mcpServers": {
    "codemap-3d": {
      "command": "node",
      "args": ["/path/to/code-visualizer/dist/server.js"]
    }
  }
}

Tools

generate_graph

Parse a directory and return the full code structure graph as JSON.

Parameter Type Required Description
directory string yes Absolute path to analyze
include_files boolean no Include file nodes (default: true)

Returns: Full graph with nodes (files, classes, functions, methods) and edges (calls, imports, contains).

analyze_blast_radius

Analyze the blast radius of git changes — returns structured JSON optimized for LLM consumption. Does not open a browser.

Parameter Type Required Description
directory string yes Absolute path to git repository
base_branch string no Base branch to diff against (default: auto-detect)
max_distance number no Max blast radius depth, 1–20 (default: 3)
direction string no incoming, outgoing, or both (default: incoming)
include_files boolean no Include file nodes (default: true)

Returns:

{
  "changed_files": [
    {
      "path": "src/utils/Mongo.ts",
      "changed_nodes": [
        { "id": "class:src/utils/Mongo.ts:Mongo", "name": "Mongo", "kind": "class" }
      ]
    }
  ],
  "blast_radius": {
    "direction": "incoming",
    "max_distance": 3,
    "total_changed": 2,
    "total_affected": 8
  },
  "affected_nodes": [
    { "id": "...", "name": "Mongo", "kind": "class", "file": "src/utils/Mongo.ts", "lines": "10-50", "blast_distance": 0, "is_changed": true },
    { "id": "...", "name": "UserService", "kind": "class", "file": "src/services/UserService.ts", "lines": "5-80", "blast_distance": 1, "is_changed": false }
  ],
  "graph_summary": { "files": 107, "classes": 46, "functions": 332, "call_edges": 427, "import_edges": 146 }
}

visualize_blast_radius

Same analysis as analyze_blast_radius, but also generates an interactive 3D HTML visualization and opens it in the browser.

Parameter Type Required Description
directory string yes Absolute path to git repository
base_branch string no Base branch to diff against (default: auto-detect)
output_dir string no Output directory for HTML (default: <dir>/codemap-blast)
theme string no clarity or cyberpunk (default: clarity)
include_files boolean no Include file nodes (default: true)

Returns: Summary JSON + opens interactive blast radius visualization in default browser.

get_supported_languages

List programming languages supported for code structure analysis. No parameters.

Themes

  • clarity — light, professional (grays, blues, greens)
  • cyberpunk — dark, neon (cyan, lime, magenta on black)

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选