VS Code x MCP is the documentation page in Visual Studio Code docs about using MCP servers in Copilot. MCP (Model Context Protocol) is used to connect agents to external tools and data sources. When Copilot lacks the tools or data it needs (for example, querying a database or searching a documentation service), you can add an MCP server.
Main capabilities and ways to add:
- Connect to supported services: use Copilot connectors (preview), with configuration and authentication managed by GitHub, no local server required.
- Find published integrations: browse servers, or install agent plugins that bundle MCP tools.
- Add a server directly: use the URL or startup command provided by the publisher.
Before you begin: enable AI features, open a local project folder in VS Code, and select Copilot in the Session Target dropdown. The documentation examples use a personal configuration.
Find and install servers: you can run Chat: Open Customizations from the Command Palette and select Browse, select GitHub Feed in the source menu, and search by name or @type:mcp; review the publisher, server capabilities, and installation requirements, then select Install. GitHub Feed is an experimental feature that requires a harness providing marketplace search, and availability also depends on organization policy. You can also run MCP: Browse MCP Servers to open server discovery, or use MCP: Add Server to choose to import configuration from another application. If you already have a package or image name, you can select NPM Package, Pip Package, or Docker Image, and the model helps generate the configuration; before accepting, review the command, publisher, and credential requirements, and install any required runtime.
Add by URL or command: remote servers use a URL, and local servers use a startup command. The documentation uses the Microsoft Learn MCP server as the first example, whose endpoint is https://learn.microsoft.com/api/mcp,无需认证或本地运行时。操作步骤为:在 With Copilot selected, run Chat: Open Customizations, select MCP Servers, click Add Server (+) in the User group, select HTTP, enter the endpoint, and fill in a unique server ID (e.g., microsoftLearn), then select Copilot Global under Global. This personal configuration is shared across workspaces on the same host and compatible Copilot experiences (including Copilot CLI). To share within a workspace, refer to the configuration target documentation. Review the server trust request before accepting it. For local process servers, select Command (stdio) and enter the publisher's launch command; for example, the Playwright MCP server requires Node.js 18 or later and npx available.
Using server tools: Ask Copilot for a task that requires the connected service; Copilot will select the relevant tools, so there is no need to name the server each time. You can explicitly name it when testing the connection or specifying a service. Review launch, sign-in, or tool approval requests and only approve operations you understand. Servers may initiate input requests (such as filter criteria or date ranges); do not enter passwords or API keys in these forms. Interactive results (experimental) can display forms, visualizations, or other controls alongside tool results.
Verifying the first tool call: Name the server and perform a low-impact task, expand the tool call in the conversation, and confirm that the correct server was used and returned the expected document results; a plausible-looking answer with no tool call does not verify the connection.
Configuration targets and management: Personal configurations apply to clients that read the same Copilot configuration, but configurations are not synchronized across machines, and shared authentication credentials are not guaranteed. For workspace configuration, file locations, supported fields, and authentication, see the configuration reference; remote hosts or containers must follow the remote setup guide. Existing Local harness configurations should use the compatibility reference rather than copying settings. To manage servers, open Chat: Open Customizations > MCP Servers and use the ellipsis menu to Disable or Uninstall; stopping a server only ends the current run, and subsequent requests can start it again. Connectors should disconnect the service; if a server has no Uninstall, follow the removal instructions for its configuration source.
Limitations and caveats: The Local harness is deprecated and will be removed in February 2027; you needto migrate to the Copilot harness. Local MCP servers can run code on the user's machine, and tools access services with the user's permissions; review the publisher, command or endpoint, and requested access permissions before installing or starting. Do not paste credentials into chat or shared configurations.