Skip to content

Commit 2d7ce4f

Browse files
authored
Merge pull request #14208 from anandmeg/mcp-updates
MCP GA updates
2 parents ce0fbd1 + a84df10 commit 2d7ce4f

File tree

2 files changed

+110
-25
lines changed

2 files changed

+110
-25
lines changed

docs/ide/mcp-servers.md

Lines changed: 110 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: 'Use MCP servers (Preview)'
3-
description: Adding MCP servers in Visual Studio to extend GitHub Copilot agent capabilities, setting up mcp.json and managing tool permissions.
4-
ms.date: 6/18/2025
2+
title: 'Use MCP servers'
3+
description: Learn how to add MCP servers in Visual Studio to extend GitHub Copilot agent capabilities, set up mcp.json, and manage tool permissions.
4+
ms.date: 8/19/2025
55
ms.update-cycle: 180-days
66
ms.topic: get-started
77
author: anandmeg
@@ -11,22 +11,23 @@ ms.subservice: ai-tools
1111
ms.collection: ce-skilling-ai-copilot
1212
monikerRange: '>= vs-2022'
1313
---
14-
# Use MCP servers (Preview)
14+
# Use MCP servers
1515

1616
Model Context Protocol (MCP) is an open standard that enables AI models to interact with external tools and services through a unified interface. In Visual Studio, MCP support enhances GitHub Copilot's agent mode by allowing you to connect any MCP-compatible server to your agentic coding workflow. This article guides you through setting up MCP servers and using tools with agent mode in Visual Studio.
1717

1818
## Prerequisites
19-
+ [Visual Studio 2022 version 17.14](/visualstudio/releases/2022/release-history) or later. The latest servicing release of 17.14 is highly recommended as MCP features are actively being added with each release.
19+
+ [Visual Studio 2022 version 17.14](/visualstudio/releases/2022/release-history) or later.
20+
The latest servicing release of 17.14 is highly recommended as MCP features are actively being added with each release.
2021

2122
## How do MCP and Visual Studio extend GitHub Copilot's agent?
2223

23-
* MCP clients, such as Visual Studio connect to MCP servers and request actions on behalf of the AI model
24+
* MCP clients, such as Visual Studio connect to MCP servers and request actions on behalf of the AI model.
2425
* MCP servers provide one or more tools that expose specific functionalities through a well-defined interface.
25-
* The Model Context Protocol (MCP) defines the message format for communication between clients and servers, including tool discovery, invocation, and response handling
26+
* The Model Context Protocol (MCP) defines the message format for communication between clients and servers, including tool discovery, invocation, and response handling.
2627

2728
For example, a file system MCP server might provide tools for reading, writing, or searching files and directories. [GitHub's official MCP server](https://github.com/github/github-mcp-server) offers tools to list repositories, create pull requests, or manage issues. MCP servers can run locally on your machine or be hosted remotely, and Visual Studio supports both configurations.
2829

29-
By standardizing this interaction, MCP eliminates the need for custom integrations between each AI model and each tool. This allows you to extend your AI assistant's capabilities by simply adding new MCP servers to your workspace. Learn more about the Model Context Protocol specification.
30+
By standardizing this interaction, MCP eliminates the need for custom integrations between each AI model and each tool. This allows you to extend your AI assistant's capabilities by simply adding new MCP servers to your workspace. Learn more about the [Model Context Protocol specification](https://modelcontextprotocol.io/specification/draft).
3031

3132
## Configuration example with GitHub MCP server
3233

@@ -35,46 +36,122 @@ The following walkthrough requires 17.14.9 or later.
3536
1. Create a new file: `<SOLUTIONDIR>\.mcp.json` or `%USERPROFILE%\.mcp.json`. Using Visual Studio to edit this file is recommended so its JSON schema is automatically applied.
3637
2. Paste the following contents into the `.mcp.json` file
3738

38-
```json
39-
{
40-
"servers": {
41-
"github": {
42-
"url": "https://api.githubcopilot.com/mcp/"
39+
```json
40+
{
41+
"servers": {
42+
"github": {
43+
"url": "https://api.githubcopilot.com/mcp/"
44+
}
4345
}
4446
}
45-
}
46-
```
47+
```
4748

4849
3. Save the file, then activate the CodeLens that appears over the new server to authenticate to this server using a GitHub account.
4950

50-
5. In Visual Studio, click the `Ask` dropdown in the GitHub Copilot Chat window, and then select `Agent`.
51+
4. In Visual Studio, click the `Ask` dropdown in the GitHub Copilot Chat window, and then select `Agent`.
5152

5253
:::image type="content" source="media/vs-2022/copilot-agent-mode/copilot-agent-dropdown.png" alt-text="Screenshot that shows Copilot agent mode selector." lightbox="media/vs-2022/copilot-agent-mode/copilot-agent-dropdown.png":::
5354

54-
7. Select the tools you'd like to use, for example, `list_issues`
55+
5. Select the tools you'd like to use, for example, `list_issues`
5556

5657
:::image type="content" source="media/vs-2022/mcp-servers/model-context-protocol-github-tools-list.png" alt-text="Screenshot that shows MCP GitHub tools." lightbox="media/vs-2022/mcp-servers/model-context-protocol-github-tools-list.png":::
5758

58-
8. Try a sample prompt: `list issues assigned to me on GitHub`
59-
9. Copilot asks for permission to use a tool made available to it by the MCP server, select **Allow** with the scope you wish to proceed with.
59+
6. Try a sample prompt: `list issues assigned to me on GitHub`
60+
7. Copilot asks for permission to use a tool made available to it by the MCP server, select **Allow** with the scope you wish to proceed with.
6061

6162
:::image type="content" source="media/vs-2022/copilot-agent-mode/copilot-agent-tool-approval.png" alt-text="Screenshot that shows the agent tools confirmation options." lightbox="media/vs-2022/copilot-agent-mode/copilot-agent-tool-approval.png":::
6263

6364
## Supported MCP capabilities
6465

65-
Visual Studio supports local standard input/output (`stdio`), server-sent events (`sse`), and streamable HTTP (`http`) for MCP server transport. Currently of the three [primitives](https://modelcontextprotocol.io/specification/2025-03-26#features) (tools, prompts, resources), servers can only provide tools to Copilot's agent mode. The list and descriptions of tools can be updated dynamically using list changed events. Visual Studio provides servers with the current solution folders using `roots` [(spec)](https://modelcontextprotocol.io/docs/concepts/roots).
66+
Visual Studio supports the following MCP capabilities:
67+
68+
- MCP Server transport: Local standard input/output (`stdio`), server-sent events (`sse`), and streamable HTTP (`http`).
69+
- MCP features: Currently of the three [primitives](https://modelcontextprotocol.io/specification/2025-03-26#features) (tools, prompts, resources), servers can only provide tools to Copilot's agent mode. The list and descriptions of tools can be updated dynamically using list changed events.
70+
- Visual Studio provides servers with the current solution folders using `roots` [(spec)](https://modelcontextprotocol.io/docs/concepts/roots).
71+
- [MCP authorization](https://modelcontextprotocol.io/specification/draft/basic/authorization): Visual Studio supports authentication for remote servers with any OAuth provider.
6672

6773
## Finding MCP servers
6874

6975
MCP's [official server repository](https://github.com/modelcontextprotocol/servers) is a great starting point for reference, official, and community-contributed servers that showcase MCP's versatility. You can explore servers for various functionalities, such as file system operations, database interactions, and web services.
7076

7177
MCP is still a relatively new standard, and the ecosystem is rapidly evolving. As more developers adopt MCP, you can expect to see an increasing number of servers and tools available for integration with your projects.
7278

73-
## Adding an MCP server
79+
## Add an MCP server
80+
81+
You have multiple options to add an MCP server in Visual Studio:
82+
83+
### One-click install from the web
84+
85+
With the latest servicing release of 17.14, Visual Studio now supports direct installation of MCP Servers. You can click the **Install** button on an MCP server to automatically add it to your Visual Studio instance.
86+
87+
</br>
88+
<details>
89+
<summary><strong title="To add a one-click install button for any MCP server in Visual Studio:">Add one-click install button for MCP server</strong></summary>
90+
91+
1. Write your MCP server config in JSON.
92+
- **HTTP/SSE server example**
93+
94+
```json
95+
{"name":"My Server","type":"http","url":"https://example.com/mcp/"}
96+
```
97+
98+
- **stdio server example**
99+
100+
```json
101+
{"name":"My Server","type":"stdio","command":"python","args":["-m","my_mcp.server"]}
102+
```
103+
104+
Required fields:
105+
106+
| **Field** | **Description** |
107+
|-----------|---------------|
108+
| `name` | Friendly name for your server |
109+
| `type` | Server connection type, for example, "http" or "stdio" |
110+
| `url` | URL of the server, required for "http"|
111+
| `command` | Command to start the server executable, required for "stdio" |
112+
| `args` |Array of arguments passed to the command, required for "stdio" |
113+
114+
2. URL-encode the JSON, you can use an online encoder or your browser console.
115+
116+
Browser console example:
117+
118+
```js
119+
encodeURIComponent('{"name":"My Server","type":"http","url":"https://example.com/mcp/"}')
120+
```
121+
122+
3. Insert the URL-encoded JSON into the MCP URI format to form a Visual Studio install link.
123+
124+
Format:
125+
126+
```bash
127+
vsweb+mcp:/install?<ENCODED_JSON>
128+
```
129+
130+
4. Add the markdown badge to your GitHub repo/docs.
131+
132+
Example:
133+
134+
```markdown
135+
[![Install MCP Server in Visual Studio](https://img.shields.io/badge/Install%20in%20Visual%20Studio-blue?logo=visualstudio)](vsweb+mcp:/install?<ENCODED_JSON>)
136+
```
137+
138+
When a user clicks the badge, Visual Studio will launch (or prompt to open), and the MCP install dialog will appear, pre-filled with your server details.
139+
140+
<br />
141+
</details>
142+
143+
### Add from chat view
144+
145+
To add an MCP server in Visual Studio:
146+
147+
1. Select the green plus (`+`) button in the tool picker in the chat window.
148+
1. Specify the server name and connection details, such as the URL for HTTP servers or the command and arguments for stdio servers.
149+
150+
:::image type="content" source="media/vs-2022/mcp-servers/configure-server-visual-studio.png" alt-text="Screenshot that shows adding an MCP server from chat view." lightbox="media/vs-2022/mcp-servers/configure-server-visual-studio.png":::
74151

75152
### Create a file to manage configuration of MCP servers
76153

77-
If you do not already have an `mcp.json` file, you can create it in various locations depending on the repos, users, and IDEs you would like the servers to be available/used for.
154+
If you do not already have an `mcp.json` file, create one in any of the supported locations based on your repository, user, or IDE requirements. To add an MCP server, locate the server’s JSON configuration online (for example, from the GitHub MCP servers repository) and paste it into your `mcp.json` file.
78155

79156
### File locations for automatic discovery of MCP configuration
80157

@@ -94,7 +171,7 @@ MCP server configurations are read from the following directories, in the follow
94171
95172
Some of these locations require `.mcp.json` while others require `mcp.json`.
96173
97-
### MCP configuration format
174+
## MCP configuration format
98175
99176
You may define both **remote** (URL and credentials) and **local** (command-line invocation) servers.
100177
@@ -110,7 +187,7 @@ When the file is saved with valid syntax, GitHub Copilot's agent restarts and re
110187
111188
:::image type="content" source="media/vs-2022/mcp-servers/model-context-protocol-add-solution-item.png" alt-text="Screenshot that shows adding the MCP configuration file location to Solution Items." lightbox="media/vs-2022/mcp-servers/model-context-protocol-add-solution-item.png":::
112189
113-
### Tool Lifecycle
190+
### Tool lifecycle
114191
115192
As soon as a server is discovered or added:
116193
@@ -133,11 +210,19 @@ You can reset tool confirmation selections in **Tools** > **Options** > **GitHub
133210
134211
:::image type="content" source="media/vs-2022/copilot-agent-mode/copilot-agent-tool-config.png" alt-text="Screenshot that shows the tools configuration setting." lightbox="media/vs-2022/copilot-agent-mode/copilot-agent-tool-config.png":::
135212
213+
## Manage authorization
214+
215+
Visual Studio now supports authentication for remote servers with any OAuth provider, per [MCP authorization spec](https://modelcontextprotocol.io/specification/draft/basic/authorization), in addition to integration with the Visual Studio keychain.
216+
217+
To manage authentication for an MCP server:
218+
- Select **Manage Authentication** for that server from CodeLens in the `.mcp.json` file.
219+
- Provide credentials for the necessary OAuth provider for that server in the browser pop-up.
220+
136221
## Frequently asked questions
137222
138223
#### As an administrator, how do I control use of MCP servers in agent mode for Visual Studio users?
139224
140-
Agent mode and MCP usage in Visual Studio are governed by the **Editor preview features** flag in the GitHub Copilot dashboard for administrators.
225+
Agent mode and MCP usage in Visual Studio are governed by the GitHub policy settings in the GitHub Copilot dashboard for administrators.
141226
If the administrator turns off this setting, users under that subscription won’t be able to use agent mode or connect to MCP servers in Visual Studio.
142227
143228
For more information, see [managing policies and features for copilot in your enterprise](https://docs.github.com/en/enterprise-cloud@latest/copilot/managing-copilot/managing-copilot-for-your-enterprise/managing-policies-and-features-for-copilot-in-your-enterprise#editor-preview-features).
29.2 KB
Loading

0 commit comments

Comments
 (0)