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/using-github-copilot/coding-agent/best-practices-for-using-copilot-to-work-on-tasks.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ This is a Go based repository with a Ruby client for certain API endpoints. It i
105
105
106
106
## Using the Model Context Protocol (MCP)
107
107
108
-
You can extend the capabilities of {% data variables.copilot.copilot_coding_agent %} by using MCP. This allows {% data variables.copilot.copilot_coding_agent %} use tools provided by local MCP servers. For more information, see [AUTOTITLE](/copilot/using-github-copilot/coding-agent/extending-copilot-coding-agent-with-mcp).
108
+
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).
109
109
110
110
## Pre-installing dependencies in {% data variables.product.prodname_copilot %}'s environment
Copy file name to clipboardExpand all lines: content/copilot/using-github-copilot/coding-agent/extending-copilot-coding-agent-with-mcp.md
+22-18Lines changed: 22 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,25 +21,31 @@ redirect_from:
21
21
22
22
{% data reusables.copilot.coding-agent.mcp-brief-intro %}
23
23
24
-
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.
24
+
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
25
26
26
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).
27
27
28
28
> [!NOTE]
29
29
> * {% data variables.copilot.copilot_coding_agent %} only supports tools provided by MCP servers. It does not support resources or prompts.
30
30
> * {% data variables.copilot.copilot_coding_agent %} currently only supports local MCP servers. To learn more about transport types, see the [official MCP documentation](https://modelcontextprotocol.io/docs/concepts/transports).
31
31
32
-
## Staying safe with MCP servers
32
+
## Default MCP servers
33
33
34
-
Once you've configured an MCP server, {% data variables.product.prodname_copilot_short %} will be able to use the tools provided by the server autonomously, and will not ask for your approval before using them.
34
+
The following MCP servers are configured automatically for {% data variables.copilot.copilot_coding_agent %}:
35
35
36
-
We recommend that you restrict your servers to read-only tools. You can use the `tools` configuration option to only expose known, safe tools to {% data variables.product.prodname_copilot_short %}.
36
+
***{% 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).
37
+
* 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.
37
38
38
-
## About setting up MCP servers in a repository
39
+
## Setting up MCP servers in a repository
40
+
41
+
> [!WARNING]
42
+
> Once you've configured an MCP server, {% data variables.product.prodname_copilot_short %} will be able to use the tools provided by the server autonomously, and will not ask for your approval before using them.
39
43
40
44
As a repository administrator, you can configure MCP servers for use within your repository. This is done via a JSON-formatted configuration that specifies the details of the MCP servers you want to use. You enter the JSON configuration directly into the settings for the repository on {% data variables.product.prodname_dotcom_the_website %}.
41
45
42
-
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 %} on each assigned task.
46
+
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.
47
+
48
+
{% data variables.product.prodname_copilot_short %} will use available tools autonomously, and will not ask for approval before use.
43
49
44
50
### Creating your JSON MCP configuration
45
51
@@ -67,15 +73,15 @@ The configuration object can contain the following keys:
67
73
68
74
*`command` (`string`): The command to run to start the MCP server.
69
75
*`args` (`string[]`): The arguments to pass to the `command`.
70
-
*`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 recommend that you allowlist specific tools, but you can also enable all tools by including `*` in the array.
76
+
*`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.
71
77
*`type` (`string`): Optional field. {% data variables.copilot.copilot_coding_agent %} only accepts `"local"`.
72
78
*`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:
73
79
* The name of a {% data variables.product.prodname_actions %} secret you have configured, beginning with `COPILOT_MCP_`.
74
80
* A string value.
75
81
76
-
## Example configurations
82
+
###Example configurations
77
83
78
-
### Example: Playwright
84
+
####Example: Playwright
79
85
80
86
The [Playwright MCP server](https://github.com/microsoft/playwright-mcp) provides tools which allow {% data variables.product.prodname_copilot_short %} to browse the internet.
81
87
@@ -91,7 +97,7 @@ The [Playwright MCP server](https://github.com/microsoft/playwright-mcp) provide
91
97
}
92
98
```
93
99
94
-
### Example: Sentry
100
+
####Example: Sentry
95
101
96
102
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).
97
103
@@ -117,7 +123,7 @@ The [Sentry MCP server](https://github.com/getsentry/sentry-mcp) gives {% data v
117
123
}
118
124
```
119
125
120
-
### Example: Notion
126
+
####Example: Notion
121
127
122
128
The [Notion MCP server](https://github.com/makenotion/notion-mcp-server) gives {% data variables.product.prodname_copilot_short %} authenticated access to notes and other content from [Notion](https://notion.so).
123
129
@@ -148,7 +154,7 @@ The [Notion MCP server](https://github.com/makenotion/notion-mcp-server) gives {
148
154
}
149
155
```
150
156
151
-
### Example: Azure
157
+
####Example: Azure
152
158
153
159
The [Azure MCP server](https://github.com/Azure/azure-mcp) creates a seamless connection between {% data variables.product.prodname_copilot_short %} and key Azure services such as Azure Cosmos DB and the Azure Storage platform.
154
160
@@ -202,7 +208,7 @@ To use the Azure MCP with {% data variables.copilot.copilot_coding_agent %}, you
202
208
}
203
209
```
204
210
205
-
## Reusing your MCP configuration from {% data variables.product.prodname_vscode %}
211
+
### Reusing your MCP configuration from {% data variables.product.prodname_vscode %}
206
212
207
213
If you have already configured MCP servers in {% data variables.product.prodname_vscode_shortname %}, you can leverage a similar configuration for {% data variables.copilot.copilot_coding_agent %}.
208
214
@@ -217,7 +223,7 @@ To adapt the configuration for {% data variables.copilot.copilot_coding_agent %}
217
223
218
224
For more information on MCP in {% data variables.product.prodname_vscode_shortname %}, see the [{% data variables.product.prodname_vscode_shortname %} docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).
219
225
220
-
## Adding your configuration to your repository
226
+
### Adding your configuration to your repository
221
227
222
228
Repository administrators can configure MCP servers by following these steps:
223
229
@@ -245,7 +251,7 @@ You must be a repository administrator to configure a {% data variables.product.
245
251
1. Under "Environment secrets", click **Add environment secret**.
246
252
1. Give the secret a name beginning `COPILOT_MCP_`, add the secret value, then click **Add secret**.
247
253
248
-
## Validating your MCP configuration
254
+
### Validating your MCP configuration
249
255
250
256
Once you've set up your MCP configuration, you should test it to make sure it is set up correctly.
251
257
@@ -262,9 +268,7 @@ If your MCP servers require any dependencies that are not installed on the {% da
262
268
263
269
## Customizing the built-in {% data variables.product.github %} MCP server
264
270
265
-
The {% data variables.product.github %} MCP server is enabled by default, giving {% data variables.product.prodname_copilot_short %} access to {% data variables.product.github %} data like issues and pull requests.
266
-
267
-
By default, the MCP server connects to {% data variables.product.github %} with a specially scoped token that only has read-only access to the current repository.
271
+
The {% data variables.product.github %} MCP server is enabled by default and connects to {% data variables.product.github %} with a specially scoped token that only has read-only access to the current repository.
268
272
269
273
If you want to allow {% data variables.product.prodname_copilot_short %} to access data outside the current repository, you can give it a {% data variables.product.pat_generic %} with wider access.
0 commit comments