Skip to content

Commit 9dd70ea

Browse files
committed
Restructure adding MCP servers
1 parent 71e8cf4 commit 9dd70ea

File tree

1 file changed

+49
-9
lines changed

1 file changed

+49
-9
lines changed

docs/copilot/chat/mcp-servers.md

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,31 @@ MCP is still a relatively new standard, and the ecosystem is rapidly evolving. A
3838

3939
## Add an MCP server
4040

41-
To add an MCP server to your workspace, follow these steps (see below for how to add a server to your user settings):
41+
You have multiple options to add an MCP server in VS Code:
4242

43-
1. Configure an MCP server in the `.vscode/mcp.json` file in your workspace to share configurations with project collaborators. Make sure to avoid hardcoding sensitive information like API keys and other credentials by using input variables or environment files.
43+
- **Workspace settings**: add a `.vscode/mcp.json` file in your workspace to configure MCP servers for a workspace and share configurations with team members.
44+
- **User settings**: specify the server in your user settings to enable the MCP server across all workspaces.
45+
- **Automatic discovery**: enable auto-discovery of MCP servers defined in other tools, such as Claude Desktop.
4446

45-
Create a `.vscode/mcp.json` file in your workspace and select the **Add Server** button to add a template for a new server. VS Code provides IntelliSense for the MCP server configuration file.
47+
> [!CAUTION]
48+
> MCP servers can run arbitrary code on your machine. Only add servers from trusted sources, and review the publisher and server configuration before starting it.
4649
47-
Alternatively, run the **MCP: Add Server** command from the Command Palette and provide the server information to add a new MCP server configuration. Choose **Workspace Settings** to create the `.vscode/mcp.json` file in your workspace if it doesn't already exist.
50+
To view and manage the list of configured MCP servers, run the **MCP: List Servers** command from the Command Palette.
51+
52+
After you add an MCP server, you can [use the tools it provides in agent mode](#use-mcp-tools-in-agent-mode).
53+
54+
### Add an MCP server to your workspace
55+
56+
To configure an MCP server for a specific workspace, you can create a `.vscode/mcp.json` file in your workspace folder. This allows you to share the server configuration with project team members.
57+
58+
> [!IMPORTANT]
59+
> Make sure to avoid hardcoding sensitive information like API keys and other credentials by using input variables or environment files.
60+
61+
To add an MCP server to your workspace:
62+
63+
1. Create a `.vscode/mcp.json` file in your workspace.
64+
65+
1. Select the **Add Server** button to add a template for a new server. VS Code provides IntelliSense for the MCP server configuration file.
4866

4967
The following example shows how to configure a [Perplexity MCP server](https://github.com/ppl-ai/modelcontextprotocol/), where VS Code prompts you for the API key when the server starts. Learn more about the [Configuration format](#configuration-format).
5068

@@ -76,14 +94,36 @@ To add an MCP server to your workspace, follow these steps (see below for how to
7694
}
7795
```
7896

79-
1. Optionally, specify the server in the `setting(mcp)` VS Code [user settings](/docs/getstarted/personalize-vscode.md#configure-settings) to enable the MCP server across all workspaces.
97+
1. Alternatively, run the **MCP: Add Server** command from the Command Palette, choose the type of MCP server to add and provide the server information. Next, select **Workspace Settings** to create the `.vscode/mcp.json` file in your workspace if it doesn't already exist.
8098

81-
If you use the **MCP: Add Server** command from the Command Palette, choose **User Settings** to add a new MCP server configuration in user settings.
99+
### Add an MCP server to your user settings
82100

83-
1. VS Code can automatically detect and reuse MCP servers that you defined in other tools, such as Claude Desktop.
84-
Enable auto-discovery with the `setting(chat.mcp.discovery.enabled)` setting.
101+
To configure an MCP server for all your workspaces, you can add the server configuration to your user settings. This allows you to reuse the same server configuration across multiple projects.
102+
103+
Specify the server in the `setting(mcp)` VS Code [user settings](/docs/getstarted/personalize-vscode.md#configure-settings) to enable the MCP server across all workspaces.
104+
105+
```json
106+
// settings.json
107+
{
108+
"mcp": {
109+
"servers": {
110+
"my-mcp-server": {
111+
"type": "stdio",
112+
"command": "my-command",
113+
"args": []
114+
}
115+
}
116+
},
117+
}
118+
```
119+
120+
Alternatively, use the **MCP: Add Server** command from the Command Palette, provide the server information, and then select **User Settings** to add the server configuration to your user settings.
121+
122+
### Automatic discovery of MCP servers
85123

86-
1. Run the **MCP: List Servers** command from the Command Palette to view and manage the configured MCP servers.
124+
VS Code can automatically detect and reuse MCP servers that you defined in other tools, such as Claude Desktop.
125+
126+
Enable auto-discovery with the `setting(chat.mcp.discovery.enabled)` setting.
87127

88128
## Configuration format
89129

0 commit comments

Comments
 (0)