شعار VSCode LSP MCP

VSCode LSP MCP

المجتمع
beixiyo

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

الناشرbeixiyo
المستودعvsc-lsp-mcp
اللغةTypeScript
التفريعات
11
النجوم
42
الأدوات المتاحة
0
نوع نقل البياناتstdio
الفئات
الترخيصMIT
الروابط
  • اربط الأدوات بسير عمل الذكاء الاصطناعي

    يتيح VSCode LSP MCP إمكانات MCP التي يمكن لتطبيقات الذكاء الاصطناعي العميلة ووكلاء الذكاء الاصطناعي المتوافقة استخدامها.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم أمثلة إعداد التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات الاهتمام بالمصدر المفتوح

    النجوم: 42، والنسخ المتفرعة: 11 في المستودع المرتبط.

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

التثبيت

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

استخدم MCP الخاص بـ VSCode LSP MCP مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل VSCode LSP MCP، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يعمل تكامل MCP هذا محليًا عبر موصل MCP الخاص بـ TypingMind على جهازك.

دليل الإعداد لاستخدام الموصل المحلي

استخدم هذا الخيار عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات أو موارد خاصة على جهاز الكمبيوتر لديك.

1

فتح إعدادات MCP

في TypingMind، انتقل إلى «الإعدادات»، ثم «الإعدادات المتقدمة»، ثم «بروتوكول سياق النموذج»، واختر «إعداد الموصل».

  1. افتح TypingMind في متصفحك.
  2. انقر على أيقونة الإعدادات.
  3. انتقل إلى الإعدادات المتقدمة.
  4. افتح قسم بروتوكول سياق النموذج.
  5. انقر على «إعداد الموصل» واختر «هذا الجهاز».
شاشة إعداد موصل MCP في TypingMind مع تحديد «هذا الجهاز»
2

تنفيذ أمر الموصل

اختر «هذا الجهاز»، وانسخ الأمر من TypingMind وشغّله في Terminal. أبقِ العملية قيد التشغيل أثناء استخدام MCP.

  1. انسخ أمر الإعداد الذي يعرضه TypingMind.
  2. افتح Terminal على macOS أو Windows Terminal على Windows.
  3. الصق الأمر ونفّذه.
  4. وافق على تثبيت الحزمة إذا طلب منك Terminal تأكيد المتابعة.
  5. أبقِ نافذة Terminal والعملية التي تعمل فيها قيد التشغيل أثناء استخدام أدوات MCP.
3

أضف VSCode LSP MCP كخادم

عندما تظهر حالة الموصل «جاهز»، انقر على «تعديل الخوادم» والصق إعدادات خادم MCP.

  1. انتظر حتى تظهر حالة الموصل «جاهز».
  2. انقر على «تعديل الخوادم».
  3. الصق إعدادات خادم MCP الخاص بـ VSCode LSP MCP.
  4. احفظ قائمة الخوادم.
  5. حدّث الحالة إذا أردت التأكد من أن الموصل لا يزال جاهزًا.
إعدادات MCP في TypingMind تعرض خادمًا نشطًا وزر «تعديل الخوادم»
{
  "mcpServers": {
    "vsc-lsp-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "lsp-mcp"
      ]
    }
  }
}
4

استخدام الاتصال مع نماذج مختلفة

احفظ قائمة الخوادم، وافتح «الإضافات»، وفعّل أدوات MCP الخاصة بـ VSCode LSP MCP، ثم اختر أي نموذج ذكاء اصطناعي مدعوم في TypingMind واستخدم الأدوات في المحادثة أو أسندها إلى وكيل ذكاء اصطناعي.

  1. افتح صفحة الإضافات في TypingMind.
  2. فعّل أدوات MCP الخاصة بـ VSCode LSP MCP.
  3. ابدأ محادثة واختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  4. استخدم أدوات MCP في المحادثة أو عيّنها لوكيل ذكاء اصطناعي.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر عند الحاجة دون إعادة الاتصال بـ MCP.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام VSCode LSP MCP لمساعدتي في هذه المهمة؟
VSCode LSP MCP
بالتأكيد. قرأته.
إليك ما وجدته باستخدام VSCode LSP MCP.

الأسئلة الشائعة

ما استخدامات خادم MCP VSCode LSP MCP؟

VSCode LSP MCP هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP VSCode LSP MCP مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام VSCode LSP MCP مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم موصل MCP VSCode LSP MCP مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل VSCode LSP MCP، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP VSCode LSP MCP بـ TypingMind؟

يعمل VSCode LSP MCP عبر موصل MCP المحلي في TypingMind. هذا هو الخيار الأنسب عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات سطح المكتب أو أدوات سطر الأوامر أو موارد خاصة على حاسوبك.

ما الأدوات التي يوفّرها خادم MCP VSCode LSP MCP في TypingMind؟

يتيح VSCode LSP MCP إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP VSCode LSP MCP؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويُبقي مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP تحت تحكمك. إذا كان VSCode LSP MCP يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇