VSCode LSP MCP Server
Exposes VSCode's LSP features through MCP, allowing for accurate code analysis and navigation in GitHub repositories
Click on "Install 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., "@VSCode LSP MCP Serverget the definition of the calculateTotal 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.
VSCode LSP MCP
๐ Overview
VSCode LSP MCP is a Visual Studio Code extension that exposes Language Server Protocol (LSP) features through the Model Context Protocol (MCP).
Extension ID: cjl.lsp-mcp โ open Extensions (Ctrl+Shift+X / Cmd+Shift+X) and search for cjl.lsp-mcp to find this plugin precisely.
This allows AI assistants and external tools to utilize VSCode's powerful language intelligence capabilities without direct integration.
Using Neovim? See vv-mcp.nvim, the sibling implementation that exposes Neovim LSP clients and live editor context through MCP.

๐ Why This Extension?
Large language models like Claude and Cursor struggle to understand your codebase accurately because:
They rely on regex patterns to find symbols, leading to false matches
They can't analyze import/export relationships properly
They don't understand type hierarchies or inheritance
They have limited code navigation capabilities
This extension bridges that gap, providing AI tools with the same code intelligence that VSCode uses internally!
Related MCP server: mcp-pyright
โ๏ธ Features
๐ LSP Bridge: Converts LSP features into MCP tools
๐ค VS Code Copilot integration: Registers the local MCP server directly with VS Code Chat / Copilot
๐ Multi-Instance Broker: One stable MCP endpoint discovers and routes requests across all open VS Code windows
๐ง 25 LSP operations covering navigation, diagnostics, document metadata, symbols, call hierarchy, transactional rename, and safe Code Actions
โ Java dependency source: Get decompiled Java class source via jdt:// URI (from jdtls), so AI can read library implementations
๐ Dual output format: JSON for machine processing, Markdown for LLM-friendly reading
๐ ๏ธ Exposed MCP Tools
Tool | Description |
| Report the shared broker status |
| List active VS Code windows, workspace roots, and instance IDs |
| Execute an LSP operation in an explicitly selected or automatically matched instance |
| Rename a workspace file or directory in the matching instance |
LSP operations
Operation | Description |
| Get hover information (documentation, type, etc.) at a position |
| Get the definition location of a symbol |
| Get the declaration location of a symbol |
| Get the type definition location of a symbol |
| Get the implementation location(s) of a symbol |
| Find all references to a symbol |
| Find semantic occurrences of a symbol in the current document |
| Get navigable document links exposed by the active language extension |
| Get inferred type and parameter-name hints for a document range |
| Get signatures and active-parameter information at a call site |
| Get the symbol outline (tree) of a document |
| Search for symbols across the entire workspace by query |
| Get diagnostics for one file with optional severity, source, and code filters |
| Get filtered diagnostics under a workspace path |
| List editable Code Actions at a position |
| Preview one listed Code Action without side effects |
| Preview editable fix-all or quick-fix edits for an entire document |
| Apply one previously previewed Code Action transaction |
| Get decompiled Java class source via jdt:// URI (from jdtls), to read library/dependency implementations |
| Locate and validate a rename candidate |
| Preview a symbol rename without modifying files |
| Apply one previously previewed rename transaction |
| Prepare call hierarchy nodes and return recursive |
| Find all callers of a symbol |
| Find all callees (calls made by) a symbol |
All operations are invoked through the single execute_lsp MCP tool with a unified input format:
operationโ which LSP operation to executeuriโ file path or URI string (supports both plain paths andfile:///jdt://URIs)lineโ line number (1-based, matching editor display). Required for position-dependent operationscharacterโ character offset (1-based, matching editor display). Required for position-dependent operationsnewName/renameIdโ used by the three-stage rename flowactionKind/actionIdโ filter and continue the Code Action transaction flowqueryโ required only forworkspace_symbolssymbolKinds,includeDeclaration,includeExternal,pathPattern,severities,sources,codesโ optional result filters applied beforemaxResultsstartLine,endLineโ optional inclusive range forinlay_hintscallIdโ returned by call hierarchy operations for recursive traversalinstanceIdโ optional instance returned bylist_instances; takes precedence over automatic path routing
1-based positions: Both input and output use 1-based line/character values, matching what your editor displays. VS Code shows
Ln 9, Col 16โ passline: 9, character: 16. Output positions can be used directly as input for the next call โ no conversion needed.
Multi-instance routing
The extension starts one lightweight internal endpoint per VS Code window and registers it with a shared broker. External clients keep using a single MCP URL. The broker selects an instance in this order:
Exact
instanceId, when providedLongest workspace-root prefix matching the input file path
The only active instance, when no path can identify one
If two windows open the same project, routing is intentionally rejected as ambiguous until the caller passes instanceId. The registry contains no public credentials and stale window records expire automatically.
The first multi-instance release supports local desktop workspaces and file: resources. Remote SSH, WSL, Dev Containers, and virtual workspaces are not yet advertised as supported.
Workspace tools
Tool | Description |
| Rename a file or directory through VS Code's |
For example, the built-in TypeScript provider updates relative imports and barrel exports when a referenced .ts or .tsx file is renamed. The exact companion edits remain language-provider dependent, so inspect diagnostics after applying a resource rename.
๐ Configuration
Key | Description | Type | Default |
| Enable or disable the LSP MCP server. |
|
|
| Preferred port for the shared MCP broker. |
|
|
| Enable CORS for browser-based MCP clients. Keep disabled for native clients. |
|
|
| Allowed origins for CORS. Use |
|
|
| Whether to allow credentials (cookies, authorization headers) in CORS requests. |
|
|
| Headers that browsers are allowed to access. Provide a comma-separated list of headers (e.g., |
|
|
| Maximum number of items returned for list-type results such as |
|
|
| Output format for LSP operation results. |
|
|
| Path substrings used to classify dependency results for sorting and |
| language-specific defaults |
๐ Integration with AI Tools
VS Code Copilot
No mcp.json setup is required. After the extension starts, it registers the local LSP MCP server with VS Code through an MCP server definition provider.
Use MCP: List Servers or the chat tools picker in VS Code to enable or manage the LSP MCP Server.
Cursor
Config file: ~/.cursor/mcp.json (e.g. %USERPROFILE%\.cursor\mcp.json on Windows)
{
"mcpServers": {
"lsp-mcp": {
"url": "http://127.0.0.1:9527/mcp"
}
}
}OpenCode
Config file: ~/.config/opencode/opencode.jsonc
{
"mcp": {
"lsp-mcp": {
"type": "remote",
"url": "http://127.0.0.1:9527/mcp",
"enabled": true
}
}
}Claude Code
Config file: ~/.claude.json
{
"mcpServers": {
"lsp-mcp": {
"type": "http",
"url": "http://127.0.0.1:9527/mcp"
}
}
}Gemini | IFlow
Config file: ~/.gemini/settings.json
{
"mcpServers": {
"lsp-mcp": {
"type": "streamable-http",
"httpUrl": "http://127.0.0.1:9527/mcp"
}
}
}Codex
Config file: ~/.codex/config.toml
[mcp_servers.lsp-mcp]
url = "http://127.0.0.1:9527/mcp"Roo Code
{
"mcpServers": {
"lsp-mcp": {
"type": "streamable-http",
"url": "http://127.0.0.1:9527/mcp",
"disabled": false
}
}
}๐ป Development
Clone the repository
Run
pnpm installRun
pnpm run updateto generate metadataPress
F5to start debugging
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/beixiyo/vsc-lsp-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server