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.

๐ 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 Server
โ๏ธ Features
๐ LSP Bridge: Converts LSP features into MCP tools
๐ Multi-Instance Support: Automatically handles port conflicts for multiple VSCode windows
๐ง 16 LSP operations covering navigation (definition, declaration, implementation, references), documentation (hover, completions), structure (document/workspace symbols, call hierarchy), and manipulation (rename)
โ 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
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 implementation location(s) of a symbol |
| Find all references to a symbol |
| Get intelligent code completion suggestions |
| Get the symbol outline (tree) of a document |
| Search for symbols across the entire workspace by query |
| Get decompiled Java class source via jdt:// URI (from jdtls), to read library/dependency implementations |
| Rename a symbol across the workspace |
| Get symbol metadata (name, kind, range) at a position |
| 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โ required only forrenamequeryโ required only forworkspace_symbols
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.
๐ Configuration
Key | Description | Type | Default |
| Enable or disable the LSP MCP server. |
|
|
| Port for the LSP MCP server. |
|
|
| Maximum number of port retry attempts when the default port is occupied. |
|
|
| Enable or disable CORS (Cross-Origin Resource Sharing). |
|
|
| 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 (completions, workspace_symbols, etc.). Prevents excessive token usage. |
|
|
| Output format for LSP operation results. |
|
|
๐ Integration with AI Tools
Cursor
Config file: ~/.cursor/mcp.json (e.g. %USERPROFILE%\.cursor\mcp.json on Windows)
{
"mcpServers": {
"lsp": {
"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": {
"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
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