lsp-mcp-server
Provides type-aware code navigation (go to definition, find references, document symbols, workspace symbol) and fuzzy file search using the JavaScript/TypeScript language server.
Provides type-aware code navigation (go to definition, find references, document symbols, workspace symbol) and fuzzy file search using the TypeScript language server.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@lsp-mcp-serverfind the definition of the handleClick function"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
lsp-mcp-server
A lightweight MCP server that exposes type-aware code navigation and fast file search to AI agents via language servers. It manages language server processes on demand, routes LSP requests from MCP tool calls, and returns structured results — letting agents jump to definitions, find references, list symbols, and locate files without reading entire codebases.
Installation
Option 1: Claude Code Plugin (recommended)
One command to clone, install, and register as a Claude Code plugin:
git clone https://github.com/garretpremo/lsp-mcp-server.git ~/.local/share/lsp-mcp-server \
&& cd ~/.local/share/lsp-mcp-server && bun install \
&& bash scripts/install-plugin.shRestart Claude Code (or run /reload-plugins) to activate. The plugin adds a skill that guides Claude on when to use each tool, plus the MCP server runs automatically for each project.
Option 2: Per-session (no install)
git clone https://github.com/garretpremo/lsp-mcp-server.git ~/tools/lsp-mcp-server \
&& cd ~/tools/lsp-mcp-server && bun installThen start Claude Code with:
claude --plugin-dir ~/tools/lsp-mcp-server/pluginOption 3: Manual MCP config
Add to your project's .mcp.json or ~/.claude/settings.json:
{
"mcpServers": {
"lsp-mcp-server": {
"command": "bun",
"args": ["run", "/path/to/lsp-mcp-server/src/index.ts", "--project", "."]
}
}
}Option 4: Standalone (any MCP client)
bun run src/index.ts --project /path/to/your/projectCommunicates via stdio JSON-RPC — works with any MCP-compatible client.
Related MCP server: Sigil MCP Server
Available Tools
Tool | Description |
| Fuzzy file name search against the project file index |
| Rebuild the file index (full project or a subdirectory) |
| Jump to the definition of a symbol at a given file position |
| Find all references to a symbol at a given file position |
| List all symbols (classes, functions, etc.) in a file |
| Search for symbols by name across the entire project |
All LSP navigation tools accept optional enrichment flags: includeKind, includeContainer, and includeDocstring.
Configuration
Place a config.json in your project root to override language server commands or the request timeout:
{
"requestTimeout": 15000,
"languageServers": {
"typescript": {
"command": "typescript-language-server",
"args": ["--stdio"]
},
"java": {
"command": "jdtls",
"args": []
}
}
}If no config.json is found, defaults are used. requestTimeout is in milliseconds (default: 10000).
Benchmarks: lsp-mcp-server vs JetBrains MCP
Tested against a 4,381-file Angular/TypeScript project (Nx monorepo).
File Search — "document-viewer"
lsp-mcp-server | JetBrains MCP | |
Response size | ~1,500 chars | 9,792 chars |
Results | 10 files, ranked by relevance | 40 items (files + dirs), unranked, duplicated by worktrees |
Format | Absolute + relative paths | Flat path list with worktree duplicates |
Document Symbols — reports.service.ts
lsp-mcp-server | JetBrains MCP | |
Response size | ~5,200 chars | 4,486 chars |
Result type | 31 structured symbols (name, kind, container, snippet) | Raw file text (no symbols tool available) |
Structured | Yes — class, method, property with hierarchy | No — LLM must parse symbols from raw text |
Go To Definition — HttpClient import
lsp-mcp-server | JetBrains MCP | |
Response size | ~550 chars | 34,868 chars |
Result type | 1 precise definition location | 50 text matches (grep-style, not semantic) |
Semantic | Yes — LSP-powered, type-aware | No — text search with |
Agent Token Usage (identical tasks, Sonnet model)
lsp-mcp-server | JetBrains MCP | |
Total tokens | 18,910 | 25,994 |
Tool calls | 3 | 10 |
Summary
6.5x smaller file search responses
63x smaller definition lookup responses
27% fewer tokens consumed by the agent
Structured symbol data vs raw text
True LSP semantics vs text-based grep
Prerequisites
The following language servers must be installed and available on your PATH:
TypeScript / JavaScript:
typescript-language-servernpm install -g typescript-language-server typescriptJava:
jdtls(Eclipse JDT Language Server)
Language servers are started lazily — only when a file of the matching type is first accessed.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Coding agents in multi-service codebases routinely rebuild existing helpers, trust stale type definitions, and modify API contracts without knowing who consumes them. Carrick solves this by indexing your entire TypeScript ecosystem across service and repository boundaries. By integrating deeply with the TypeScript compiler, Carrick traces every route, type, and cross-service call while recording function behaviour so agents search by intent rather than name. Delivered via MCP for AI agents and LSP for IDEs, Carrick ensures models see existing endpoints and utilities before generating new code. The scanner is source-available and runs from your CLI or CI pipeline.
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI agents with language-aware code analysis through the Language Server Protocol, enabling tasks like getting code insights and diagnostics.10 npm191MIT
- AlicenseNot gradedqualityCmaintenanceProvides IDE-like code navigation and search for local repositories, enabling AI assistants to perform symbol search, trigram indexing, and semantic navigation.AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables LLM agents to efficiently understand and navigate a codebase by providing semantic search over symbols and a reference graph, replacing expensive grep/glob calls with structured tools like definition lookup, caller/callee queries, and change-impact analysis.3MIT
- FlicenseNot gradedqualityAmaintenanceProvides efficient code navigation and graph-based analysis for AI agents, enabling symbol resolution, callers, implementations, and type schemas with minimal token usage.-