Skip to content

Commit 3195047

Browse files
saritaiCopilotD1M1TR10S
authored
GA of MCP support for Visual Studio (#57195)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Dimitrios Philliou <d1m1tr10s@github.com>
1 parent c0429bd commit 3195047

File tree

5 files changed

+177
-20
lines changed

5 files changed

+177
-20
lines changed

content/copilot/concepts/about-mcp.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ topics:
1010
contentType: concepts
1111
---
1212

13-
{% data reusables.copilot.mcp-availability-and-preview-note %}
14-
1513
## Overview of Model Context Protocol (MCP)
1614

1715
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.

content/copilot/how-tos/provide-context/use-mcp/extend-copilot-chat-with-mcp.md

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ redirect_from:
1717
contentType: how-tos
1818
---
1919

20-
{% data reusables.copilot.mcp-availability-and-preview-note %}
21-
2220
## Introduction
2321

2422
The Model Context Protocol (MCP) is an open standard that defines how applications share context with large language models (LLMs). For an overview of MCP, see [AUTOTITLE](/copilot/concepts/about-mcp).
@@ -121,6 +119,77 @@ If you already have an MCP configuration in Claude Desktop, you can use that con
121119

122120
{% endvscode %}
123121

122+
{% visualstudio %}
123+
124+
## Prerequisites
125+
126+
* **Access to {% data variables.product.prodname_copilot_short %}**. {% data reusables.copilot.subscription-prerequisite %}
127+
* **{% data variables.product.prodname_vs %} version 17.14 or later**. For more information on installing {% data variables.product.prodname_vs %}, see the [{% data variables.product.prodname_vs %} downloads page](https://visualstudio.microsoft.com/downloads/).
128+
* **Sign in to {% data variables.product.company_short %} from {% data variables.product.prodname_vs %}**.
129+
* {% data reusables.copilot.mcp-policy-requirement %}
130+
131+
## Configuring MCP servers in {% data variables.product.prodname_vs %}
132+
133+
1. In the {% data variables.product.prodname_vs %} menu bar, click **View**, then click **{% data variables.copilot.copilot_chat %}**.
134+
1. At the bottom of the chat panel, select **Agent** from the mode dropdown.
135+
1. In the {% data variables.copilot.copilot_chat_short %} window, click the tools icon, then click the plus icon in the tool picker window.
136+
1. In the "Configure MCP server" pop-up window, fill out the fields, including server ID, type, and any additional fields required for the specific MCP server configuration.
137+
138+
{% data variables.product.prodname_vs %} supports both remote and local servers. Remote servers, defined with a URL and credentials, are hosted externally for easier setup and sharing, while local servers, defined with command-line invocation, run on your local machine and can access local resources. See example configurations below, using the {% data variables.product.github %} MCP server as an example.
139+
140+
1. Click **Save**.
141+
1. If you are using a remote server with OAuth authentication, in the `mcp.json` file, click **Auth** from the CodeLens above the server to authenticate to the server. A pop-up or new window will appear, allowing you to authenticate with your account. The server will only be able to access the scopes you approve, and that your organization policies allow.
142+
1. In the {% data variables.copilot.copilot_chat_short %} window, click the tools icon. You should now see additional tools from the MCP server that you configured.
143+
144+
### Remote server configuration example with OAuth
145+
146+
1. For "Server ID", type `github`.
147+
1. For "Type", select "HTTP/SSE" from the dropdown.
148+
1. For "URL", type `https://api.githubcopilot.com/mcp/`.
149+
1. After clicking **Save**, the configuration in the `mcp.json` file should look like this:
150+
151+
```json copy
152+
{
153+
"servers": {
154+
"github": {
155+
"url": "https://api.githubcopilot.com/mcp/"
156+
}
157+
}
158+
}
159+
```
160+
161+
1. In the `mcp.json` file, click **Auth** from the CodeLens above the server to authenticate to the server. A pop-up will come up allowing you to authenticate with your {% data variables.product.github %} account.
162+
163+
### Local server configuration example
164+
165+
1. For "Server ID", type `github`.
166+
1. For "Type", select "stdio" from the dropdown.
167+
1. For "Command (with optional arguments)", type `docker "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"`
168+
1. Add an environment variable "GITHUB_PERSONAL_ACCESS_TOKEN" set to your {% data variables.product.pat_generic %}.
169+
1. After clicking **Save**, the configuration in the `mcp.json` file should look like this:
170+
171+
```json copy
172+
{
173+
"servers": {
174+
"github": {
175+
"type": "stdio",
176+
"command": "docker",
177+
"args": [
178+
"run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
179+
"ghcr.io/github/github-mcp-server"
180+
],
181+
"env": {
182+
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT"
183+
}
184+
}
185+
}
186+
}
187+
```
188+
189+
For more information on configuring MCP servers in {% data variables.product.prodname_vs %}, see [Use MCP servers in {% data variables.product.prodname_vs %} (Preview)](https://learn.microsoft.com/en-us/visualstudio/ide/mcp-servers?view=vs-2022) in the {% data variables.product.prodname_vs %} documentation.
190+
191+
{% endvisualstudio %}
192+
124193
{% jetbrains %}
125194

126195
## Prerequisites

0 commit comments

Comments
 (0)