VSCode 作为 MCP 服务器 logo

VSCode 作为 MCP 服务器

Community
acomagu

Expose VSCode features such as file viewing and editing as MCP, enabling advanced AI-assisted coding directly from tools like Claude Desktop

Publisheracomagu
Repositoryvscode-as-mcp-server
LanguageTypeScript
Forks
29
Stars
124
Available tools
10
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    VSCode 作为 MCP 服务器 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 10 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    124 stars and 29 forks from the linked repository.

VSCode as MCP Server

Marketplace

A VSCode extension that turns your VSCode into an MCP server, enabling advanced coding assistance from MCP clients like Claude Desktop.

Key Features

Code Editing Support

  • Review proposed code changes from an LLM through diffs, allowing you to accept, reject, or provide feedback.
  • Real-time diagnostic messages (e.g., type errors) sent instantly to the LLM for immediate corrections.

Code editing diff

Terminal Operations

  • Execute commands within VSCode’s integrated terminal (supports background/foreground execution, and timeout settings).

Preview Tools

  • Preview URLs directly within VSCode’s built-in browser (e.g., automatically opens browser preview after starting a Vite server).

Preview tool

Multi-instance Switching

  • Easily switch the MCP server between multiple open VSCode windows.(Just by clicking the status bar item)

Instance switching

Relay Functionality (Experimental)

  • Relay and expose built-in MCP servers introduced in VSCode 1.99 externally.
  • Allows external access to tools provided by other MCP extensions, such as GitHub Copilot.

Available Built-in Tools

  • execute_command: Execute commands in VSCode’s integrated terminal
  • code_checker: Retrieve current diagnostics for your code
  • focus_editor: Focus specific locations within files
  • list_debug_sessions / start_debug_session / restart_debug_session / stop_debug_session: Manage debug sessions
  • text_editor: File operations (view, replace, create, insert, undo)
  • list_directory: List directory contents in a tree format
  • get_terminal_output: Fetch output from a specified terminal
  • list_vscode_commands / execute_vscode_command: List and execute arbitrary VSCode commands
  • preview_url: Open URLs within VSCode’s integrated browser

Installation & Setup

  1. Install the extension from the VSCode Marketplace.

  2. Configure your MCP client:

    • Using mcp-installer: You can simply instruct it to "install the vscode-as-mcp-server MCP server".
    • Other clients like Claude Desktop: Add the following to your configuration file (claude_desktop_config.json):
    json
    {
      "mcpServers": {
        "vscode": {
          "command": "npx",
          "args": ["vscode-as-mcp-server"]
        }
      }
    }
  3. Check the MCP server status in the bottom-right VSCode status bar:

    • (Server icon): Server is running
    • ∅: Click to start the server

Server status indicator

Motivation

This extension was developed to mitigate high costs associated with metered coding tools (like Roo Code and Cursor). It's an affordable, self-hosted alternative built directly into VSCode.

Bug reports and feedback are very welcome! 🙇

Future Roadmap

  • Ability to select which built-in MCP servers to expose
  • WebView-based approval UI (similar to Roo Code)
  • Integration with VSCode's file history (Timeline)
  • Instant toggling of auto-approvals and tool activation/deactivation
  • Customizable server port configuration

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "acomagu-vscode-as-mcp-server": {
      "command": "",
      "args": []
    }
  }
}

Available Tools

  • execute_command

    Execute a command in a VSCode integrated terminal with proper shell integration. This tool provides detailed output and exit status information, and supports:

    • Custom working directory
    • Shell integration for reliable output capture
    • Output compression for large outputs
    • Detailed exit status reporting
    • Flag for potentially destructive commands (potentiallyDestructive: false to skip confirmation for read-only commands)
  • code_checker

    Retrieve diagnostics from VSCode's language services for the active workspace. Use this tool after making changes to any code in the filesystem to ensure no new errors were introduced, or when requested by the user.

  • focus_editor

    Open the specified file in the VSCode editor and navigate to a specific line and column. Use this tool to bring a file into focus and position the editor's cursor where desired. Note: This tool operates on the editor visual environment so that the user can see the file. It does not return the file contents in the tool call result.

  • list_debug_sessions

    List all active debug sessions in the workspace.

  • start_debug_session

    Start a new debug session with the provided configuration.

  • restart_debug_session

    Restart a debug session by stopping it and then starting it with the provided configuration.

  • stop_debug_session

    Stop all debug sessions that match the provided session name.

  • text_editor

    A text editor tool that provides file manipulation capabilities using VSCode's native APIs:

    • view: Read file contents with optional line range
    • str_replace: Replace text in file
    • create: Create new file
    • insert: Insert text at specific line
    • undo_edit: Restore from backup

    Code Editing Tips:

    • VSCode may automatically prune unused imports when saving. To prevent this, make sure the imported type is actually used in your code before adding the import.
  • list_directory

    List directory contents in a tree format, respecting .gitignore patterns. Shows files and directories with proper indentation and icons. Useful for exploring workspace structure while excluding ignored files.

  • get_terminal_output

    Retrieve the output from a specific terminal by its ID. This tool allows you to check the current or historical output of a terminal, which is particularly useful when working with long-running commands or commands started in background mode with the execute_command tool.

Use VSCode 作为 MCP 服务器 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once VSCode 作为 MCP 服务器 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add VSCode 作为 MCP 服务器 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the VSCode 作为 MCP 服务器 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "acomagu-vscode-as-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "vscode-as-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the VSCode 作为 MCP 服务器 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the VSCode 作为 MCP 服务器 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use VSCode 作为 MCP 服务器 to help me with this task?
VSCode 作为 MCP 服务器
Sure. I read it.
Here is what I found using VSCode 作为 MCP 服务器.

Frequently asked questions

What is the VSCode 作为 MCP 服务器 MCP server used for?

VSCode 作为 MCP 服务器 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use VSCode 作为 MCP 服务器 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use VSCode 作为 MCP 服务器 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use VSCode 作为 MCP 服务器 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With VSCode 作为 MCP 服务器 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect VSCode 作为 MCP 服务器 MCP to TypingMind?

VSCode 作为 MCP 服务器 runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does VSCode 作为 MCP 服务器 MCP provide in TypingMind?

VSCode 作为 MCP 服务器 exposes 10 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use VSCode 作为 MCP 服务器 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If VSCode 作为 MCP 服务器 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇