Skip to content

Commit 4005179

Browse files
committed
Merged main into live
2 parents e5a7a1e + dbb35b1 commit 4005179

File tree

5 files changed

+193
-26
lines changed

5 files changed

+193
-26
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: 'Using AI models in Copilot Chat'
3+
description: Learn how to use built-in models or bring your own model (BYOM) in GitHub Copilot Chat for Visual Studio.
4+
ms.date: 8/19/2025
5+
ms.update-cycle: 180-days
6+
ms.topic: get-started
7+
author: anandmeg
8+
ms.author: meghaanand
9+
ms.manager: mijacobs
10+
ms.subservice: ai-tools
11+
ms.collection: ce-skilling-ai-copilot
12+
monikerRange: '>= vs-2022'
13+
---
14+
# Using AI models in Copilot Chat
15+
16+
With Visual Studio 17.14, Copilot in Visual Studio uses **GPT-4.1** as the default model (previously GPT-4o). GPT-4.1 provides faster response times, higher quality suggestions, and improved efficiency for coding tasks.
17+
18+
However, you are not limited to using this model. You can also select from additional models or add your own, allowing you to choose the model that best fits your workflow requirements.
19+
20+
## Available models
21+
22+
Choose from an expanded set of models in the model picker:
23+
24+
- Claude Sonnet 4
25+
- Claude Opus 4
26+
- GPT-5
27+
- Claude Sonnet 3.5
28+
- Claude 3.7 (thinking and non-thinking)
29+
- OpenAI o3-mini
30+
- Gemini 2.0 Flash
31+
- Gemini 2.5 Pro
32+
33+
**Model selection improvements**
34+
35+
- **Persistent selection**: The model you choose remains selected across chat threads.
36+
- **Enable models directly**: If a model is available in your plan but not yet enabled, you’ll see a prompt in the model picker to activate it.
37+
38+
> Model availability depends on your Copilot subscription and the current status of each model. For Copilot Enterprise and Business, administrators must enable the **Preview** policy in Copilot settings before models are available in Visual Studio.
39+
40+
## Bring your own model (BYOM)
41+
42+
You can add your own language model to Copilot Chat by providing API keys from providers such as Anthropic, Google, or OpenAI. This allows you to select and configure custom AI models to match your workflow or to evaluate new model capabilities.
43+
44+
### Benefits
45+
46+
Using your own model enables you to:
47+
48+
- Expand model selection beyond built-in options, including new or experimental models.
49+
- Meet infrastructure, security, or performance requirements with models that align to your needs.
50+
- Control and monitor API usage directly with your chosen provider.
51+
- Switch models easily between built-in and custom options.
52+
53+
### Get started
54+
55+
To add an API key:
56+
57+
1. In the bottom right of the chat view, select the **model picker** dropdown.
58+
1. Select your provider (currently supported: **OpenAI**, **Anthropic**, and **Google**; additional providers may be added in future releases).
59+
1. Enter your **API key**.
60+
1. Select:
61+
- Any standard model listed, or
62+
- Any supported model offered by your provider, even if it doesn't appear in the default list.
63+
1. Once added, the custom model appears in the model picker.
64+
1. Start prompting in chat. Chat uses the custom model.
65+
66+
### Limitations and considerations
67+
68+
- Custom model support is limited to the Chat experience in Visual Studio and does not affect code completions or other AI-assisted features, such as commit message generation.
69+
- Model capabilities depend on the provider; some models may not support features such as tool use, vision inputs, or advanced reasoning.
70+
- Services like embeddings, intent detection, and repository indexing may continue to use the Copilot API.
71+
- When using a custom model, output is returned directly from the provider and may bypass Copilot’s responsible AI filtering.
72+
- Custom model support is **not** available for Copilot Business or Enterprise users.
73+
74+
## Related content
75+
76+
- [Choosing the right AI model for your task](https://docs.github.com/en/copilot/using-github-copilot/ai-models/choosing-the-right-ai-model-for-your-task)
77+
- [About premium requests](https://docs.github.com/copilot/managing-copilot/monitoring-usage-and-entitlements/about-premium-requests#premium-requests)
78+
- [About Copilot billing](https://docs.github.com/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/billing-and-payments/about-billing-for-individual-copilot-plans)
79+
- [GitHub support](https://support.github.com/)
80+
- [Manage Copilot usage and models](copilot-usage-and-models.md)

docs/ide/copilot-usage-and-models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 'GitHub Copilot usage and models'
33
description: Learn how to manage your GitHub Copilot usage and models directly within Visual Studio.
4-
ms.date: 6/4/2025
4+
ms.date: 8/19/2025
55
ms.update-cycle: 180-days
66
ms.topic: overview
77
author: anandmeg

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

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@
157157
href: ide/mcp-servers.md
158158
- name: Copilot Edits
159159
href: ide/copilot-edits.md
160+
- name: AI models for chat
161+
href: ide/copilot-select-add-models.md
160162
- name: Chat context
161163
items:
162164
- name: Customize responses

0 commit comments

Comments
 (0)