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/asking-copilot-to-create-a-pull-request.md
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,30 @@ You can ask {% data variables.product.prodname_copilot_short %} to work on a tas
66
66
67
67
{% data variables.product.prodname_copilot_short %} will start a new session and respond with a link to the pull request it creates. It will work on the task and push changes to the pull request, and then add you as a reviewer when it has finished, triggering a notification.
68
68
69
+
## Asking {% data variables.product.prodname_copilot_short %} to create a pull request from the {% data variables.product.github %} MCP server
70
+
71
+
As an alternative to using {% data variables.copilot.copilot_chat_short %}, you can use the remote {% data variables.product.github %} MCP server to trigger {% data variables.copilot.copilot_coding_agent %} from any MCP host.
72
+
73
+
> [!NOTE]
74
+
> * This capability is only available on the remote {% data variables.product.github %} MCP server and host applications where remote MCP servers are supported.
75
+
76
+
1. Install the {% data variables.product.github %} MCP server in your preferred IDE or agentic coding tool. See [AUTOTITLE](/copilot/how-tos/context/model-context-protocol/using-the-github-mcp-server).
77
+
78
+
1. Ensure the `create_pull_request_with_copilot` tool is enabled.
79
+
80
+
1. Open chat.
81
+
82
+
1. Type a prompt asking {% data variables.product.prodname_copilot_short %} to create a pull request, with the details of what you want to change.
83
+
84
+
For example, `Open a PR in my repository to expand unit test coverage.`
85
+
86
+
> [!TIP]
87
+
> * You can ask {% data variables.product.prodname_copilot_short %} to open a pull request using a specific branch as the base branch by including it in your prompt.
88
+
89
+
1. Submit your prompt.
90
+
91
+
{% data variables.product.prodname_copilot_short %} will start a new session, open a draft pull request and work on the task in the background. As it works, it will push changes to the pull request, and once it has finished, it will add you as a reviewer. In most cases, the MCP host will show you the URL of the created pull request.
92
+
69
93
## Monitoring progress
70
94
71
95
You can view your current and past {% data variables.product.prodname_copilot_short %} sessions from the [Agents page](https://github.com/copilot/agents). See [AUTOTITLE](/copilot/using-github-copilot/coding-agent/using-the-copilot-coding-agent-logs).
Copy file name to clipboardExpand all lines: content/copilot/how-tos/agents/copilot-coding-agent/extending-copilot-coding-agent-with-mcp.md
+41-13Lines changed: 41 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -24,13 +24,13 @@ redirect_from:
24
24
25
25
{% data reusables.copilot.coding-agent.mcp-brief-intro %}
26
26
27
-
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.
27
+
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.
28
28
29
29
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).
30
30
31
31
> [!NOTE]
32
32
> * {% data variables.copilot.copilot_coding_agent %} only supports tools provided by MCP servers. It does not support resources or prompts.
33
-
> * {% 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).
33
+
> * {% data variables.copilot.copilot_coding_agent %} does not currently support remote MCP servers that leverage OAuth for authentication and authorization.
34
34
35
35
## Default MCP servers
36
36
@@ -77,14 +77,23 @@ You configure MCP servers using a special JSON format. The JSON must contain an
77
77
78
78
The configuration object can contain the following keys:
79
79
80
-
*`command` (`string`): The command to run to start the MCP server.
81
-
*`args` (`string[]`): The arguments to pass to the `command`.
80
+
**Required keys for local and remote MCP servers**
82
81
*`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.
83
-
*`type` (`string`): {% data variables.copilot.copilot_coding_agent %} only accepts `"local"`.
84
-
*`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:
82
+
*`type` (`string`): {% data variables.copilot.copilot_coding_agent %} accepts `"local"`, `"http"`, or `"sse"`.
83
+
84
+
**Local MCP specific keys**
85
+
*`command` (`string`): Required. The command to run to start the MCP server.
86
+
*`args` (`string[]`): Required. The arguments to pass to the `command`.
87
+
*`env` (`object`): Optional. 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:
85
88
* The name of a {% data variables.product.prodname_actions %} secret you have configured, beginning with `COPILOT_MCP_`.
86
89
* A string value.
87
90
91
+
**Remote MCP specific keys**
92
+
*`url` (`string`): Required. The MCP server's URL.
93
+
*`headers` (`object`): Optional. The headers to attach to requests to the server. This object should map the name of header keys to either of the following:
94
+
* The name of a {% data variables.product.prodname_actions %} secret you have configured, beginning with `COPILOT_MCP_` preceded by a `$`
95
+
* A string value
96
+
88
97
### Example configurations
89
98
90
99
#### Example: Sentry
@@ -96,6 +105,7 @@ The [Sentry MCP server](https://github.com/getsentry/sentry-mcp) gives {% data v
96
105
{
97
106
"mcpServers": {
98
107
"sentry": {
108
+
"type":"local",
99
109
"command":"npx",
100
110
// We can use the $SENTRY_HOST environment variable which is passed to
101
111
// the server because of the `env` value below.
@@ -122,6 +132,7 @@ The [Notion MCP server](https://github.com/makenotion/notion-mcp-server) gives {
122
132
{
123
133
"mcpServers": {
124
134
"notionApi": {
135
+
"type":"local",
125
136
"command":"docker",
126
137
"args": [
127
138
"run",
@@ -185,19 +196,36 @@ To use the Azure MCP with {% data variables.copilot.copilot_coding_agent %}, you
185
196
{
186
197
"mcpServers": {
187
198
"Azure": {
188
-
"command": "npx",
189
-
"args": [
190
-
"-y",
191
-
"@azure/mcp@latest",
192
-
"server",
193
-
"start"
199
+
"type": "local",
200
+
"command": "npx",
201
+
"args": [
202
+
"-y",
203
+
"@azure/mcp@latest",
204
+
"server",
205
+
"start"
194
206
],
195
-
"tools": ["*"]
207
+
"tools": ["*"]
196
208
}
197
209
}
198
210
}
199
211
```
200
212
213
+
#### Example: Cloudflare
214
+
215
+
The [Cloudflare MCP server](https://github.com/cloudflare/mcp-server-cloudflare) creates connections between your Cloudflare services, including processing documentation and data analysis.
216
+
217
+
```json copy
218
+
{
219
+
"mcpServers": {
220
+
"cloudflare": {
221
+
"type": "sse",
222
+
"url": "https://docs.mcp.cloudflare.com/sse",
223
+
"tools": ["*"]
224
+
}
225
+
}
226
+
}
227
+
```
228
+
201
229
### Reusing your MCP configuration from {% data variables.product.prodname_vscode %}
202
230
203
231
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 %}.
0 commit comments