vscode官方Blog 07月16日 16:20
Agent mode: available to all users and supports MCP
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

VS Code推出了Agent模式,这是一个为所有用户提供的自主编程助手,能够执行多步骤编码任务,如代码分析、文件编辑和终端命令。Agent模式通过与MCP服务器和VS Code扩展的交互,支持广泛的任务。用户可以通过Chat视图启用Agent模式,并根据需求添加和管理工具。该模式改进了用户体验,支持多会话、笔记本编辑和工具调用自动批准等功能。VS Code团队持续改进Agent模式,并计划进一步扩展其功能,以提供更高效、更灵活的开发体验。

✅ Agent模式为VS Code用户提供了一个自主编程助手,可以执行多步骤编码任务,例如分析代码库、编辑文件以及运行终端命令。它通过循环自动纠正错误,直到任务完成。

💡 Agent模式支持与MCP服务器和VS Code扩展的交互,从而能够执行各种任务。用户可以通过Chat视图启用Agent模式,并在设置中配置相关选项。

🛠️ Agent模式具有可扩展性,允许用户根据特定工作流程定制工具。它支持内置工具、MCP服务器提供的工具以及VS Code扩展提供的工具。

✅ 为了给用户提供完全控制,Agent模式中的每个工具调用都会在UI中透明显示,并需要用户批准。用户可以允许特定工具用于当前会话、工作区或所有未来调用。

🚀 VS Code团队正在持续改进Agent模式,计划支持自定义模式、更快的代码应用体验、扩展MCP支持、编辑流以及性能和质量改进。

Agent mode: available to all users and supports MCP

April 7th, 2025 by Isidor Nikolic

Agent mode is rolling out to all VS Code users! The agent acts as an autonomous pair programmer that performs multi-step coding tasks at your command, such as analyzing your codebase, proposing file edits, and running terminal commands. It responds to compile and lint errors, monitors terminal output, and auto-corrects in a loop until the task is completed. The agent can also use contributed tools, allowing it to interact with external MCP servers or VS Code extensions to perform a wide variety of tasks.

Available to all users

Open the Chat view, sign in to GitHub, set chat.agent.enabled in your settings and select Agent in the Chat mode dropdown. If you do not see the setting, make sure to reload VS Code after updating to the latest version. In the following weeks, we are rolling it out by default to everyone - no setting will be required.

Agent mode is great for scenarios where:

    Your task involves multiple steps. The agent edits code, runs terminal commands, monitors for errors, and iterates to resolve any issues that arise.You are unsure about the scope of the changes. The agent automatically determines the relevant files and context.Your task requires interaction with external apps or data. The agent integrates with MCP servers and VS Code extensions.

On the other hand, use edit mode when the task has a well-defined scope, you want a quick turnaround, or you want finer control over the number of LLM requests.

We have created a unified chat experience, combining the Chat and Edits view, that brings benefits like session history, moving chat into a separate window, and simplification of the Working Set view. All of these are now also available in agent mode.

We continue to receive fantastic user feedback (please keep it coming!), which has inspired many of the improvements we have made. Most notably:

    The undo action now reverts changes up to the last edit file tool callSupport for multiple agent sessions in the same workspace (best when editing sessions don't modify the same files)The agent can now create and edit notebooksThe ability to auto-approve tool calls (terminal auto-approve coming in April)A host of quality-of-life improvements and bug fixes

Both the ask and edit experiences are evolving towards an architecture that, like the agent, utilizes tools. We are making this change to unify ask/edit/agent modes to all be agentic, with the goal of smoothening the overall user experience. This allows the edit mode to use the edit_file tool for improved speed, and the edit and ask mode to use #codebase, an agentic codebase search. Consequently, language models with no tool calling support will no longer be available in edit mode.

To learn more about how the agent works, you can read our previous post.

Extensible: MCP servers and VS Code extensions

Just as VS Code extensions enable you to customize your specific workflows, agent extensibility allows you to tailor the agent to your needs. With extensibility, the agent can perform browser actions (perform AI web debugging), connect to your chat and note-taking apps, interact with your databases, get context from your design system, get issues and repo context from GitHub and integrate with your cloud platforms. The power of agent mode is in the diversity of tools available and the flexibility to add and remove tools as a user. We are launching extensibility in preview and available to all users.

Agent mode can use the following tools:

    Built-in tools contributed by VS Code (blue in the diagram), which allow the agent to search the workspace, apply code changes, run terminal commands, capture compile or linting errors from the editor, fetch website content (#fetch to manually trigger), and more.Tools contributed by MCP servers (green in the diagram).Tools contributed by VS Code extensions (green in the diagrhttps://code.visualstudio.com/assets/blogs/2025/04/07/diagram.png/blogs/2025/04/07/diagram.png" alt="Diagram showing the inner works of agent mode and how it interacts with context, LLM and tools - including tools contributed by MCP servers and VS Code extensions" loading="lazy">

    When the VS Code team invented the Language Server Protocol (LSP) back in 2016, our goal was to standardize how language servers communicate with development tools. We are proud that LSP has become a widely adopted standard and fulfilled our vision. Recently, the ideas behind LSP inspired a new protocol: the Model Context Protocol (MCP), which standardizes how applications provide context to LLMs. With agent mode in VS Code using tools contributed by MCP servers, we have now come full circle back to VS Code.

    It's about developer control

    Not every task needs all the tools you might have added to agent mode, and as with any AI workflow, being specific leads to better results. We recommend using the tools UI to manage and enable the tools needed for each scenario or explicitly referencing tools https://code.visualstudio.comhttps://code.visualstudio.com/assets/blogs/2025/04/07/tools-ui.pnge>.

    To give you full control, every tool invocation is transparently displayed in the UI and requires your approval (except for read-only built-in tools). You can allow a specific tool for the current session, workspace, or all future invocations. If you want to minimize interruptions by always allowing the agent to use all tools, while still maintaining security, consider using the Dev Containers extension. This isolates all agent-driven changes within the container environment up to a point (for exhttps://code.visualstudio.comhttps://code.visualstudio.com/assets/blogs/2025/04/07/tool-call.pngges to remote if you allow it).

    Get started

    To customize the agent for your workflows, select the Tools icon in the chat input and follow the Add More Tools… flow. Alternatively, read our MCP server docs, which explain the configuration format, how to add an MCP server, or how to import MCP servers from an existing MCP client app like Claude Desktop. VS Code supports local standard input/output (stdio) and server-sent events (sse) for MCP server transport.

    MCP's official server repository is a great starting point for official, and community-contributed servers that showcase MCP's versatility. To install extensions that contributhttps://code.visualstudio.comhttps://code.visualstudio.com/assets/blogs/2025/04/07/tool-extensions.png using the tag @tag:language-model-tools.

    As a developer you can extend the agent by creating an MCP server, or if you are an extension author you can contribute tools to your VS Code extension. Refer to these docs for guidance and best practices on writing tools.

    What’s next

    Agent mode is improving every day, and to be among the first to benefit, consider installing VS Code Insiders. Using VS Code Insiders and providing feedback in our repo is the best way to help us improve the product. Next, we plan to work on:

      Support for custom modes with custom toolsets and instructionsA faster code-apply experienceExpand MCP support from tools to prompts, resources, and the latest spec updatesStreaming of edits limited to changed code blocks for improved speedCheckpoints to easily go back to a specific step in your agent mode sessionOverall performance and service quality improvements

    Make sure you are on the latest VS Code Stable, set chat.agent.enabled in your settings and select Agent from the mode dropdown. Try it out today and let us know what you think! You can find the documentation here.

    Happy vibe coding (now with MCP and extensions)!

    Isidor and the VS Code team

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

VS Code Agent模式 代码编辑 MCP VS Code扩展
相关文章