Skip to content

Commit 45af184

Browse files
authored
changes from jules-17574 branch (#55144)
1 parent 5a80891 commit 45af184

File tree

12 files changed

+140
-8
lines changed

12 files changed

+140
-8
lines changed
56.4 KB
Loading
Loading
Loading
Loading
Loading
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
title: Extending Copilot Chat with the Model Context Protocol (MCP)
3+
allowTitleToDifferFromFilename: true
4+
shortTitle: Extend Copilot Chat with MCP
5+
intro: "Learn how to use the Model Context Protocol (MCP) to extend {% data variables.product.prodname_copilot_chat_short %}."
6+
versions:
7+
feature: copilot
8+
topics:
9+
- Copilot
10+
---
11+
12+
>[!NOTE]
13+
> * MCP support is currently in {% data variables.release-phases.public_preview %} and subject to change.
14+
> * MCP support is only available in {% data variables.product.prodname_copilot_chat_short %} for {% data variables.product.prodname_vscode %}.
15+
> * The [AUTOTITLE](/free-pro-team@latest/site-policy/github-terms/github-pre-release-license-terms) apply to your use of this product.
16+
17+
## Overview
18+
19+
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.
20+
21+
You can use MCP to extend the capabilities of {% data variables.product.prodname_copilot_chat_short %} by integrating it with a wide range of existing tools and services. For example, the {% data variables.product.github %} MCP server allows you to use {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode %} to perform tasks on {% data variables.product.github %}. You can also use MCP to create new tools and services that work with {% data variables.product.prodname_copilot_chat_short %}, allowing you to customize and enhance your experience.
22+
23+
For more information on MCP, see [the official MCP documentation](https://modelcontextprotocol.io/introduction).
24+
25+
For information on some of the other currently available MCP servers, see [the MCP servers repository](https://github.com/modelcontextprotocol/servers/tree/main).
26+
27+
## Prerequisites
28+
29+
* **Access to {% data variables.product.prodname_copilot_short %}**. {% data reusables.copilot.subscription-prerequisite %}
30+
* **{% data variables.product.prodname_vscode %} version 1.99 or later**. For information on installing {% data variables.product.prodname_vscode %}, see the [{% data variables.product.prodname_vscode %} download page](https://code.visualstudio.com/Download).
31+
32+
## Configuring MCP servers in {% data variables.product.prodname_vscode %}
33+
34+
To configure MCP servers in {% data variables.product.prodname_vscode %}, you need to set up a configuration script that specifies the details of the MCP servers you want to use. You can configure MCP servers for either:
35+
36+
* **A specific repository**. This will share MCP servers with anyone who opens the project in {% data variables.product.prodname_vscode %}. To do this, create a `.vscode/mcp.json` file in the root of your repository.
37+
* **Your personal instance of {% data variables.product.prodname_vscode %}**. You will be the only person who has access to configured MCP servers. To do this, add the configuration to your `settings.json` file in {% data variables.product.prodname_vscode %}.
38+
39+
>[!NOTE] We recommend you use only one location per server. Adding the same server to both locations may cause conflicts and unexpected behavior.
40+
41+
The steps below show how to configure the Fetch MCP server in your `.vscode/mcp.json` file. The Fetch MCP server is a simple MCP server that provides web content fetching capabilities. For more information on the Fetch MCP server, see [the Fetch directory](https://github.com/modelcontextprotocol/servers/tree/main/src/fetch) in the MCP Server repository.
42+
43+
You can use the same steps to configure MCP servers in your personal {% data variables.product.prodname_vscode %} settings. Details on how to configure other MCP servers are available in the [MCP servers repository](https://github.com/modelcontextprotocol/servers/tree/main).
44+
45+
1. Add the following configuration to your `.vscode/mcp.json` file:
46+
47+
```json copy
48+
{
49+
"inputs": [
50+
// The "inputs" section defines the inputs required for the MCP server configuration.
51+
{
52+
"type": "promptString"
53+
}
54+
],
55+
"servers": {
56+
// The "servers" section defines the MCP servers you want to use.
57+
"fetch": {
58+
"command": "uvx",
59+
"args": ["mcp-server-fetch"]
60+
}
61+
}
62+
}
63+
```
64+
65+
1. Save the `.vscode/mcp.json` file.
66+
1. A "Start" button will appear in your `.vscode/mcp.json` file, at the top of the list of servers. Click the "Start" button to start the MCP servers. This will trigger the input dialog and discover the server tools, which are then stored for later sessions.
67+
68+
![Screenshot of MCP server configuration in {% data variables.product.prodname_vscode %}. The "Start" button is outlined in dark orange. ](/assets/images/help/copilot/mcp-start-server-button.png)
69+
70+
1. Open {% data variables.product.prodname_copilot_chat_short %} by clicking the {% octicon "copilot" aria-hidden="true" %} icon in the title bar of {% data variables.product.prodname_vscode %}.
71+
1. In the {% data variables.product.prodname_copilot_chat_short %} box, select **Agent** from the popup menu.
72+
73+
![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} box in {% data variables.product.prodname_vscode %}. The "Agent" option is outlined in dark orange.](/assets/images/help/copilot/copilot-chat-agent-option.png)
74+
75+
1. To view your list of available MCP servers, click the tools icon in the top left corner of the chat box. This will open the MCP server list, where you can see all the MCP servers and associated tools that are currently available in your {% data variables.product.prodname_vscode %} instance.
76+
77+
For more information on configuring MCP servers in {% data variables.product.prodname_vscode %}, see [Use MCP servers in {% data variables.product.prodname_vscode %} (Preview)](https://aka.ms/vscode-add-mcp) in the {% data variables.product.prodname_vscode %} documentation.
78+
79+
>[!IMPORTANT] Beginning April 4, 2025, the {% data variables.product.github %} MCP server, and installation instructions, will be publicly available in the [github-mcp-server](https://github.com/github/github-mcp-server) repository.
80+
81+
## Using MCP servers in {% data variables.product.prodname_copilot_chat_short %}
82+
83+
Once you have configured your MCP servers, you can use them in {% data variables.product.prodname_copilot_chat_short %} to access a wide range of tools and services. In the example below, we will use the Fetch MCP server to fetch details about a web page.
84+
85+
1. Open {% data variables.product.prodname_copilot_chat_short %} by clicking the {% octicon "copilot" aria-hidden="true" %} icon in the title bar of {% data variables.product.prodname_vscode %}.
86+
1. In the {% data variables.product.prodname_copilot_chat_short %} box, select **Agent** from the popup menu.
87+
1. In the file with the MCP configuration, check that the MCP server is running. If it is not running, click the "Start" button to start the MCP server.
88+
89+
![Screenshot of the MCP server configuration in {% data variables.product.prodname_vscode %}. The "Running" status is outlined in dark orange.](/assets/images/help/copilot/vsc-mcp-server-running.png)
90+
91+
1. Ask {% data variables.product.prodname_copilot_chat_short %} to fetch the details of a URL. For example:
92+
93+
`Fetch https://github.com/github/docs.`
94+
95+
1. If {% data variables.product.prodname_copilot_short %} asks you to confirm that you want to proceed, click **Continue**.
96+
97+
1. {% data variables.product.prodname_copilot_short %} will fetch the details of the URL and display them in the chat box.
98+
99+
For more information on using MCP servers in {% data variables.product.prodname_vscode %}, see [Use MCP servers in {% data variables.product.prodname_vscode %} (Preview)](https://aka.ms/vscode-add-mcp) in the {% data variables.product.prodname_vscode %} documentation.
100+
101+
## Using existing MCP configurations
102+
103+
If you already have an MCP configuration in Claude Desktop, you can use that configuration in {% data variables.product.prodname_vscode %} to access the same MCP servers. To do this, add the following configuration to your `settings.json` file in {% data variables.product.prodname_vscode %}:
104+
105+
```json copy
106+
"chat.mcp.discovery.enabled": true"
107+
```
108+
109+
{% data variables.product.prodname_vscode %} will automatically find your existing configuration and use it in your {% data variables.product.prodname_vscode %} instance.
110+
111+
## Creating a new MCP server
112+
113+
You can create a new MCP server to fulfill your specific needs, and then integrate it with {% data variables.product.prodname_copilot_chat_short %}. For example, you can create an MCP server that connects to a database or a web service, and then use that server in {% data variables.product.prodname_copilot_chat_short %} to perform tasks on that database or web service.
114+
115+
For more information on creating and configuring your own MCP servers, see [the official MCP documentation](https://modelcontextprotocol.io/quickstart/server).

content/copilot/customizing-copilot/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ children:
1010
- /extending-the-capabilities-of-github-copilot-in-your-organization
1111
- /adding-repository-custom-instructions-for-github-copilot
1212
- /adding-personal-custom-instructions-for-github-copilot
13+
- /extending-copilot-chat-with-mcp
1314
- /managing-copilot-knowledge-bases
1415
- /creating-a-custom-model-for-github-copilot
1516
redirect_from:

content/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ See [inline chat](https://code.visualstudio.com/docs/copilot/copilot-chat#_inlin
113113

114114
### Using edit mode
115115

116-
1. To start an edit session, select **Open {% data variables.product.prodname_copilot_edits_short %}** from the {% data variables.product.prodname_copilot_chat_short %} menu.
116+
1. To start an edit session, select **Open Chat** from the {% data variables.product.prodname_copilot_chat_short %} menu.
117+
1. At the bottom of the chat panel, select **Edit** from the mode dropdown.
118+
119+
![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} mode dropdown. The "Edit" option is outlined in dark orange.](/assets/images/help/copilot/chat-mode-vscode.png)
120+
117121
1. Optionally, add relevant files to the _working set_ to indicate to {% data variables.product.prodname_copilot %} which files you want to work on.
118122
1. Submit a prompt. In response to your prompt, {% data variables.product.prodname_copilot_edits_short %} determines which files in your _working set_ to change and adds a short description of the change.
119123
1. Review the changes and **Apply** or **Discard** the edits for each file.
@@ -122,10 +126,8 @@ For more detailed instructions, see [{% data variables.product.prodname_copilot_
122126

123127
### Using agent mode
124128

125-
{% data reusables.copilot.agent-mode-public-preview-note %}
126-
127-
1. To start an edit session, select **Open {% data variables.product.prodname_copilot_edits_short %}** from the {% data variables.product.prodname_copilot_chat_short %} menu.
128-
1. Select **Agent** from the mode dropdown menu.
129+
1. To start an edit session, select **Open Chat** from the {% data variables.product.prodname_copilot_chat_short %} menu.
130+
1. At the bottom of the chat panel, select **Agent** from the mode dropdown.
129131
1. Submit a prompt. In response to your prompt, {% data variables.product.prodname_copilot_short %} streams the edits in the editor, updates the working set, and if necessary, suggests terminal commands to run.
130132
1. Review the changes. If {% data variables.product.prodname_copilot_short %} suggested terminal commands, confirm whether or not {% data variables.product.prodname_copilot_short %} can run them. In response, {% data variables.product.prodname_copilot_short %} iterates and performs additional actions to complete the task in your original prompt.
131133

content/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,6 @@ If you want to accept the next line of a suggestion, you will need to set a cust
337337

338338
## About {% data variables.copilot.next_edit_suggestions %}
339339

340-
> [!NOTE] {% data variables.copilot.next_edit_suggestions_caps %} is currently in {% data variables.release-phases.public_preview %} and is subject to change.
341-
342340
Inline suggestions autocomplete code, but many development tasks involve editing existing code. {% data variables.copilot.next_edit_suggestions_caps %} assists with edits both at the cursor and in other relevant parts of the code, helping maintain consistency and streamline changes.
343341

344342
{% data variables.copilot.next_edit_suggestions_caps %} predicts where and what edits may be needed based on ongoing changes. Suggestions may span a single symbol, an entire line, or multiple lines, depending on the scope of the potential change.

content/issues/tracking-your-work-with-issues/using-issues/creating-an-issue.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@ If you're using issues to track and prioritize your work, you can use issues to
171171

172172
{% endif %}
173173

174+
{% ifversion copilot %}
175+
176+
## Creating an issue from {% data variables.product.prodname_copilot_chat_short %}
177+
178+
You can create an issue from {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode %} with the Model Context Protocol (MCP). For more information, see [AUTOTITLE](/copilot/customizing-copilot/extending-copilot-chat-with-mcp).
179+
180+
{% endif %}
181+
174182
## Further reading
175183

176184
* [AUTOTITLE](/get-started/writing-on-github)

content/repositories/creating-and-managing-repositories/creating-a-new-repository.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ If you create an invalid URL using query parameters, or if you don’t have the
6363
| `owner` | `https://{% data variables.product.product_url %}/new?owner=avocado-corp&visibility=public` creates a public repository owned by the "avocado-corp" organization. | Any valid organization name or username. Alternatively, while signed in use `@me` to specify your user account as the owner. |
6464
| `template_owner` and `template_name` | `https://{% data variables.product.product_url %}/new?owner=avocado-corp&template_owner=avocado-corp&template_name=octo-repo` creates a repository owned by the "avocado-corp" using the avocado-corp's template "octo-repo". | The username of the template owner and the name of the repository template. |
6565

66+
{% ifversion copilot %}
67+
68+
## Creating a new repository from {% data variables.product.prodname_copilot_chat_short %}
69+
70+
You can create a new repository from {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode %} with the Model Context Protocol (MCP). For more information, see [AUTOTITLE](/copilot/customizing-copilot//extending-copilot-chat-with-mcp).
71+
72+
{% endif %}
73+
6674
## Further reading
6775

6876
* [AUTOTITLE](/code-security/getting-started/quickstart-for-securing-your-repository)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
**Agent mode** (public preview): Use agent mode when you have a specific task in mind and want to enable {% data variables.product.prodname_copilot_short %} to autonomously edit your code. In agent mode, {% data variables.product.prodname_copilot_short %} determines which files to make changes to, offers code changes and terminal commands to complete the task, and iterates to remediate issues until the original task is complete. Agent mode is only available in {% data variables.product.prodname_vscode %}.
1+
**Agent mode**: Use agent mode when you have a specific task in mind and want to enable {% data variables.product.prodname_copilot_short %} to autonomously edit your code. In agent mode, {% data variables.product.prodname_copilot_short %} determines which files to make changes to, offers code changes and terminal commands to complete the task, and iterates to remediate issues until the original task is complete. Agent mode is only available in {% data variables.product.prodname_vscode %}.

0 commit comments

Comments
 (0)