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
* First draft
* Second draft
* Availability language
* Added moniker tags for new section
* Made settings instructions more concise
* Removed unused screenshot
* Removed superflous context line 198
---------
Co-authored-by: rosemalcolm_microsoft <115817732+rosemalcolm_microsoft@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/ide/mcp-servers.md
+66-23Lines changed: 66 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
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: 04/29/2026
2
+
title: Use MCP Servers to Extend GitHub Copilot
3
+
description: Learn how to add MCP servers in Visual Studio, configure mcp.json, and manage tool permissions to extend GitHub Copilot agents. Get started.
4
+
ms.date: 05/26/2026
5
5
ms.update-cycle: 180-days
6
6
ms.topic: get-started
7
7
author: RoseHJM
@@ -13,9 +13,9 @@ ai-usage: ai-assisted
13
13
14
14
---
15
15
16
-
# Use MCP servers
16
+
# Use MCP servers in Visual Studio
17
17
18
-
Model Context Protocol (MCP) is an open standard that lets GitHub Copilot use tools and services outside the IDE. In Visual Studio, MCP lets GitHub Copilot agents use external tools by connecting MCP clients to MCP servers that expose important functionality like file access, repo management, or PR creation. By standardizing how tools are discovered and invoked, MCP removes the need for custom integrations and makes it easy to extend AI assistants simply by adding new MCP servers.
18
+
MCP servers use the open Model Context Protocol (MCP) to let GitHub Copilot use tools and services outside the IDE. In Visual Studio, you can add MCP servers to extend agent capabilities for tasks such as file access, repo management, and pull request creation.
19
19
20
20
MCP support enhances GitHub Copilot agent mode by allowing you to connect any MCP-compatible server to your agentic coding workflow. MCP support in Visual Studio works as follows:
21
21
@@ -57,29 +57,29 @@ Try out some popular MCP servers in Visual Studio with one-click:
57
57
-[](https://vs-open.link/mcp-install?%7B%22name%22%3A%22mongodb%22%2C%22gallery%22%3Atrue%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mongodb-mcp-server%22%5D%7D) – Database operations and management. Execute queries, manage collections, aggregation pipelines, and document operations.
58
58
-[](https://vs-open.link/mcp-install?%7B%22name%22%3A%22huggingface%22%2C%22gallery%22%3Atrue%2C%22url%22%3A%22https%3A%2F%2Fhf.co%2Fmcp%22%7D) – Access models, datasets, and Spaces on the Hugging Face Hub.
59
59
60
-
### Add an MCP Server from chat
60
+
### Add an MCP server from chat
61
61
62
62
To add an MCP server from chat view:
63
63
64
64
1. Select the green plus (`+`) button in the tool picker in the chat window.
65
65
66
-
:::image type="content" source="media/vs-2022/mcp-servers/plus-button-add-mcp.png" alt-text="Screenshot the plus button in tool picker of Visual Studio chat to add MCP server." lightbox="media/vs-2022/mcp-servers/configure-server-visual-studio.png":::
66
+
:::image type="content" source="media/vs-2022/mcp-servers/plus-button-add-mcp.png" alt-text="Screenshot of the plus button in the Visual Studio chat tool picker for adding an MCP server." lightbox="media/vs-2022/mcp-servers/configure-server-visual-studio.png":::
67
67
68
68
1. Specify the server name and connection details, such as the URL for HTTP servers or the command and arguments for stdio servers.
69
69
70
-
:::image type="content" source="media/vs-2022/mcp-servers/configure-server-visual-studio.png" alt-text="Screenshot that shows adding an MCP server from the chat view." lightbox="media/vs-2022/mcp-servers/configure-server-visual-studio.png":::
70
+
:::image type="content" source="media/vs-2022/mcp-servers/configure-server-visual-studio.png" alt-text="Screenshot of the chat view for adding an MCP server in Visual Studio." lightbox="media/vs-2022/mcp-servers/configure-server-visual-studio.png":::
71
71
72
72
### Add an MCP server from the GitHub MCP server registry
73
73
74
-
You can install an MCP server directly from the GitHub MCP server registry via Extensions in Visual Studio.
74
+
You can install an MCP server directly from the GitHub MCP server registry via **Extensions** in Visual Studio.
75
75
76
76
1. From the Visual Studio menu, select **Extensions** > **MCP Registries...** to open the **MCP Server Manager**.
77
77
78
-
:::image type="content" source="media/vs-2022/mcp-servers/model-context-protocol-registry.png" alt-text="Screenshot that shows the Extensions menu for MCP Registries." lightbox="media/vs-2022/mcp-servers/model-context-protocol-registry.png":::
78
+
:::image type="content" source="media/vs-2022/mcp-servers/model-context-protocol-registry.png" alt-text="Screenshot of the Extensions menu option for MCP Registries in Visual Studio." lightbox="media/vs-2022/mcp-servers/model-context-protocol-registry.png":::
79
79
80
80
1. Select the server you want, and then select **Install** for your Visual Studio instance.
81
81
82
-
:::image type="content" source="media/vs-2022/mcp-servers/model-context-protocol-server-manager.png" alt-text="Screenshot that shows adding an MCP server from the MCP Server Manager." lightbox="media/vs-2022/mcp-servers/model-context-protocol-server-manager.png":::
82
+
:::image type="content" source="media/vs-2022/mcp-servers/model-context-protocol-server-manager.png" alt-text="Screenshot of the MCP Server Manager for installing an MCP server." lightbox="media/vs-2022/mcp-servers/model-context-protocol-server-manager.png":::
83
83
84
84
### Add an MCP server to the `.mcp.json` file
85
85
@@ -105,23 +105,23 @@ The following steps walk you through a configuration example with the GitHub MCP
105
105
1. In the file, select **Authentication Required** from the CodeLens that appears to authenticate to the server through a GitHub account.
106
106
Select **Authenticate** on the pop-up dialog to authenticate with your GitHub account.
107
107
108
-
:::image type="content" source="media/vs-2022/mcp-servers/codelens-authentication.png" alt-text="Screenshot that shows CodeLens authentication." lightbox="media/vs-2022/mcp-servers/codelens-authentication.png":::
108
+
:::image type="content" source="media/vs-2022/mcp-servers/codelens-authentication.png" alt-text="Screenshot of the CodeLens prompt for MCP server authentication." lightbox="media/vs-2022/mcp-servers/codelens-authentication.png":::
109
109
110
110
If you don't see the CodeLens, ensure it's enabled in **Tools** > **Options** > **Text Editor** > **CodeLens**.
111
111
112
112
1. At the bottom of the chat panel, select **Agent** from the mode dropdown.
113
113
114
-
:::image type="content" source="media/vs-2022/copilot-agent-mode/copilot-agent-dropdown.png" alt-text="Screenshot that shows the Copilot agent mode selector." lightbox="media/vs-2022/copilot-agent-mode/copilot-agent-dropdown.png":::
114
+
:::image type="content" source="media/vs-2022/copilot-agent-mode/copilot-agent-dropdown.png" alt-text="Screenshot of the GitHub Copilot agent mode selector in the chat pane." lightbox="media/vs-2022/copilot-agent-mode/copilot-agent-dropdown.png":::
115
115
116
116
1. Select the tools that you want to use, for example, **List issues**.
117
117
118
-
:::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":::
118
+
:::image type="content" source="media/vs-2022/mcp-servers/model-context-protocol-github-tools-list.png" alt-text="Screenshot of GitHub MCP tools available in the Visual Studio chat pane." lightbox="media/vs-2022/mcp-servers/model-context-protocol-github-tools-list.png":::
119
119
120
120
Try a sample prompt: **List issues assigned to me on GitHub**.
121
121
122
122
1. Copilot asks for permission to use a tool that the MCP server made available to it. Select **Allow** with the scope that you want to proceed with.
123
123
124
-
:::image type="content" source="media/vs-2022/copilot-agent-mode/copilot-agent-tool-approval.png" alt-text="Screenshot that shows confirmation options for agent tools." lightbox="media/vs-2022/copilot-agent-mode/copilot-agent-tool-approval.png":::
124
+
:::image type="content" source="media/vs-2022/copilot-agent-mode/copilot-agent-tool-approval.png" alt-text="Screenshot of confirmation options for GitHub Copilot agent tools." lightbox="media/vs-2022/copilot-agent-mode/copilot-agent-tool-approval.png":::
125
125
126
126
## Manage configuration of MCP servers
127
127
@@ -157,21 +157,21 @@ It's common to invoke tools through package managers. For example, use `npx -y @
157
157
158
158
The format must follow the MCP specification. For example, it must include an array of server objects, each with `name`, `command` or `url`, and `transport`.
159
159
160
-
### Editing MCP configuration
160
+
### Edit MCP configuration
161
161
162
162
If you have an existing `mcp.json` file and you check the file into your version control system, add the file location to **Solution Items** in Solution Explorer.
163
163
164
164
When you save the file with valid syntax, the GitHub Copilot agent restarts and reloads the configured servers.
165
165
166
166
:::moniker range="visualstudio"
167
167
168
-
:::image type="content" source="media/visualstudio/model-context-protocol-add-solution-item.png" alt-text="Screenshot that shows how to add the MCP configuration file location to Solution Items." lightbox="media/visualstudio/model-context-protocol-add-solution-item.png":::
168
+
:::image type="content" source="media/visualstudio/model-context-protocol-add-solution-item.png" alt-text="Screenshot of adding the MCP configuration file location to Solution Items." lightbox="media/visualstudio/model-context-protocol-add-solution-item.png":::
169
169
170
170
:::moniker-end
171
171
172
172
:::moniker range="<=vs-2022"
173
173
174
-
:::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":::
174
+
:::image type="content" source="media/vs-2022/mcp-servers/model-context-protocol-add-solution-item.png" alt-text="Screenshot of the MCP configuration file location added to Solution Items." lightbox="media/vs-2022/mcp-servers/model-context-protocol-add-solution-item.png":::
175
175
176
176
:::moniker-end
177
177
@@ -186,39 +186,82 @@ As soon as Visual Studio discovers or adds a server:
186
186
- If you remove a server, Visual Studio immediately stops its process and withdraws all its tools from the UI.
187
187
- If you edit a server definition, Visual Studio terminates and restarts it, and then re-queries.
188
188
189
-
### Management of tool approvals
189
+
:::moniker range="visualstudio"
190
+
191
+
## MCP server trust dialog
192
+
193
+
> [!NOTE]
194
+
> MCP server trust is available in Visual Studio 2026 version 18.7 and later.
195
+
196
+
Visual Studio asks you to trust an MCP server again when the server has changed since the last time you used it. This prompt helps you decide whether to run the updated server.
197
+
198
+
### What to do when you're prompted
199
+
200
+
When the trust dialog appears, review the change and choose the action that matches your intent:
201
+
202
+
- **Accept** to run this updated version now.
203
+
- **Always Trust** to stop future trust prompts for this server.
204
+
- **Reject** to stop startup because you don't want to run the updated server.
205
+
206
+
If you choose **Reject**, Visual Studio doesn't start the server and asks again the next time you try to activate it.
207
+
208
+
### When you'll see the trust dialog
209
+
210
+
You'll be prompted when Visual Studio detects changes to either of these:
211
+
212
+
- Server configuration details, such as transport type, URL, command, or arguments.
213
+
- Server capabilities, such as tools, prompts, resources, resource templates, or instructions.
214
+
215
+
### When you won't see the trust dialog
216
+
217
+
Visual Studio skips the prompt when:
218
+
219
+
- The server is built in and shipped with the extension.
220
+
- Organization policy is set to `RegistryOnly`.
221
+
- You already selected **Always Trust** for that server.
222
+
- It's the first time the server is seen. Visual Studio saves an initial trust baseline automatically.
223
+
224
+
### Turn trust prompts on or off for updated MCP servers
225
+
226
+
To control whether Visual Studio prompts before running tools from an updated MCP server, go to **Tools** > **Options** > **GitHub** > **Copilot** and in **Copilot Chat** select or clear **Show trust dialog before running tools from an updated MCP server**.
227
+
228
+
If you don't see this setting, update to Visual Studio 2026 version 18.7 or later.
229
+
230
+
:::moniker-end
231
+
232
+
## Management of tool approvals
190
233
191
234
When you invoke a tool, Copilot requests confirmation to run the tool. The reason is that tools might run locally on your machine and perform actions that modify files or data.
192
235
193
236
:::moniker range="visualstudio"
194
237
195
238
After a tool invocation, on the chat pane, use the **Confirm** dropdown options. You can automatically confirm the specific tool for the current session, the current solution, or all future invocations.
196
239
197
-
:::image type="content" source="media/visualstudio/copilot-agent-tool-approval.png" alt-text="Screenshot that shows how to manage agent tool approvals." lightbox="media/visualstudio/copilot-agent-tool-approval.png":::
240
+
:::image type="content" source="media/visualstudio/copilot-agent-tool-approval.png" alt-text="Screenshot of the chat pane options for managing agent tool approvals." lightbox="media/visualstudio/copilot-agent-tool-approval.png":::
198
241
199
242
:::moniker-end
200
243
201
244
:::moniker range="<=vs-2022"
202
245
203
246
After a tool invocation, on the chat pane, use the **Allow** dropdown options. You can automatically confirm the specific tool for the current session, the current solution, or all future invocations.
:::image type="content" source="media/vs-2022/copilot-agent-mode/copilot-agent-tool-approval.png" alt-text="Screenshot of agent tool approval options in the Visual Studio chat pane." lightbox="media/vs-2022/copilot-agent-mode/copilot-agent-tool-approval.png":::
206
249
207
250
:::moniker-end
208
251
209
252
:::moniker range="visualstudio"
210
253
211
254
You can reset tool confirmation selections in the **Tools** > **Options** dialog, in the **All Settings** > **GitHub** > **Copilot** > **Tools** section.
:::image type="content" source="media/visualstudio/copilot-agent-tool-config.png" alt-text="Screenshot of GitHub Copilot tool configuration settings in Visual Studio." lightbox="media/visualstudio/copilot-agent-tool-config.png":::
214
257
215
258
:::moniker-end
216
259
217
260
:::moniker range="<=vs-2022"
218
261
219
262
You can reset tool confirmation selections in the **Tools** > **Options** dialog, under the **GitHub** > **Copilot** section in the **Tools** group.
220
263
221
-
:::image type="content" source="media/vs-2022/copilot-agent-mode/copilot-agent-tool-config.png" alt-text="Screenshot that shows tool configuration settings." lightbox="media/vs-2022/copilot-agent-mode/copilot-agent-tool-config.png":::
264
+
:::image type="content" source="media/vs-2022/copilot-agent-mode/copilot-agent-tool-config.png" alt-text="Screenshot of tool configuration settings for GitHub Copilot in Visual Studio." lightbox="media/vs-2022/copilot-agent-mode/copilot-agent-tool-config.png":::
0 commit comments