|
| 1 | +--- |
| 2 | +title: 'Model Context Protocol (MCP) and {% data variables.copilot.copilot_coding_agent %}' |
| 3 | +shortTitle: 'MCP and {% data variables.copilot.copilot_coding_agent_short %}' |
| 4 | +allowTitleToDifferFromFilename: true |
| 5 | +intro: 'Find out about using the Model Context Protocol (MCP) with {% data variables.copilot.copilot_coding_agent %}.' |
| 6 | +versions: |
| 7 | + feature: copilot |
| 8 | +topics: |
| 9 | + - Copilot |
| 10 | +--- |
| 11 | + |
| 12 | +> [!NOTE] |
| 13 | +> {% data reusables.copilot.coding-agent.preview-note-text %} |
| 14 | +
|
| 15 | +## Overview |
| 16 | + |
| 17 | +{% data reusables.copilot.coding-agent.mcp-brief-intro %} |
| 18 | + |
| 19 | +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. |
| 20 | + |
| 21 | +For more information on MCP, see [the official MCP documentation](https://modelcontextprotocol.io/introduction). For information on some of the currently available MCP servers, see [the MCP servers repository](https://github.com/modelcontextprotocol/servers/tree/main). |
| 22 | + |
| 23 | +> [!NOTE] |
| 24 | +> * {% data variables.copilot.copilot_coding_agent %} only supports tools provided by MCP servers. It does not support resources or prompts. |
| 25 | +> * {% data variables.copilot.copilot_coding_agent %} does not currently support remote MCP servers that leverage OAuth for authentication and authorization. |
| 26 | +
|
| 27 | +## Default MCP servers |
| 28 | + |
| 29 | +The following MCP servers are configured automatically for {% data variables.copilot.copilot_coding_agent %}: |
| 30 | + |
| 31 | +* **{% data variables.product.github %}**: The {% data variables.product.github %} MCP server gives {% data variables.product.prodname_copilot_short %} access to {% data variables.product.github %} data like issues and pull requests. To learn more, see [AUTOTITLE](/copilot/customizing-copilot/using-model-context-protocol/using-the-github-mcp-server). |
| 32 | + * By default, the {% data variables.product.github %} MCP server connects to {% data variables.product.github %} using a specially scoped token that only has read-only access to the current repository. You can customize it to use a different token with broader access. For more details, see [AUTOTITLE](/copilot/how-tos/agents/copilot-coding-agent/extending-copilot-coding-agent-with-mcp#customizing-the-built-in-github-mcp-server). |
| 33 | + |
| 34 | +* **Playwright**: The [Playwright MCP server](https://github.com/microsoft/playwright-mcp) gives {% data variables.product.prodname_copilot_short %} access to web pages, including the ability to read, interact and take screenshots. |
| 35 | + * By default, the Playwright MCP server is only able to access web resources hosted within {% data variables.product.prodname_copilot_short %}'s own environment, accessible on `localhost` or `127.0.0.1`. |
| 36 | + |
| 37 | +## Setting up MCP servers in a repository |
| 38 | + |
| 39 | +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 {% data variables.copilot.copilot_coding_agent %} can use. |
| 40 | + |
| 41 | +Once MCP servers are configured for use within a repository, the tools specified in the configuration will be available to {% data variables.copilot.copilot_coding_agent %} during each assigned task. |
| 42 | + |
| 43 | +{% data variables.product.prodname_copilot_short %} will use available tools autonomously, and will not ask for approval before use. |
| 44 | + |
| 45 | +For details of how to set up MCP servers for {% data variables.copilot.copilot_coding_agent %} in a repository, see [AUTOTITLE](/copilot/how-tos/agents/copilot-coding-agent/extending-copilot-coding-agent-with-mcp). |
| 46 | + |
| 47 | +## Best practices |
| 48 | + |
| 49 | +* 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. |
| 50 | + |
| 51 | +* By default, {% data variables.copilot.copilot_coding_agent %} 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. |
| 52 | + |
| 53 | +* Carefully review the configured MCP servers prior to saving the configuration to ensure the correct servers are configured for use. |
0 commit comments