A powerful MCP (Model Context Protocol) server that indexes and analyzes TypeScript/JavaScript projects, providing intelligent code exploration, dependency tracking, method discovery, and project structure analysis for AI assistants and development tools.
- π Project Analysis: Deep analysis of TypeScript/JavaScript codebases
- π Method Discovery: Find functions, classes, interfaces, and types across your project
- π Dependency Tracking: Track imports, exports, and module dependencies
- π File Indexing: Comprehensive file structure analysis with metadata
- π Smart Search: Powerful search capabilities for code elements
- β‘ Performance Optimized: Efficient caching and batch processing
- π Cross-Platform: Works on Windows, macOS, and Linux
- π€ AI-Ready: Perfect integration with AI assistants and development tools
npm install -g ts-project-indexer-mcpgit clone https://github.com/ugorur/ts-project-indexer-mcp.git
cd ts-project-indexer-mcp
npm install
npm run buildAdd to your claude_desktop_config.json:
{
"mcpServers": {
"typescript-project-indexer": {
"command": "npx",
"args": [
"-y",
"ts-project-indexer-mcp"
],
"env": {}
}
}
}Add to your MCP configuration:
{
"typescript-project-indexer": {
"autoApprove": [
"analyze_project",
"search_methods",
"get_project_files",
"get_project_stats",
"find_usages"
],
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "npx",
"args": [
"-y",
"ts-project-indexer-mcp"
]
}
}If you prefer to install globally:
npm install -g ts-project-indexer-mcpThen use:
{
"mcpServers": {
"typescript-project-indexer": {
"command": "ts-project-indexer",
"args": [],
"env": {}
}
}
}
β οΈ Important Change in v1.1.0: Project paths are no longer passed as command line arguments. Instead, use theanalyze_projecttool with an absoluteprojectPathparameter.
// Analyze a specific project (absolute path required)
await mcp.callTool('analyze_project', {
projectPath: '/home/user/my-project',
includePatterns: ['**/*.ts', '**/*.js'],
excludePatterns: ['node_modules/**', 'dist/**']
});
// Windows example
await mcp.callTool('analyze_project', {
projectPath: 'C:\\Users\\user\\my-project',
includePatterns: ['**/*.ts', '**/*.js'],
excludePatterns: ['node_modules/**', 'dist/**']
});// Find all functions containing 'config'
await mcp.callTool('search_methods', {
query: 'config',
type: 'function',
includeUsages: true
});// Find where a file is imported
await mcp.callTool('find_usages', {
filePath: 'src/config.ts',
searchType: 'imports',
includeDetails: true
});// Get comprehensive project stats
await mcp.callTool('get_project_stats', {});Analyzes and indexes the entire project structure.
Parameters:
projectPath(string, required): Absolute path to project root (e.g.,/home/user/projectorC:\Users\user\project)includePatterns(array): File patterns to include (default:['**/*.ts', '**/*.js', '**/*.json'])excludePatterns(array): File patterns to exclude (default:['node_modules/**', 'dist/**', '**/*.d.ts'])forceReindex(boolean): Force full reindexing (default:false)
β οΈ Important: TheprojectPathparameter is required and must be an absolute path. Relative paths are not supported for security and reliability reasons.
Search for methods, functions, and classes in the project.
Parameters:
query(string): Search query (required)type(string): Type filter (method,function,class,interface,type,all)includeUsages(boolean): Include usage locations (default:false)
Find where a file, method, or class is imported or used.
Parameters:
filePath(string): Path to file to find imports/usages formethodName(string): Name of method/function to find usages forclassName(string): Name of class to find usages forsearchType(string): Search type (imports,usages,both)includeDetails(boolean): Include detailed context (default:true)
Get list of all indexed project files with metadata.
Get comprehensive project statistics.
Debug dependencies to see what is being indexed.
Parameters:
limit(number): Maximum dependencies to show (default:20)filterBy(string): Filter dependencies by string match
List of all indexed project files with metadata.
Index of all methods, functions, and classes.
- Code Understanding: Help AI understand project structure and relationships
- Intelligent Refactoring: Find all usages before making changes
- Documentation Generation: Extract comprehensive project information
- Code Review: Analyze dependencies and method relationships
- IDE Integration: Enhance code navigation and search
- Build Tools: Analyze project dependencies for optimization
- Documentation Tools: Generate API documentation automatically
- Testing Tools: Find test coverage gaps
- Complexity Analysis: Understand codebase complexity
- Dependency Mapping: Visualize project dependencies
- Code Metrics: Generate comprehensive code statistics
- Architecture Analysis: Understand project structure
TypeScript Project Indexer MCP
βββ Core Engine
β βββ Project Indexer # Main analysis engine
β βββ Code Parser # AST parsing and analysis
β βββ Path Resolver # Import/export resolution
β βββ Type System # TypeScript type analysis
βββ Caching Layer
β βββ Memory Cache # Fast in-memory storage
β βββ Persistent Cache # Disk-based caching
βββ MCP Server
β βββ Tool Handlers # MCP tool implementations
β βββ Resource Handlers # MCP resource providers
β βββ Protocol Layer # MCP communication
βββ Utilities
βββ File System # Cross-platform file operations
βββ Pattern Matching # Glob pattern support
βββ Error Handling # Robust error management
- Smart Caching: Intelligent caching system with 24-hour retention
- Batch Processing: Processes files in optimized batches
- Incremental Analysis: Only re-analyzes changed files
- Memory Management: Efficient memory usage for large projects
- Cross-Platform: Optimized path handling for all operating systems
We welcome contributions! Please see our Contributing Guidelines for details.
git clone https://github.com/ugorur/ts-project-indexer-mcp.git
cd ts-project-indexer-mcp
npm install
npm run devnpm testnpm run buildThis project is licensed under the MIT License - see the LICENSE file for details.
Umurcan Gorur
- GitHub: @ugorur
- Project: ts-project-indexer-mcp
- Built with Model Context Protocol (MCP)
- Powered by TypeScript AST analysis
- Inspired by the need for better AI-code integration
- Language Support: JavaScript ES6+, JSX/TSX
- IDE Plugins: VSCode extension
- Advanced Analysis: Cyclomatic complexity metrics
- Export Formats: JSON, XML, YAML export options
- Real-time Updates: File watcher integration
- Cloud Integration: Remote project analysis
- Team Features: Shared analysis results
- Performance: Even faster analysis for large codebases
Made with β€οΈ for the developer community