Skip to content
Back to search

vscode-mcp

MCP server for Claude Code/VSCode/Cursor/Windsurf to use editor self functionality. ⚡ Get real-time LSP diagnostics, type information, and code navigation for AI coding agents without waiting for slow tsc/eslint checks.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/tjx666--vscode-mcp/badge.svg)](/listings/tjx666--vscode-mcp)

HTML

<a href="/listings/tjx666--vscode-mcp"><img src="/api/listings/tjx666--vscode-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

> **🚨 IMPORTANT**: Before installing the MCP server, you must first install the VSCode MCP Bridge extension in your VSCode instance. The extension is required for the MCP server to communicate with VSCode.

Step 1: Install VSCode Extension

Install the VSCode MCP Bridge extension using ID: `YuTengjing.vscode-mcp-bridge`

Or search for "VSCode MCP Bridge" in the VSCode Extensions marketplace.

Step 2: Install MCP Server

Codex

Add the following configuration to your `~/.codex/config.toml`:

[mcp_servers.vscode-mcp]
command = "bunx"
args = ["-y", "@vscode-mcp/vscode-mcp-server@latest"]
env = { "VSCODE_MCP_DISABLED_TOOLS" = "health_check,list_workspaces,open_files" }
startup_timeout_ms = 16_000

Claude Code

Claude Code (claude.ai/code) provides built-in MCP support. Simply run:

claude mcp add vscode-mcp -- npx -y @vscode-mcp/vscode-mcp-server@latest

This command will automatically configure the MCP server in your Claude Code environment.

Cursor

Click the button to install

Or install manually

Go to `Cursor Settings` -> `Tools & Integrations` -> `New MCP Server`. Name to your liking, use `command` type with the command `npx @vscode-mcp/vscode-mcp-server@latest`. You can also verify config or add command line arguments via clicking `Edit`.

{
  "mcpServers": {
    "vscode-mcp": {
      "command": "npx",
      "args": ["@vscode-mcp/vscode-mcp-server@latest"]
    }
  }
}

Gemini CLI

Add the following configuration to your `~/.gemini/settings.json`:

{
  "mcpServers": {
    "vscode-mcp": {
      "command": "npx",
      "args": ["-y", "@vscode-mcp/vscode-mcp-server@latest"],
      "env": {},
      "includeTools": [
        "get_symbol_lsp_info",
        "get_diagnostics",
        "get_references",
        "health_check",
        "rename_symbol"
      ]
    }
  }
}

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 222 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # VSCode MCP
  2. <p align="center">
  3. <img src="packages/vscode-mcp-bridge/assets/logo.png" alt="VSCode MCP" width="200"/>
  4. </p>
  5. <p align="center">
  6. <strong>Connect VSCode with MCP (Model Context Protocol) for enhanced AI assistant capabilities</strong>
  7. </p>
  8. <p align="center">
  9. <a href="#design-motivation">Design Motivation</a> •
  10. <a href="#available-tools">Available Tools</a> •
  11. <a href="#installation">Installation</a> •
  12. <a href="#cli-no-mcp-config-required">CLI</a> •
  13. <a href="#architecture">Architecture</a> •
  14. <a href="#license">License</a>
  15. </p>
  16. [![MCP Badge](https://lobehub.com/badge/mcp/tjx666-vscode-mcp)](https://lobehub.com/mcp/tjx666-vscode-mcp) ![CI](https://github.com/tjx666/vscode-mcp/actions/workflows/vscode-extension-ci.yml/badge.svg) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com) [![Github Open Issues](https://img.shields.io/github/issues/tjx666/vscode-mcp)](https://github.com/tjx666/vscode-mcp/issues) [![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg?style=flat-square)](https://github.com/996icu/996.ICU/blob/master/LICENSE)
  17. ## Overview
  18. VSCode MCP is a comprehensive monorepo solution that enables MCP (Model Context Protocol) clients to access rich VSCode context information in real-time. This project bridges the gap between AI assistants and your development environment, providing accurate code analysis, diagnostics, and intelligent code navigation.
  19. ## Design Motivation
  20. **VSCode MCP Bridge primarily serves AI IDEs (like Cursor) and AI coding agents**, helping them develop and analyze code more efficiently.
  21. Traditional AI coding agents often need to execute time-consuming commands when validating code modifications:
  22. - `tsc --noEmit` - TypeScript type checking
  23. - `eslint .` - Code style checking
  24. - `npm run build` - Project building
  25. These commands run slowly in large projects, severely impacting AI development efficiency. VSCode MCP Bridge provides real-time LSP (Language Server Protocol) information, allowing AI agents to:
  26. - **Get fast diagnostics** (`get-diagnostics`) - Replace time-consuming type checking and lint commands
  27. - **Access comprehensive LSP information** (`get-symbol-lsp-info`) - Get definition, hover, signatures, and type info in one call
  28. - **Navigate code efficiently** (`get-references`) - Understand code structure and dependencies with usage context
  29. - **Safe file operations** - Rename symbols across files with automatic import updates
  30. ### Core Advantages
  31. 1. **Real-time**: Leverage VSCode's LSP for real-time code state without executing slow commands
  32. 2. **Accuracy**: Precise analysis based on language servers, more reliable than static analysis
  33. 3. **Efficiency**: Significantly reduce AI coding agent wait times
  34. 4. **Integration**: Deep integration with VSCode ecosystem, supporting multiple languages and extensions
  35. ## Available Tools
  36. VSCode MCP provides the following tools through the MCP protocol:
  37. | Tool | Description |
  38. | ----------------------- | ---------------------------------------------------------------- |
  39. | **execute_command** | ⚠️ Execute VSCode commands with JSON string arguments |
  40. | **get_symbol_lsp_info** | Get comprehensive LSP info (definition, hover, signatures, etc.) |
  41. | **get_diagnostics** | Get real-time diagnostics, replace slow tsc/eslint |
  42. | **get_references** | Find symbol references with usage context code |
  43. | **health_check** | Test connection to VSCode MCP Bridge extension |
  44. | **list_workspaces** | List all available VSCode workspaces |
  45. | **open_files** | Open multiple files with optional editor display |
  46. | **rename_symbol** | Rename symbols across all files in workspace |
  47. > **⚠️ Security Warning**: The `execute_command` tool can execute arbitrary VSCode commands and potentially trigger dangerous operations. Use with extreme caution and only with trusted AI models.
  48. ## Installation
  49. > **🚨 IMPORTANT**: Before installing the MCP server, you must first install the VSCode MCP Bridge extension in your VSCode instance. The extension is required for the MCP server to communicate with VSCode.
  50. ### Step 1: Install VSCode Extension
  51. Install the VSCode MCP Bridge extension using ID: `YuTengjing.vscode-mcp-bridge`
  52. [![Install VSCode Extension](https://img.shields.io/badge/VSCode%20Marketplace-Install%20Extension-007ACC?style=for-the-badge&logo=visualstudiocode)](https://marketplace.visualstudio.com/items?itemName=YuTengjing.vscode-mcp-bridge)
  53. Or search for "VSCode MCP Bridge" in the VSCode Extensions marketplace.
  54. ### Step 2: Install MCP Server
  55. #### Codex
  56. Add the following configuration to your `~/.codex/config.toml`:
  57. ```toml
  58. [mcp_servers.vscode-mcp]
  59. command = "bunx"
  60. args = ["-y", "@vscode-mcp/vscode-mcp-server@latest"]
  61. env = { "VSCODE_MCP_DISABLED_TOOLS" = "health_check,list_workspaces,open_files" }
  62. startup_timeout_ms = 16_000
  63. ```
  64. #### Claude Code
  65. Claude Code (claude.ai/code) provides built-in MCP support. Simply run:
  66. ```bash
  67. claude mcp add vscode-mcp -- npx -y @vscode-mcp/vscode-mcp-server@latest
  68. ```
  69. This command will automatically configure the MCP server in your Claude Code environment.
  70. #### Cursor
  71. ##### Click the button to install
  72. [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/install-mcp?name=vscode-mcp&config=eyJjb21tYW5kIjoibnB4IEB2c2NvZGUtbWNwL3ZzY29kZS1tY3Atc2VydmVyQGxhdGVzdCJ9)
  73. ##### Or install manually
  74. Go to `Cursor Settings` -> `Tools & Integrations` -> `New MCP Server`. Name to your liking, use `command` type with the command `npx @vscode-mcp/vscode-mcp-server@latest`. You can also verify config or add command line arguments via clicking `Edit`.
  75. ```json
  76. {
  77. "mcpServers": {
  78. "vscode-mcp": {
  79. "command": "npx",
  80. "args": ["@vscode-mcp/vscode-mcp-server@latest"]
  81. }
  82. }
  83. }
  84. ```
  85. #### Gemini CLI
  86. Add the following configuration to your `~/.gemini/settings.json`:
  87. ```json
  88. {
  89. "mcpServers": {
  90. "vscode-mcp": {
  91. "command": "npx",
  92. "args": ["-y", "@vscode-mcp/vscode-mcp-server@latest"],
  93. "env": {},
  94. "includeTools": [
  95. "get_symbol_lsp_info",
  96. "get_diagnostics",
  97. "get_references",
  98. "health_check",
  99. "rename_symbol"
  100. ]
  101. }
  102. }
  103. }
  104. ```
  105. ## CLI (no MCP config required)
  106. If your agent can shell out but you don't want to register an MCP server, install `@vscode-mcp/vscode-mcp-cli`. It exposes the **same** tools as the MCP server as plain subcommands, talking to the VSCode Bridge extension over the same socket.
  107. ```bash
  108. # Run directly without install
  109. bunx --bun @vscode-mcp/vscode-mcp-cli --help
  110. # Or install globally
  111. npm i -g @vscode-mcp/vscode-mcp-cli
  112. vscode-cli --help
  113. ```
  114. ### Subcommands
  115. One subcommand per MCP tool, kebab-case:
  116. ```
  117. vscode-cli get-diagnostics # real-time LSP diagnostics
  118. vscode-cli get-symbol-lsp-info # hover / signatures / definitions
  119. vscode-cli get-references # references with usage context
  120. vscode-cli rename-symbol # workspace-wide rename
  121. vscode-cli open-files # open one or more files
  122. vscode-cli execute-command # ⚠️ run arbitrary VSCode commands
  123. vscode-cli health-check # ping the bridge
  124. vscode-cli list-workspaces # enumerate open VSCode windows
  125. ```
  126. ### Workspace targeting
  127. CLI defaults `--workspace` to `process.cwd()`. Override with `--workspace <path>` when you need to target a different open VSCode window (must match a workspace from `list-workspaces`).
  128. ### Examples
  129. ```bash
  130. # Diagnostics on git-modified files in the current workspace
  131. vscode-cli get-diagnostics
  132. # Find references to `myFunction` in src/utils.ts at line 42
  133. vscode-cli get-references --file-path src/utils.ts --line 42 --character 10
  134. # Open multiple files in background (no editor focus)
  135. vscode-cli open-files --files src/a.ts src/b.ts --no-show-editor
  136. # Target a different VSCode window
  137. vscode-cli get-diagnostics --workspace /Users/me/other-project
  138. ```
  139. The text output is byte-identical to what the MCP server returns — every flag is auto-generated from the IPC zod schema, so anything the MCP tool accepts has a `--kebab-case` flag here.
  140. ## Tool Filtering
  141. You can control which tools are available using command-line arguments or environment variables:
  142. **Command-line arguments:**
  143. - `--enable-tools` - Comma-separated list of tools to enable (whitelist mode). If specified, only these tools will be available.
  144. - `--disable-tools` - Comma-separated list of tools to disable (blacklist mode). Applied after `--enable-tools`.
  145. **Environment variables:**
  146. - `VSCODE_MCP_ENABLED_TOOLS` - Same as `--enable-tools`
  147. - `VSCODE_MCP_DISABLED_TOOLS` - Same as `--disable-tools`
  148. ## Architecture
  149. Once installed and configured, VSCode MCP works seamlessly with MCP-compatible clients:
  150. 1. **VSCode Extension**: Runs in your VSCode instance and provides access to LSP data
  151. 2. **MCP Server / CLI**: Translates MCP calls (or CLI subcommands) to VSCode extension requests over a per-workspace Unix socket
  152. All tools require the `workspace_path` parameter to target a specific open VSCode instance. This must be the workspace folder reported by `list_workspaces` or the extension activation log, because each VSCode workspace gets its own socket connection. If you need diagnostics for files inside a child project or git submodule, keep `workspace_path` set to the open VSCode workspace root and pass child paths as tool-specific file parameters.
  153. ## License
  154. This project is licensed under the [Anti 996](https://github.com/996icu/996.ICU/blob/master/LICENSE) License.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.