Universal MCP server for multi-language codebase analysis with TypeScript, C#, Java support, dead code detection, and comprehensive file analytics
npm install mcp-codebase-map

A universal multi-language MCP server that provides real-time codebase analysis for TypeScript, JavaScript, C#, and Java projects. Features intelligent file watching, dead code detection, and comprehensive file analytics. Perfect for AI assistants to understand any codebase with lightning speed and accuracy.
- π Multi-Language Support - TypeScript, JavaScript, C#, and Java with automatic detection
- π Real-time File Watching - Automatically tracks changes and updates the codebase map
- π Dead Code Detection - Find unused symbols, exports, imports, and unreachable code
- π File Analytics - Track file sizes, line counts, and language distribution
- π Intelligent Symbol Search - Find classes, functions, interfaces with fuzzy matching
- π Smart Filtering - Automatically excludes build artifacts, node_modules, and generated files
- β‘ Lightning Fast - Tree-sitter parsing for instant responses (~50ms)
- π― Pattern Detection - Automatically categorizes files (auth, database, API, components, etc.)
- π Rich Statistics - Comprehensive codebase overview with language breakdown
- π Change Tracking - See what files and symbols were recently modified
| Metric | MCP Tool | Traditional Grep | Winner |
|--------|----------|-----------------|--------|
| Speed | ~50ms | 200-500ms | π 4-10x faster |
| Accuracy | 1 relevant result | 44 results (with noise) | π Perfect precision |
| Token Usage | ~300 tokens | ~1200+ tokens | π 4x more efficient |
| Cognitive Load | Very low | High (manual filtering) | π Actionable insights |
``bash`Always get the latest version
claude mcp add codebase-map npx mcp-codebase-map@latest
`bash`
npm install -g mcp-codebase-map
npx claude mcp add codebase-map mcp-codebase-map
Once installed, the server automatically:
1. Scans your codebase on startup
2. Watches for changes in real-time
The tool creates local database and lock files that should be added to your .gitignore:
`gitignore`MCP Codebase Map files
.codebase-map.lock
.codebase-map.db*
.codebase-map.json
These files are automatically excluded from analysis but should be gitignored to keep your repository clean.
3. Builds a semantic map of all symbols and files
4. Provides 6 powerful tools for code exploration
``
find_definition("AuthService")
// β β
Found class 'AuthService' at src/auth.ts:15
// π‘ Use 'list_class_members' to see methods and properties
``
find_files_by_type("auth")
// β π Found 3 auth files:
// β’ src/auth/login.ts
// β’ src/auth/session.ts
// β’ src/middleware/auth.ts
// π‘ Use 'find_definition' to explore symbols in these files
Supported patterns:
- auth - Authentication, login, session filesdatabase
- - Models, schemas, repositoriesapi
- - Routes, controllers, endpointstest
- - Test files and specsconfig
- - Configuration and settingsutils
- - Utilities and helperscomponent
- - UI componentsservice
- - Service classes and providers
``
show_stats()
// β π Codebase Statistics
// π 127 files | π€ 2,450 symbols
// β’ Classes: 45 β’ Functions: 234 β’ Interfaces: 67
// π‘ Use 'find_files_by_type' to explore specific categories
``
list_class_members("class", 10)
// β π Classes in codebase:
// β’ class UserService at src/services/user.ts:12
// β’ class AuthController at src/controllers/auth.ts:8
// π‘ Use 'find_definition' for details about specific symbols
``
what_changed()
// β π Recent changes (5 total):
// π 2:45 PM - File modified: user.service.ts (3 symbols)
// β 2:42 PM - File added: auth.middleware.ts
// π‘ Use 'find_definition' to explore symbols in changed files
``
search_code("password reset")
// β π Found 4 results for 'password reset':
// β’ function resetPassword in src/auth/password.ts:23
// β’ method User.resetPassword in src/models/user.ts:89
// π‘ Use 'find_definition' for more details about any symbol
``
find_definition("auth")
// β β 'auth' not found. Did you mean one of these?
// β’ AuthService (class) in src/auth/service.ts
// β’ AuthController (class) in src/controllers/auth.ts
// β’ authenticate (function) in src/utils/auth.ts
``
find_definition("UserService")
// β β
Found class 'UserService' at src/services/user.ts:15
// π‘ Use 'list_class_members' to see methods and properties of this class
- Auth files: Contains auth, login, session, user, permissionmodel
- Database files: Contains , schema, db, repository, entityroute
- API files: Contains , api, controller, endpoint, handler
- And many more...
The server automatically detects your project structure:
- TypeScript projects: Uses tsconfig.json if availablesrc/
- File patterns: Monitors , lib/, app/ directories.ts
- File types: , .tsx, .js, .jsx filesnode_modules
- Ignores: , .git, dist, build directories
``
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β File Watcher βββββΆβ TypeScript βββββΆβ Symbol Index β
β (Chokidar) β β Analysis β β (In-Memory) β
β β β (ts-morph) β β β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Change Events β β MCP Tools β
β β β β
βββββββββββββββββββ βββββββββββββββββββ
- Node.js: >= 18.0.0
- Claude Desktop: Latest version with MCP support
- Project: TypeScript/JavaScript codebase
bash
Check if server is running
npx claude mcp listReconnect the server
npx claude mcp reconnect codebase-map
`$3
The server only analyzes files in these directories:
- src/*/.{ts,tsx,js,jsx}
- lib/*/.{ts,tsx,js,jsx}
- app/*/.{ts,tsx,js,jsx}`Make sure your code is in one of these locations.
We welcome contributions! Please see our Contributing Guidelines for details.
MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- MCP Documentation: Model Context Protocol
---
Built with β€οΈ for the Claude Code community