npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-codebase-map

v5.0.3

Published

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

Readme

MCP Codebase Map

npm version License: MIT

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.

✨ Features

  • 🌍 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

🆚 Performance vs Traditional Methods

| 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 |

📦 Installation

For Claude Desktop

# Always get the latest version
claude mcp add codebase-map npx mcp-codebase-map@latest

Alternative: Global Installation

npm install -g mcp-codebase-map
npx claude mcp add codebase-map mcp-codebase-map

🚀 Quick Start

Once installed, the server automatically:

  1. Scans your codebase on startup
  2. Watches for changes in real-time

📝 Add to .gitignore

The tool creates local database and lock files that should be added to your .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

🛠️ Available Tools

1. find_definition

Find where symbols are defined in your codebase.

find_definition("AuthService") 
// → ✅ Found class 'AuthService' at src/auth.ts:15
// 💡 Use 'list_class_members' to see methods and properties

2. find_files_by_type

Discover files by intelligent pattern matching.

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 files
  • database - Models, schemas, repositories
  • api - Routes, controllers, endpoints
  • test - Test files and specs
  • config - Configuration and settings
  • utils - Utilities and helpers
  • component - UI components
  • service - Service classes and providers

3. show_stats

Get comprehensive codebase statistics.

show_stats()
// → 📊 Codebase Statistics
//   📁 127 files | 🔤 2,450 symbols
//   • Classes: 45 • Functions: 234 • Interfaces: 67
// 💡 Use 'find_files_by_type' to explore specific categories

4. list_class_members

List symbols by type with location details.

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

5. what_changed

Track recent changes in real-time.

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

6. search_code

Intelligent search across symbols, files, and code patterns.

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

🎯 Smart Features

Fuzzy Matching

Can't remember the exact name? No problem!

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

Context-Aware Hints

Every response includes helpful hints for next steps:

find_definition("UserService")
// → ✅ Found class 'UserService' at src/services/user.ts:15
// 💡 Use 'list_class_members' to see methods and properties of this class

Intelligent File Categorization

Automatically detects file types based on naming patterns:

  • Auth files: Contains auth, login, session, user, permission
  • Database files: Contains model, schema, db, repository, entity
  • API files: Contains route, api, controller, endpoint, handler
  • And many more...

🔧 Configuration

The server automatically detects your project structure:

  • TypeScript projects: Uses tsconfig.json if available
  • File patterns: Monitors src/, lib/, app/ directories
  • File types: .ts, .tsx, .js, .jsx files
  • Ignores: node_modules, .git, dist, build directories

📊 Architecture

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   File Watcher  │───▶│  TypeScript      │───▶│   Symbol Index  │
│   (Chokidar)    │    │  Analysis        │    │   (In-Memory)   │
│                 │    │  (ts-morph)      │    │                 │
└─────────────────┘    └──────────────────┘    └─────────────────┘
          │                                              │
          ▼                                              ▼
┌─────────────────┐                            ┌─────────────────┐
│  Change Events  │                            │   MCP Tools     │
│                 │                            │                 │
└─────────────────┘                            └─────────────────┘

🚦 Requirements

  • Node.js: >= 18.0.0
  • Claude Desktop: Latest version with MCP support
  • Project: TypeScript/JavaScript codebase

🔍 Troubleshooting

Server not connecting?

# Check if server is running
npx claude mcp list

# Reconnect the server
npx claude mcp reconnect codebase-map

No symbols found?

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.

Performance issues?

For very large codebases (>10k files), the initial scan might take a few seconds. Subsequent operations are instant thanks to caching and real-time updates.

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

📄 License

MIT License - see the LICENSE file for details.

🙋‍♂️ Support


Built with ❤️ for the Claude Code community