You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/copilot/how-tos/agents/copilot-coding-agent/best-practices-for-using-copilot-to-work-on-tasks.md
+3-6Lines changed: 3 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -102,11 +102,12 @@ This is a Go based repository with a Ruby client for certain API endpoints. It i
102
102
3. Use dependency injection patterns where appropriate
103
103
4. Write unit tests for new functionality. Use table-driven unit tests when possible.
104
104
5. Document public APIs and complex logic. Suggest changes to the `docs/` folder when appropriate
105
-
```
105
+
106
+
If you choose not to include a `.github/copilot-instructions.md` file in your repository, {% data variables.product.prodname_copilot_short %} will fall back to pre-existing custom instructions including `CLAUDE.md`, `AGENTS.md` and `GEMINI.md`.
106
107
107
108
## Using the Model Context Protocol (MCP)
108
109
109
-
You can extend the capabilities of {% data variables.copilot.copilot_coding_agent %} by using MCP. This allows {% data variables.copilot.copilot_coding_agent %} to use tools provided by local MCP servers. The {% data variables.product.github %} MCP server is enabled by default. For more information, see [AUTOTITLE](/copilot/using-github-copilot/coding-agent/extending-copilot-coding-agent-with-mcp).
110
+
You can extend the capabilities of {% data variables.copilot.copilot_coding_agent %} by using MCP. This allows {% data variables.copilot.copilot_coding_agent %} to use tools provided by local and remote MCP servers. The {% data variables.product.github %} MCP server and [Playwright MCP server](https://github.com/microsoft/playwright-mcp) are enabled by default. For more information, see [AUTOTITLE](/copilot/using-github-copilot/coding-agent/extending-copilot-coding-agent-with-mcp).
110
111
111
112
## Pre-installing dependencies in {% data variables.product.prodname_copilot %}'s environment
112
113
@@ -117,7 +118,3 @@ If {% data variables.product.prodname_copilot_short %} is able to build, test an
117
118
To do that, it will need your project's dependencies. {% data variables.product.prodname_copilot_short %} can discover and install these dependencies itself via a process of trial and error - but this can be slow and unreliable, given the non-deterministic nature of large language models (LLMs).
118
119
119
120
You can configure a `copilot-setup-steps.yml` file to pre-install these dependencies before the agent starts working so it can hit the ground running. For more information, see [AUTOTITLE](/copilot/customizing-copilot/customizing-the-development-environment-for-copilot-coding-agent#preinstalling-tools-or-dependencies-in-copilots-environment).
120
-
121
-
## Further reading
122
-
123
-
***Hands-on practice**: Try the [Expand your team with {% data variables.copilot.copilot_coding_agent %}](https://github.com/skills/expand-your-team-with-copilot/) Skills course for practical experience with {% data variables.copilot.copilot_coding_agent %}.
Copy file name to clipboardExpand all lines: content/copilot/how-tos/agents/copilot-coding-agent/extending-copilot-coding-agent-with-mcp.md
+7-20Lines changed: 7 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ redirect_from:
22
22
23
23
{% data reusables.copilot.coding-agent.mcp-brief-intro %}
24
24
25
-
The agent can use tools provided by local MCP servers. For example, the [Playwright MCP server](https://github.com/microsoft/playwright-mcp) provides tools to interact with web pages and pull in additional context when executing on the requested task. Some MCP servers are configured by default to provide the best experience for getting started.
25
+
The agent can use tools provided by local MCP servers. Some MCP servers are configured by default to provide the best experience for getting started.
26
26
27
27
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).
28
28
@@ -37,6 +37,9 @@ The following MCP servers are configured automatically for {% data variables.cop
37
37
***{% 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).
38
38
* 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 [Customizing the built-in {% data variables.product.github %} MCP server](#customizing-the-built-in-github-mcp-server) below.
39
39
40
+
***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.
41
+
* 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`.
42
+
40
43
## Setting up MCP servers in a repository
41
44
42
45
> [!WARNING]
@@ -50,7 +53,7 @@ Once MCP servers are configured for use within a repository, the tools specified
50
53
51
54
### Creating your JSON MCP configuration
52
55
53
-
You configure MCP servers using a special JSON format. The JSON must contain an `mcpServers` object, where the key is the name of the MCP server (for example, `playwright`), and the value is an object with the configuration for that MCP server.
56
+
You configure MCP servers using a special JSON format. The JSON must contain an `mcpServers` object, where the key is the name of the MCP server (for example, `sentry`), and the value is an object with the configuration for that MCP server.
54
57
55
58
```json copy
56
59
{
@@ -75,29 +78,13 @@ The configuration object can contain the following keys:
75
78
*`command` (`string`): The command to run to start the MCP server.
76
79
*`args` (`string[]`): The arguments to pass to the `command`.
77
80
*`tools` (`string[]`): The tools from the MCP server to enable. You may be able to find a list of tools in the server's documentation, or in its code. We strongly recommend that you allowlist specific read-only tools, since the agent will be able to use these tools autonomously and will not ask you for approval first. You can also enable all tools by including `*` in the array.
78
-
*`type` (`string`): Optional field. {% data variables.copilot.copilot_coding_agent %} only accepts `"local"`.
81
+
*`type` (`string`): {% data variables.copilot.copilot_coding_agent %} only accepts `"local"`.
79
82
*`env` (`object`): The environment variables to pass to the server. This object should map the name of the environment variable that should be exposed to your MCP server to either of the following:
80
83
* The name of a {% data variables.product.prodname_actions %} secret you have configured, beginning with `COPILOT_MCP_`.
81
84
* A string value.
82
85
83
86
### Example configurations
84
87
85
-
#### Example: Playwright
86
-
87
-
The [Playwright MCP server](https://github.com/microsoft/playwright-mcp) provides tools which allow {% data variables.product.prodname_copilot_short %} to browse the internet.
The [Sentry MCP server](https://github.com/getsentry/sentry-mcp) gives {% data variables.product.prodname_copilot_short %} authenticated access to exceptions recorded in [Sentry](https://sentry.io).
@@ -192,7 +179,7 @@ To use the Azure MCP with {% data variables.copilot.copilot_coding_agent %}, you
192
179
1. In your repository’s {% data variables.product.prodname_copilot_short %} environment, add secrets for your `AZURE_CLIENT_ID`, `AZURE_TENANT_ID` and `AZURE_SUBSCRIPTION_ID`.
193
180
1. Configure the Azure MCP server by adding an `azure` object to your MCP configuration.
0 commit comments