The TypeScript MCP server provides advanced code manipulation and analysis capabilities for TypeScript/JavaScript projects, similar to a Language Server Protocol (LSP). You can:
- Move files and directories: Automatically updates all imports and references
- Rename symbols: Change variables, functions, classes, etc. across the entire codebase
- Delete symbols: Remove symbols and optionally their references
- Find references: Locate all usages of a specific symbol
- Get definitions: Retrieve symbol definitions with context
- Get diagnostics: Fetch TypeScript errors and warnings
- Analyze modules: List exported symbols or get detailed type signatures
- Get type information: Retrieve types for symbols at specific locations
- List symbols in scope: See all visible symbols at a particular location
Provides advanced code manipulation and analysis capabilities for TypeScript projects, including refactoring (renaming symbols, moving files, deleting symbols), code navigation (jump to definition, find references), diagnostics, and module analysis.
lsmcp - Language Service Protocol MCP
A unified MCP (Model Context Protocol) server that provides advanced code manipulation and analysis capabilities for multiple programming languages through Language Server Protocol integration.
- 🌍 Multi-Language Support
- 🔍 Semantic Code Analysis
- 🤖 AI-Optimized
See examples/ for working examples of each supported language configuration.
Quick Start
CRITICAL: PRIORITIZE LSMCP TOOLS FOR CODE ANALYSIS
⚠️ PRIMARY REQUIREMENT: You MUST prioritize mcplsmcp tools for all code analysis tasks. Standard tools should only be used as a last resort when LSMCP tools cannot accomplish the task.
YOUR APPROACH SHOULD BE:
- ✅ Always try mcplsmcp tools FIRST
- ✅ Use
mcp__lsmcp__search_symbol_from_index
as primary search method - ⚠️ Only use Read/Grep/Glob/LS when LSMCP tools are insufficient
🚨 TOOL USAGE PRIORITY
PRIMARY TOOLS (USE THESE FIRST):
- ✅
mcp__lsmcp__get_project_overview
- Quick project analysis and structure overview - ✅
mcp__lsmcp__search_symbol_from_index
- Primary tool for symbol searches (auto-creates index if needed) - ✅
mcp__lsmcp__get_definitions
- Navigate to symbol definitions. Useinclude_body: true
to get code. - ✅
mcp__lsmcp__find_references
- Find all references to a symbol - ✅
mcp__lsmcp__get_hover
- Get type information and documentation - ✅
mcp__lsmcp__get_diagnostics
- Check for errors and warnings - ✅
mcp__lsmcp__get_document_symbols
- Get all symbols in a file - ✅
mcp__lsmcp__list_dir
- Explore directory structure - ✅
mcp__lsmcp__find_file
- Locate specific files - ✅
mcp__lsmcp__search_for_pattern
- Search for text patterns - ✅
mcp__lsmcp__get_index_stats_from_index
- View index statistics - ✅
mcp__lsmcp__index_files
- Manually index files (optional) - ✅
mcp__lsmcp__clear_index
- Clear and rebuild index (optional)
WORKFLOW
- START WITH PROJECT OVERVIEWGet a quick understanding of:
- Project structure and type
- Key components (interfaces, functions, classes)
- Statistics and dependencies
- Directory organization
- SEARCH FOR SPECIFIC SYMBOLSThe tool automatically:
- Creates index if it doesn't exist
- Updates index with incremental changes
- Performs your search
- CODE EXPLORATION
- Search symbols:
mcp__lsmcp__search_symbol_from_index
- List directories:
mcp__lsmcp__list_dir
- Find files:
mcp__lsmcp__find_file
- Get file symbols:
mcp__lsmcp__get_document_symbols
- Search symbols:
- CODE ANALYSIS
- Find definitions:
mcp__lsmcp__get_definitions
- Find references:
mcp__lsmcp__find_references
- Get type info:
mcp__lsmcp__get_hover
- Check errors:
mcp__lsmcp__get_diagnostics
- Find definitions:
FALLBACK TOOLS (USE ONLY WHEN NECESSARY):
- ⚠️
Read
- Only when you need to see non-code files or LSMCP tools fail - ⚠️
Grep
- Only for quick searches when LSMCP search is insufficient - ⚠️
Glob
- Only when LSMCP file finding doesn't work - ⚠️
LS
- Only for basic directory listing when LSMCP fails - ⚠️
Bash
commands - Only for non-code operations or troubleshooting
WHEN TO USE FALLBACK TOOLS
Use standard tools ONLY in these situations:
- Non-code files: README, documentation, configuration files
- LSMCP tool failures: When LSMCP tools return errors or no results
- Debugging: When troubleshooting why LSMCP tools aren't working
- Special file formats: Files that LSMCP doesn't support
- Quick verification: Double-checking LSMCP results when needed
Memory System
You have access to project memories stored in .lsmcp/memories/
. Use these tools:
list_memories
- List available memory filesread_memory
- Read specific memory contentwrite_memory
- Create or update memories
Memories contain important project context, conventions, and guidelines that help maintain consistency.
The context and modes of operation are described below. From them you can infer how to interact with your user and which tasks and kinds of interactions are expected of you.
Available Presets
lsmcp includes built-in presets for popular language servers:
tsgo
- TypeScript (Recommended)typescript
- typescript-language-serverrust-analyzer
- Rust Analysermoonbit
- MoonBitfsharp
- F# (fsautocomplete)deno
- Deno TypeScript/JavaScriptgopls
- Go (Official Go language server)
Configuration
.lsmcp/config.json
For a comprehensive configuration example, see examples/full-lsmcp-config.json.
Tools
lsmcp provides comprehensive MCP tools for code analysis and manipulation:
Core LSP Tools
- get_hover - Get type information and documentation for symbols
- find_references - Find all references to a symbol across the codebase
- get_definitions - Navigate to symbol definitions with optional code body
- get_diagnostics - Check for errors and warnings in files
- get_all_diagnostics - Get diagnostics for entire project
- get_document_symbols - List all symbols in a file
- get_workspace_symbols - Search symbols across the entire workspace
- get_completion - Get code completion suggestions
- get_signature_help - Get parameter hints for function calls
- format_document - Format entire documents using language server
- check_capabilities - Check supported LSP features
Symbol Index Tools
- index_symbols - Smart incremental indexing with auto-updates
- search_symbol_from_index - Fast symbol search using pre-built index
- get_index_stats_from_index - View index statistics and performance
- clear_index - Clear and rebuild symbol index
- get_project_overview - Quick project structure and component analysis
Code Editing Tools
- replace_symbol_body - Replace entire symbol implementations
- insert_before_symbol - Insert code before symbols
- insert_after_symbol - Insert code after symbols
- replace_regex - Advanced regex-based replacements
File System Tools
- list_dir - List directories with gitignore support
- find_file - Find files by pattern
- search_for_pattern - Search text patterns in codebase
- get_symbols_overview - High-level symbol overview by file
Memory Management
- list_memories - List project memories
- read_memory - Read specific memory content
- write_memory - Create or update memories
- delete_memory - Remove memories
Development
See CONTRIBUTING.md for detailed development setup, testing instructions, and contribution guidelines.
License
MIT - See LICENSE file for details.
Tools
A specialized server that provides advanced TypeScript code manipulation and analysis capabilities, enabling refactoring, navigation, diagnostics, and module analysis through Claude.
Related MCP Servers
- AsecurityFlicenseAqualityThe server facilitates natural language interactions for exploring and understanding codebases, providing insights into data models and system architecture using a cost-effective, simple setup with support for existing Claude Pro subscriptions.Last updated -418Python
- -securityAlicense-qualityA comprehensive code analysis and management tool that integrates with Claude Desktop to analyze code at project and file levels, helping adapt changes to projects intelligently.Last updated -38PythonMIT License
- -securityAlicense-qualityA server that acts as a bridge between Claude and local Xcode projects, enabling AI-powered code assistance, project management, and automated development tasks without exposing your code to the internet.Last updated -JavaScriptMIT License
- AsecurityAlicenseAqualityA multi-language code analysis server that helps LLMs or humans automatically lint, type-check, and improve code with minimal installation friction, currently supporting Python with plans for other languages.Last updated -13PythonMIT License