Skip to main content

Model Context Protocol (MCP) and Agente de codificação do Copilot

Find out about using the Model Context Protocol (MCP) with Agente de codificação do Copilot.

Observação

O Agente de codificação do Copilot está em versão prévia pública e está sujeito a alterações. Durante a versão prévia, o uso do recurso está sujeito a Termos de licença de pré-lançamento do GitHub.

Overview

The Model Context Protocol (MCP) is an open standard that defines how applications share context with large language models (LLMs). MCP provides a standardized way to connect AI models to different data sources and tools, enabling them to work together more effectively.

You can use MCP to extend the capabilities of Agente de codificação do Copilot by connecting it to other tools and services.

The agent can use tools provided by local and remote MCP servers. Some MCP servers are configured by default to provide the best experience for getting started.

For more information on MCP, see the official MCP documentation. For information on some of the currently available MCP servers, see the MCP servers repository.

Observação

  • Agente de codificação do Copilot only supports tools provided by MCP servers. It does not support resources or prompts.
  • Agente de codificação do Copilot does not currently support remote MCP servers that leverage OAuth for authentication and authorization.

Default MCP servers

The following MCP servers are configured automatically for Agente de codificação do Copilot:

  • GitHub: The GitHub MCP server gives Copilot access to GitHub data like issues and pull requests. To learn more, see Using the GitHub MCP Server.

  • Playwright: The Playwright MCP server gives Copilot access to web pages, including the ability to read, interact and take screenshots.

    • By default, the Playwright MCP server is only able to access web resources hosted within Copilot's own environment, accessible on localhost or 127.0.0.1.

Setting up MCP servers in a repository

Repository administrators can configure MCP servers for use within that repository. This is done via a JSON-formatted configuration that specifies the details of the MCP servers that Agente de codificação do Copilot can use.

Once MCP servers are configured for use within a repository, the tools specified in the configuration will be available to Agente de codificação do Copilot during each assigned task.

Copilot will use available tools autonomously, and will not ask for approval before use.

For details of how to set up MCP servers for Agente de codificação do Copilot in a repository, see Extending Copilot coding agent with the Model Context Protocol (MCP).

Best practices

  • Enabling third-party MCP servers for use may impact the performance of the agent and the quality of the outputs. Review the third-party MCP server thoroughly and ensure that it meets your organization’s requirements.

  • By default, Agente de codificação do Copilot does not have access to write MCP server tools. However, some MCP servers do contain such tools. Be sure to review the tools available in the MCP server you want to use. Update the tools field in the MCP configuration with only the necessary tooling.

  • Carefully review the configured MCP servers prior to saving the configuration to ensure the correct servers are configured for use.