visualize_graph
Open an interactive HTML graph of file or symbol dependencies in the browser. Supports force, hierarchical, and radial layouts with community coloring.
Instructions
Open interactive HTML graph in browser showing file/symbol dependencies. Supports force/hierarchical/radial layouts, community coloring. Use granularity=symbol to see individual functions/classes/methods as nodes instead of files. Writes an HTML file to disk. For static Mermaid/DOT output use get_dependency_diagram instead. Returns JSON: { outputPath, nodes, edges }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | Yes | Scope: file path, directory (e.g. "src/"), or "project" | |
| depth | No | Max hops from scope (default 2) | |
| layout | No | Graph layout algorithm (default force) | |
| color_by | No | Node coloring strategy (default community) | |
| include_edges | No | Filter edge types (default: all) | |
| output | No | Output file path (default: /tmp/trace-mcp-graph.html) | |
| hide_isolated | No | Hide nodes with no edges (default: true — removes disconnected ring) | |
| granularity | No | Node granularity: file (default) or symbol (functions/classes/methods) | |
| symbol_kinds | No | Filter symbol kinds when granularity=symbol (e.g. ["function","class","method"]) | |
| max_files | No | Max seed files for file-level graph (default 10000) | |
| max_nodes | No | Max viz nodes for symbol-level graph (default 100000) | |
| include_bottlenecks | No | Annotate edges with bottleneckScore/isBridge and nodes with isArticulation (file granularity only). Default false. |