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 MCP
LSP for headless AI Agents
⚠️ This project is under active development. APIs and features may change without notice.
A unified MCP (Model Context Protocol) server that provides advanced code manipulation and analysis capabilities for multiple programming languages through Language Server Protocol integration.
Features
- 🌍 Multi-Language Support - Built-in TypeScript/JavaScript, extensible to any language via LSP
- 🔍 Semantic Code Analysis - Go to definition, find references, type information
- 🤖 AI-Optimized - Designed for LLMs with line and symbol-based interfaces
LSP Tools (Language Server Protocol)
These tools work with any language that has an LSP server:
- get_hover - Get hover information (type signature, documentation) using LSP
- find_references - Find all references to symbol across the codebase using LSP
- get_definitions - Get the definition(s) of a symbol using LSP
- get_diagnostics - Get diagnostics (errors, warnings) for a file using LSP
- get_all_diagnostics - Get diagnostics (errors, warnings) for all files in the project
- rename_symbol - Rename a symbol across the codebase using Language Server Protocol
- delete_symbol - Delete a symbol and optionally all its references using LSP
- get_document_symbols - Get all symbols (functions, classes, variables, etc.) in a document using LSP
- get_workspace_symbols - Search for symbols across the entire workspace using LSP
- get_completion - Get code completion suggestions at a specific position using LSP
- get_signature_help - Get signature help (parameter hints) for function calls using LSP
- get_code_actions - Get available code actions (quick fixes, refactorings, etc.) using LSP
- format_document - Format an entire document using the language server's formatting provider
See examples/ for working examples of each supported language configuration.
Quick Start
lsmcp provides multi-language support through Language Server Protocol (LSP) integration. The basic workflow is:
- Install Language Server - Install the LSP server for your target language
- Add MCP Server - Configure using
claude mcp add
command or.mcp.json
Basic Usage
Available Presets
lsmcp includes built-in presets for popular language servers:
typescript
- TypeScript/JavaScript (typescript-language-server)tsgo
- TypeScript/JavaScript (tsgo - faster alternative)deno
- Deno TypeScript/JavaScriptpyright
- Python (Microsoft Pyright)ruff
- Python (Ruff linter as LSP)rust-analyzer
- Rustfsharp
- F# (fsautocomplete)moonbit
- MoonBitgopls
- Go (Official Go language server)
For languages not in this list, or to customize LSP server settings, see Manual Setup.
Language-Specific Setup
TypeScript
Manual Configuration (.mcp.json)
Rust
Manual Configuration (.mcp.json)
See examples/rust-project/ for a complete example.
Go
Manual Configuration (.mcp.json)
See examples/go/ for a complete example.
F#
Manual Configuration (.mcp.json)
See examples/fsharp-project/ for a complete example.
Python
Manual Configuration (.mcp.json)
See examples/python-project/ for a complete example.
Other Languages
lsmcp supports any language with an LSP server. Here are some common configurations:
For more customization options, see Manual Setup.
Manual Setup
For advanced users who want more control over LSP server configuration, you can set up lsmcp manually with custom settings.
Minimal rust-analyzer Example
Custom Language Server Setup
You can configure any LSP server by providing the binary path and optional initialization options:
Using Configuration Files
For complex LSP server configurations, you can use the --config
option to load settings from a JSON file:
- Create a configuration file (e.g.,
my-language.json
):
- Use it with lsmcp:
This approach is useful when:
- You have complex initialization options
- You want to share configurations across projects
- You need to version control your LSP settings
Environment Variables
Some LSP servers can be configured via environment variables:
MCP Usage
Command Line Options
Development
See CLAUDE.md for development guidelines.
Troubleshooting
LSP Server Not Found
Solution: Install the language server:
Permission Denied
Solution: Update .claude/settings.json
to allow lsmcp tools.
Empty Diagnostics
If get_diagnostics
returns empty results:
- Ensure the language server is running:
ps aux | grep language-server
- Check for tsconfig.json or equivalent config file
- Try opening the file first with
get_hover
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 -416Python
- -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 -37PythonMIT License
- -securityFlicense-qualityA utility toolkit that enhances Claude's code interaction capabilities by providing seamless tools for Java code analysis, manipulation, and testing workflows.Last updated -2TypeScript
- -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