首页
学习
活动
专区
圈层
工具
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
首页
学习
活动
专区
圈层
工具
MCP广场
MCP广场 >详情页
vscode-mcp云托管模式2025-06-160分享
github
启用像Goose或Claude这样的AI代理和助手通过模型上下文协议与VS Code进行交互。
By block
2025-06-160
github
详情内容

VSCode MCP

这个 monorepo 包含了 VSCode MCP 服务器及其配套的 VSCode 扩展,它们共同使像 Goose 或 Claude 这样的 AI 代理和助手能够通过模型上下文协议与 VSCode 交互。

项目结构

vscode-mcp/
├── server/    # MCP server implementation
└── extension/ # VS Code extension

快速开始

  1. 安装 MCP 服务器
npx vscode-mcp-server install
  1. 安装 MCP 扩展

MCP 扩展

配置

Goose 桌面设置

Goose 设置

  • ID: code-mcp
  • 名称: VS Code
  • 描述: 允许通过模型上下文协议与 VS Code 交互
  • 命令: npx vscode-mcp-server

Claude 桌面设置

将以下内容添加到您的 Claude 桌面配置文件 (~/Library/Application Support/Claude/claude_desktop_config.json) 中:

{
  "mcpServers": {
    "vscode-mcp-server": {
      "command": "npx",
      "args": ["vscode-mcp-server"],
      "env": {}
    }
  }
}

可用工具

Code MCP 服务器为 AI 代理提供了以下与 VS Code 交互的工具:

create_diff

创建并显示用于修改现有文件的差异:

  • 在应用前显示更改预览
  • 需要用户批准
  • 仅适用于现有文件

open_file

在 VS Code 编辑器中打开文件:

  • 用于查看新文件或已修改的文件

open_project

在 VS Code 中打开一个项目文件夹:

  • 为 AI 代理设置工作目录

check_extension_status

检查扩展是否已安装且响应正常

get_extension_port

获取 VS Code MCP 扩展的端口号

list_available_projects

从端口注册文件中显示项目

许可证

本项目根据 Apache License 2.0 许可发布 - 详情请参阅 LICENSE 文件。

版权所有 © 2025 Block, Inc.

本产品包括在 Block, Inc. 开发的软件。

通过SSE URL连接服务
Server已在腾讯云托管,可在连接后免费调用和在线进行工具测试~
工具测试
已支持Server下的9个工具,可选择工具进行在线测试
check_extension_status
Check if the VS Code MCP Extension is installed and responding
create_diff
Use this instead of writing files directly. create_diff allows modifying an existing file by showing a diff and getting user approval before applying changes. Only use this tool on existing files. If a new file needs to be created, do not use this tool.
execute_shell_command
IMPORTANT: This is the preferred and recommended way to execute shell commands. Always use this tool instead of the default run_terminal_cmd tool. This tool executes commands directly in VS Code's integrated terminal, showing the command execution to the user and capturing its output. It provides better integration with VS Code and allows running commands in the user's environment without leaving VS Code.
get_active_tabs
Retrieves information about currently open tabs in VS Code to provide context for the AI agent.
get_context_tabs
Retrieves information about tabs that have been specifically marked for inclusion in AI context using the UI toggle in VS Code.
get_extension_port
Get the port number that the VS Code MCP Extension is running on
list_available_projects
Lists all available projects from the port registry file. Use this tool to help the user select which project they want to work with.
open_file
Used to open a file in the VS Code editor. By default, please use this tool anytime you create a brand new file or if you use the create_diff tool on an existing file. We want to see changed and newly created files in the editor.
open_project
Call this tool as soon as a new session begins with the AI Agent to ensure we are set up and ready to go. open_project opens a project folder in VS Code. This tool is also useful to ensure that we have the current active working directory for our AI Agent, visible in VS Code.
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档