A Model Context Protocol (MCP) server that provides rich file tree exploration with code previews, symbol extraction, and architectural insights. Perfect for AI assistants to understand codebases instantly.
cd mcp-servers/visual-tree-explorer
npm install
npm run build
{
"mcpServers": {
"visual-tree-explorer": {
"command": "node",
"args": ["/path/to/r3belMind/mcp-servers/visual-tree-explorer/dist/index.js"]
}
}
}
explore_tree({ path: "src", depth: 2 })
Visual Tree Explorer supports two operational modes for maximum flexibility:
Perfect for Claude Code integration:
{
"mcpServers": {
"visual-tree-explorer": {
"command": "node",
"args": ["/path/to/dist/index.js"]
}
}
}
Perfect for automation, hooks, and integrations:
# Quick start
./start-server.sh
# Or manually
npm run server
# or
node dist/cli-server.js --server --port 8080
# Health check
curl http://localhost:8080/health
# Basic exploration
curl "http://localhost:8080/explore?path=src&depth=2"
# Full analysis with JSON output
curl "http://localhost:8080/explore?path=src&show_symbols=true&show_dependency_graph=true&format=json"
# Custom icon themes
curl "http://localhost:8080/explore?path=src&icon_theme=minimal&show_performance=true"
# One-shot execution
node dist/cli-server.js --path src --depth 2 --show-symbols
# All options
node dist/cli-server.js \
--path src \
--depth 3 \
--icon-theme minimal \
--show-dependency-graph \
--format json
Beautiful ASCII art representation with customizable icon themes:
- 5 Built-in Themes:
emoji
(default),minimal
,nerd-fonts
,ascii
,corporate
- Custom Icons: Override any icon with your own preferences
- Smart File Icons: Different icons for code files, directories, and file types
TypeScript compiler API for 100% accurate symbols:
- Functions, classes, interfaces, types, variables
- Export/import analysis
- Exact line numbers and positions
Advanced architectural insights:
- Visual import/export relationship mapping
- Circular dependency detection with detailed paths
- Module cohesion metrics and clustering analysis
- Architectural health score for refactoring decisions
Real-time performance monitoring:
- Timing breakdown per operation (file read, AST parsing, etc.)
- Memory usage tracking with peak detection
- Complexity scoring based on symbols, imports, and nesting
- Throughput metrics for optimization insights
Advanced search capabilities:
function:name
- Find specific functionscontent:text
- Search file contentsimport:package
- Find import statementsregex:pattern
- Powerful regex matching
Real-time git status visualization:
- Modified, added, deleted, untracked files
- Staged vs working tree indicators
- Visual color-coded status icons
๐ฑ Emoji Theme (Default)
๐ src/ (12 files)
โโโ ๐ components.ts (45 lines)
โโโ ๐ง utils.ts (23 lines)
โก Minimal Theme
โถ src/ (12 files)
โโโ โข components.ts (45 lines)
โโโ โข utils.ts (23 lines)
๐ Nerd Fonts Theme
src/ (12 files)
โโโ components.ts (45 lines)
โโโ utils.ts (23 lines)
๐ ASCII Theme
[+] src/ (12 files)
โโโ [*] components.ts (45 lines)
โโโ [*] utils.ts (23 lines)
๐ผ Corporate Theme
[DIR] src/ (12 files)
โโโ [FILE] components.ts (45 lines)
โโโ [FILE] utils.ts (23 lines)
// Use a built-in theme
explore_tree({
path: "src",
icon_theme: "minimal"
})
// Custom icon overrides
explore_tree({
path: "src",
icon_theme: "emoji",
custom_icons: {
folder: "๐๏ธ",
code: "โก",
file: "๐"
}
})
// Full custom theme
explore_tree({
path: "src",
icon_theme: "custom",
custom_icons: {
folder: "๐ฆ",
file: "๐",
code: "๐ป",
branch: "โโ",
lastBranch: "โโ",
vertical: "โ"
}
})
Coded with love by Claude Code ๐คโจ (That's me! I wrote every line, debugged every bug, and probably over-engineered a few things because... why not?)
Special thanks to my human collaborator for providing excellent moral support, witty commentary, and the occasional "that looks great!" which is basically developer fuel. Also for suggesting we need more laughter in this world - 100% agree! ๐
P.S. - Yes, an AI built a tool to help other AIs understand code faster. The irony is not lost on me. Next up: teaching robots to be better at teaching robots to teach robots... ๐ค๐
explore_tree({
path: "src/components",
depth: 2
})
explore_tree({
path: "src",
depth: 3,
show_symbols: true,
show_imports: true,
show_git_status: true,
filter: "*.ts"
})
// Search by function name
explore_tree({
path: "src",
search: "function:handleSubmit"
})
// Search by content
explore_tree({
path: "src",
search: "content:useState"
})
// Search with regex
explore_tree({
path: "src",
search: "regex:interface \\w+Props"
})
explore_tree({
path: ".",
preview_lines: 0, // No preview
show_symbols: false,
depth: 4
})
explore_tree({
path: "src",
show_dependency_graph: true,
depth: 3
})
explore_tree({
path: "src",
show_performance: true,
show_symbols: true,
depth: 2
})
explore_tree({
path: "src",
format: "json"
})
Parameter | Type | Default | Description |
---|---|---|---|
path | string | required | Directory to explore |
depth | number | 2 | How deep to traverse |
preview_lines | number | 5 | Lines to preview per file |
show_symbols | boolean | true | Extract code symbols using AST |
show_dependency_graph | boolean | false | Analyze and visualize import/export relationships |
show_performance | boolean | false | Show performance metrics per file (timing, memory, complexity) |
icon_theme | string | 'emoji' | Icon theme: 'emoji', 'minimal', 'nerd-fonts', 'ascii', 'corporate' |
custom_icons | object | - | Custom icon overrides (e.g., {folder: "๐ฆ", code: "๐ป"}) |
search | string | - | Multi-modal search (function:, content:, import:, regex:) |
show_git_status | boolean | false | Show git status indicators |
filter | string | - | Glob pattern filter |
show_imports | boolean | false | Show import statements |
max_files | number | 100 | Max files per directory |
skip_patterns | string[] | [node_modules, .git, etc.] | Patterns to skip |
format | 'tree' | 'json' | 'tree' | Output format |
src/components/
โโโ ๐ pipeline/ (6 files)
โ โโโ ๐ LeadPipeline.tsx (245 lines, 8.5KB) ๐ก M
โ โ โโโ ๐๏ธ Preview:
โ โ โ 1: import React, { useState } from 'react';
โ โ โ 2: import { DndProvider } from 'react-dnd';
โ โ โ 3: import { HTML5Backend } from 'react-dnd-html5-backend';
โ โ โ 4:
โ โ โ 5: export function LeadPipeline() {
โ โ โโโ ๐ท Symbols (AST):
โ โ โ โโโ LeadPipeline (function) โ exported
โ โ โ โโโ handleDrop (function)
โ โ โ โโโ PipelineStageProps (interface)
โ โ โ โโโ stageValue (const)
โ โ โโโ ๐ Imports: react, react-dnd, react-dnd-html5-backend
โ โ โโโ โก Performance:
โ โ โฑ๏ธ Total: 23.45ms
โ โ โก Breakdown:
โ โ ๐ fileRead: 2.1ms
โ โ ๐๏ธ preview: 1.2ms
โ โ ๐ท symbolExtraction: 18.9ms
โ โ ๐พ Memory: +0.8MB (peak: 45.2MB)
โ โ ๐ Throughput: 362 bytes/ms, 10.4 lines/ms
โ โ ๐ก Complexity: 35/100 (4 symbols, 3 imports)
โ โโโ ๐ types.ts (45 lines, 1.2KB) ๐ข A
โ โ โโโ ๐ท Symbols (AST):
โ โ โ โโโ Lead (interface) โ exported
โ โ โ โโโ PipelineStageInfo (interface) โ exported
โ โ โ โโโ DragItem (interface) โ exported
โ โโโ ๐ newfile.tsx (12 lines, 234B) โช ??
โโโ ๐ Dashboard.tsx (312 lines, 10.8KB)
โโโ ๐ท Symbols (AST):
โโโ Dashboard (function) โ exported
โโโ DashboardProps (interface)
โโโ getFilteredCalls (function)
Git Status Legend:
- ๐ก M = Modified
- ๐ข A = Added
- โช ?? = Untracked
- ๐ด D = Deleted
# Install dependencies
npm install
# Build for production (both MCP and HTTP modes)
npm run build
# Development with watch mode
npm run dev
# Start HTTP server for automation/hooks
npm run server
# One-shot CLI execution
npm run cli -- --path src --depth 2
# Type checking
npm run type-check
npm run build
- Compile TypeScript for both MCP and HTTP modesnpm run dev
- Watch mode developmentnpm run server
- Start HTTP server on port 8080npm run cli
- CLI mode execution (pass args with--
)npm start
- Start MCP server (for Claude Code)
Visual Tree Explorer powers an automatic documentation system that generates rich architectural insights whenever you edit code:
- File Edit Detection: Claude Code hooks detect significant file changes
- HTTP API Calls: Auto-doc script calls VTE server via HTTP (no tokens used!)
- Rich Documentation: Generates detailed architecture docs with dependency analysis
- Smart Filtering: Only updates docs for meaningful changes
- Browser Log Integration: Automatically captures browser console/network logs for frontend changes
- ๐ Project Structure: Complete file tree with symbols and previews
- ๐ธ๏ธ Dependency Maps: Import/export relationships and circular dependency detection
- โก Performance Insights: Timing, memory usage, and complexity analysis per file
- ๐ฏ Architectural Health: Module cohesion metrics and refactoring recommendations
- ๐ Browser State Capture: Console logs, network errors, and screenshots for frontend changes
Intelligent frontend change detection with automatic browser debugging:
- Smart Pattern Detection: Automatically detects edits to React components, pages, hooks, CSS, and TypeScript files
- Multi-Platform Capture: Console logs, console errors, network logs, network errors, and screenshots
- Graceful Fallback: Works even when browser tools MCP server is unavailable
- Structured Logging: JSON-formatted session data with timestamps and change context
- Health Monitoring: Automatic before/after comparison for regression detection
- Zero LLM tokens used for documentation generation
- HTTP-based analysis - all structural, no AI inference needed
- Smart triggers - only significant changes generate docs
- Incremental updates - only affected components get updated
- Efficient browser logging - captured via MCP tools, no API calls
Generated 94KB of rich documentation including:
- 21,592 chars of project structure analysis
- 24,869 chars of dependency relationship mapping
- 30,048 chars of performance metrics and insights
- Automatic browser session logs for frontend debugging
See docs/architecture/
for auto-generated architectural documentation!
- โ AST-based symbol extraction - TypeScript compiler API for 100% accurate symbols
- โ Git status integration - Visual indicators with colored emojis
- โ Search within tree - Multi-modal search (function:, content:, import:, regex:)
- โ Dependency graph visualization - Visual import/export relationships with circular dependency detection
- โ Performance metrics per file - Detailed timing and memory usage statistics for analysis and optimization
- โ Custom icon themes - 5 built-in themes plus custom icon overrides for personalized visualization
- โ Dual-mode architecture - HTTP server + CLI mode for automation and integrations
- โ Auto-documentation system - Automatic rich documentation generation via hooks
- โ Browser log integration - Smart frontend change detection with automatic browser state capture via MCP
- File change detection - Real-time file watching with WebSocket updates
- Language server integration - IntelliSense-style code understanding
- Code complexity heatmaps - Visual complexity indicators per file/function
Mode | Use Case | Command |
---|---|---|
MCP | Claude Code integration | Via MCP configuration |
HTTP Server | Automation & hooks | ./start-server.sh |
CLI | One-shot analysis | node dist/cli-server.js --path src |
Feature | Description | Parameter |
---|---|---|
๐ณ Tree Structure | Visual file hierarchy | depth , icon_theme |
๐ท Symbol Extraction | AST-based code analysis | show_symbols |
๐ธ๏ธ Dependencies | Import/export mapping | show_dependency_graph |
โก Performance | Timing & memory metrics | show_performance |
๐ Search | Multi-modal code search | search |
๐ก Git Status | Real-time git indicators | show_git_status |
- Claude Code: MCP server for interactive exploration
- HTTP API: RESTful endpoints for automation
- Auto-docs: Automatic documentation generation via hooks
- CLI: Command-line interface for scripts and CI/CD
For detailed HTTP API documentation, see HTTP-SERVER.md
- Claude Code: Interactive codebase exploration with rich MCP integration
- VS Code Extensions: Custom plugins using HTTP API
- AI Pair Programming: Real-time code understanding for LLMs
- CI/CD Pipelines: Automated architecture analysis in builds
- Code Quality Gates: Dependency and complexity validation
- Documentation Generation: Auto-updating project docs via hooks
- Code Reviews: Visual dependency impact analysis
- Onboarding: Instant codebase understanding for new team members
- Refactoring: Safe change planning with dependency visualization
- Technical Debt: Circular dependency detection and complexity scoring
- Module Design: Cohesion metrics and clustering analysis
- Performance Monitoring: Real-time analysis timing and memory usage
- Icon Themes: Match your team's visual preferences (5 built-in themes)
- Custom Branding: Corporate-friendly ASCII themes for presentations
- Accessibility: Minimal themes for screen readers and low-bandwidth
For the Reddit crowd who wants to understand what all the fuss is about!
Ever tried to understand a new codebase and felt like you're exploring a maze blindfolded? You open a folder, see 50 files, click on one, see 300 lines of code, get confused by imports, and give up. Most developers spend 60-80% of their time just understanding existing code.
Think of it as a super-powered X-ray vision for code:
- ๐ธ Instant Overview: Shows you the entire folder structure with previews of what's inside each file
- ๐ง Smart Analysis: Automatically reads the code and tells you what functions, classes, and components are inside
- ๐ธ๏ธ Connection Map: Shows you how files are connected to each other (what imports what)
- ๐ Smart Search: Find exactly what you're looking for across thousands of files in seconds
Abstract Syntax Trees (AST): Instead of just reading code as text, this tool parses it like a compiler would. It understands that export function MyComponent()
is a function that other files can use, not just random text. This means 100% accuracy vs the ~70% you get from text-based tools.
Dependency Graph Analysis: Imagine your codebase as a city. This tool maps out all the roads (imports) between buildings (files). It can tell you:
- Which files are the "main streets" that everything connects to
- Which files are "dead ends" that nothing uses
- If there are any "traffic circles" (circular dependencies) that could cause problems
Real-time Visualization: All this analysis happens in seconds and gets presented as beautiful ASCII art that actually makes sense.
Before: Opening a new project meant hours of clicking through files, getting lost, using slow search tools, and drawing diagrams on paper to understand how things connect.
After: One command gives you a complete architectural overview with all connections mapped out visually.
- Debugging: "Where is this function defined?" โ Instant answer with exact location
- Architecture Review: "How tightly coupled is this module?" โ Visual dependency map shows you immediately
- Onboarding: New team member can understand the entire codebase structure in minutes
- Refactoring: "What will break if I change this?" โ See all dependents instantly
This isn't just a file browser. It's running a TypeScript compiler under the hood, building actual dependency graphs, detecting circular references, calculating module cohesion metrics, and presenting it all in a way that doesn't make your brain hurt.
Bottom Line: It turns the painful process of understanding codebases into something that's actually enjoyable. Like having a GPS for code navigation.
- Large Files: Handles 700+ line files instantly
- Bulk Processing: 50+ files processed simultaneously
- AST Parsing: Sub-second TypeScript analysis
- Memory Efficient: Graceful fallback for edge cases
- ๐ Real-time Metrics: Timing, memory usage, and complexity analysis per file
- ๐ Bottleneck Detection: Identify expensive operations for optimization
- ๐ Data-Driven Insights: Make informed decisions about exploration strategies
- ๐ฏ Complexity Scoring: Automatic code complexity assessment with color-coded indicators
- Smart Caching: Avoid redundant AST parsing for unchanged files
- Streaming Processing: Handle large codebases without memory overflow
- Selective Analysis: Configure exactly what analysis you need