Logo vun VSCode LSP MCP

VSCode LSP MCP

Communautéit
beixiyo

Expose VS Code language intelligence to AI agents via MCP, with automatic routing across multiple windows

Editeurbeixiyo
Repositoryvsc-lsp-mcp
SproochTypeScript
Forks
11
Stären
42
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    VSCode LSP MCP stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    42 Stären an 11 Forks aus dem verlinkte Repository.

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.

[!TIP] Using Neovim? See vv-mcp.nvim, the sibling implementation that exposes Neovim LSP clients and live editor context through MCP.

vscode-ext demo

🌟 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!

⚙️ 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

ToolDescription
healthReport the shared broker status
list_instancesList active VS Code windows, workspace roots, and instance IDs
execute_lspExecute an LSP operation in an explicitly selected or automatically matched instance
rename_resourceRename a workspace file or directory in the matching instance

LSP operations

OperationDescription
hoverGet hover information (documentation, type, etc.) at a position
definitionGet the definition location of a symbol
declarationGet the declaration location of a symbol
type_definitionGet the type definition location of a symbol
implementationGet the implementation location(s) of a symbol
referencesFind all references to a symbol
document_highlightFind semantic occurrences of a symbol in the current document
document_linksGet navigable document links exposed by the active language extension
inlay_hintsGet inferred type and parameter-name hints for a document range
signature_helpGet signatures and active-parameter information at a call site
document_symbolsGet the symbol outline (tree) of a document
workspace_symbolsSearch for symbols across the entire workspace by query
diagnosticsGet diagnostics for one file with optional severity, source, and code filters
workspace_diagnosticsGet filtered diagnostics under a workspace path
code_actionsList editable Code Actions at a position
code_action_previewPreview one listed Code Action without side effects
fix_document_previewPreview editable fix-all or quick-fix edits for an entire document
code_action_applyApply one previously previewed Code Action transaction
class_file_contentsGet decompiled Java class source via jdt:// URI (from jdtls), to read library/dependency implementations
prepare_renameLocate and validate a rename candidate
rename_previewPreview a symbol rename without modifying files
rename_applyApply one previously previewed rename transaction
prepare_call_hierarchyPrepare call hierarchy nodes and return recursive callId values
incoming_callsFind all callers of a symbol
outgoing_callsFind 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 execute
  • uri — file path or URI string (supports both plain paths and file:///jdt:// URIs)
  • line — line number (1-based, matching editor display). Required for position-dependent operations
  • character — character offset (1-based, matching editor display). Required for position-dependent operations
  • newName / renameId — used by the three-stage rename flow
  • actionKind / actionId — filter and continue the Code Action transaction flow
  • query — required only for workspace_symbols
  • symbolKinds, includeDeclaration, includeExternal, pathPattern, severities, sources, codes — optional result filters applied before maxResults
  • startLine, endLine — optional inclusive range for inlay_hints
  • callId — returned by call hierarchy operations for recursive traversal
  • instanceId — optional instance returned by list_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 → pass line: 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:

  1. Exact instanceId, when provided
  2. Longest workspace-root prefix matching the input file path
  3. 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

ToolDescription
rename_resourceRename a file or directory through VS Code's WorkspaceEdit API. Accepts oldUri, newUri, and optional overwrite parameters. Language extensions can update affected imports and exports as part of the same workspace edit.

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

KeyDescriptionTypeDefault
lsp-mcp.enabledEnable or disable the LSP MCP server.booleantrue
lsp-mcp.portPreferred port for the shared MCP broker.number9527
lsp-mcp.cors.enabledEnable CORS for browser-based MCP clients. Keep disabled for native clients.booleanfalse
lsp-mcp.cors.allowOriginsAllowed origins for CORS. Use * to allow all origins, or provide a comma-separated list of origins (e.g., http://localhost:3000,http://localhost:5173).string*
lsp-mcp.cors.withCredentialsWhether to allow credentials (cookies, authorization headers) in CORS requests.booleanfalse
lsp-mcp.cors.exposeHeadersHeaders that browsers are allowed to access. Provide a comma-separated list of headers (e.g., Mcp-Session-Id).stringMcp-Session-Id
lsp-mcp.maxResultsMaximum number of items returned for list-type results such as workspace_symbols. Prevents excessive token usage.number200
lsp-mcp.outputFormatOutput format for LSP operation results. json for machine-readable JSON, markdown for LLM-friendly Markdown.stringjson
lsp-mcp.hover.excludePatternsRegular expressions that exclude an entire aggregated hover item when its content matches. Applies to JSON and Markdown output.string[]["^翻译 \u0060", "\\[Comment Translate\\]"]
lsp-mcp.dependencyMarkersPath substrings used to classify dependency results for sorting and includeExternal=false.string[]language-specific defaults

Hover exclusion patterns are applied to each complete aggregated hover item before output formatting. For example:

json
{
  "lsp-mcp.hover.excludePatterns": [
    "^翻译 `",
    "\\[Comment Translate\\]"
  ]
}

🔗 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)

json
{
  "mcpServers": {
    "lsp-mcp": {
      "url": "http://127.0.0.1:9527/mcp"
    }
  }
}

OpenCode

Config file: ~/.config/opencode/opencode.jsonc

json
{
  "mcp": {
    "lsp-mcp": {
      "type": "remote",
      "url": "http://127.0.0.1:9527/mcp",
      "enabled": true
    }
  }
}

Claude Code

Config file: ~/.claude.json

json
{
  "mcpServers": {
    "lsp-mcp": {
      "type": "http",
      "url": "http://127.0.0.1:9527/mcp"
    }
  }
}

Gemini | IFlow

Config file: ~/.gemini/settings.json

json
{
  "mcpServers": {
    "lsp-mcp": {
      "type": "streamable-http",
      "httpUrl": "http://127.0.0.1:9527/mcp"
    }
  }
}

Codex

Config file: ~/.codex/config.toml

toml
[mcp_servers.lsp-mcp]
url = "http://127.0.0.1:9527/mcp"

Roo Code

json
{
  "mcpServers": {
    "lsp-mcp": {
      "type": "streamable-http",
      "url": "http://127.0.0.1:9527/mcp",
      "disabled": false
    }
  }
}

💻 Development

  • Clone the repository
  • Run pnpm install
  • Run pnpm run update to generate metadata
  • Press F5 to start debugging

Installatioun

TypingMind
{
  "mcpServers": {
    "vsc-lsp-mcp": {
      "command": "node",
      "args": [
        "path/to/your/extension/activation/script.js"
      ]
    }
  }
}

VSCode LSP MCP MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal VSCode LSP MCP verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

VSCode LSP MCP als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu VSCode LSP MCP an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "vsc-lsp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "lsp-mcp"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu VSCode LSP MCP. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu VSCode LSP MCP.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat VSCode LSP MCP?
VSCode LSP MCP
Jo. Ech hunn et gelies.
Dat hunn ech mat VSCode LSP MCP fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server VSCode LSP MCP benotzt?

VSCode LSP MCP ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech VSCode LSP MCP MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir VSCode LSP MCP mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat VSCode LSP MCP MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann VSCode LSP MCP verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech VSCode LSP MCP MCP mat TypingMind?

VSCode LSP MCP leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt VSCode LSP MCP MCP an TypingMind zur Verfügung?

VSCode LSP MCP stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir VSCode LSP MCP MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann VSCode LSP MCP eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇