Skip to main content
Glama
mcp_vscode.md8.62 kB
Extending GitHub Copilot Chat with the Model Context Protocol (MCP) Learn how to use the Model Context Protocol (MCP) to extend Copilot Chat. Tool navigation Eclipse JetBrains IDEs Visual Studio Visual Studio Code Xcode In this article Introduction 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 About Model Context Protocol (MCP). For information on currently available MCP servers, see the MCP servers repository. Enterprises and organizations can choose to enable or disable use of MCP for members of their organization or enterprise with the MCP servers in Copilot policy. The policy is disabled by default. See Managing policies and features for GitHub Copilot in your enterprise and Managing policies and features for GitHub Copilot in your organization. The MCP policy only applies to users who have a Copilot Business or Copilot Enterprise subscription from an organization or enterprise that configures the policy. Copilot Free, Copilot Pro, or Copilot Pro+ do not have their MCP access governed by this policy. Prerequisites Access to Copilot. See What is GitHub Copilot?. Visual Studio Code version 1.99 or later. For information on installing Visual Studio Code, see the Visual Studio Code download page. If you are a member of an organization or enterprise with a Copilot Business or Copilot Enterprise plan, the "MCP servers in Copilot" policy must be enabled in order to use MCP with Copilot. Configuring MCP servers in Visual Studio Code MCP servers can be configured manually in a configuration file, or through the GitHub MCP Registry. The GitHub MCP Registry provides a curated list of MCP servers that you can easily add to your Visual Studio Code instance. Using the GitHub MCP Registry Note The GitHub MCP Registry is in public preview and may change. Only MCP servers listed in the GitHub MCP Registry can be added through the registry. Other servers can be configured manually. See Configuring MCP servers manually. Visit the GitHub MCP Registry. In the search bar, search for the MCP server you want to add, then click the MCP server in the list of matches. On the MCP server page, read the description for details on installation requirements and other important usage information. This may vary between servers. Click Install server, then select Install in VS Code. Visual Studio Code will open, on the server's Marketplace page. Click Install to add the MCP server to your Visual Studio Code instance. If further configuration is required, follow the instructions on the MCP server page in the GitHub MCP Registry. To check that the MCP server has been added, in the agent mode of Copilot Chat, click the tools icon. A dropdown list will appear, showing all the MCP servers and associated tools that are currently available in your Visual Studio Code instance. Configuring MCP servers manually To configure MCP servers in Visual Studio Code, you need to set up a configuration script that specifies the details of the MCP servers you want to use. You can configure MCP servers for either: A specific repository. This enables you to share MCP servers with anyone who opens the project in Visual Studio Code. To do this, create a .vscode/mcp.json file in the root of your repository. Your personal instance of Visual Studio Code. You will be the only person who has access to configured MCP servers. To do this, add the configuration to your settings.json file in Visual Studio Code. MCP servers configured this way will be available in all workspaces. Note We recommend you use only one location per server. Adding the same server to both locations may cause conflicts and unexpected behavior. The steps below show how to configure the Fetch MCP server in your .vscode/mcp.json file. The Fetch MCP server is a simple MCP server that provides web content fetching capabilities. For more information on the Fetch MCP server, see the Fetch directory in the MCP Server repository. You can use the same steps to configure MCP servers in your personal Visual Studio Code settings. Details on how to configure other MCP servers are available in the MCP servers repository. For information on configuring the GitHub MCP server, see Using the GitHub MCP Server. Add the following configuration to your .vscode/mcp.json file: JSON { "inputs": [ // The "inputs" section defines the inputs required for the MCP server configuration. { "type": "promptString" } ], "servers": { // The "servers" section defines the MCP servers you want to use. "fetch": { "command": "uvx", "args": ["mcp-server-fetch"] } } } Save the .vscode/mcp.json file. A "Start" button will appear in your .vscode/mcp.json file, at the top of the list of servers. Click the "Start" button to start the MCP servers. This will trigger the input dialog and discover the server tools, which are then stored for later sessions. Screenshot of MCP server configuration in Visual Studio Code. The "Start" button is outlined in dark orange. Open Copilot Chat by clicking the icon in the title bar of Visual Studio Code. In the Copilot Chat box, select Agent from the popup menu. Screenshot of the Copilot Chat box in Visual Studio Code. The "Agent" option is outlined in dark orange. To view your list of available MCP servers, click the tools icon in the top left corner of the chat box. This will open the MCP server list, where you can see all the MCP servers and associated tools that are currently available in your Visual Studio Code instance. Optionally, you can define toolsets, groups of related tools that you can reference in chat. Toolsets make it easier to group related MCP tools together and quickly enable or disable them. For information on how to define and use a toolset, see the VS Code docs. For more information on configuring MCP servers in Visual Studio Code, see Use MCP servers in Visual Studio Code in the Visual Studio Code documentation. Using MCP servers in Copilot Chat Once you have configured your MCP servers, you can use them in Copilot Chat to access a wide range of tools and services. In the example below, we will use the Fetch MCP server to fetch details about a web page. Open Copilot Chat by clicking the icon in the title bar of Visual Studio Code. In the Copilot Chat box, select Agent from the popup menu. In the file with the MCP configuration, check that the MCP server is running. If it is not running, click the "Start" button to start the MCP server. Screenshot of the MCP server configuration in Visual Studio Code. The "Running" status is outlined in dark orange. Ask Copilot Chat to fetch the details of a URL. For example: Fetch https://github.com/github/docs. If Copilot asks you to confirm that you want to proceed, click Continue. Copilot will fetch the details of the URL and display them in the chat box. Optionally, you can use MCP prompts and resources in VS Code. MCP servers can define preconfigured prompts for interacting with their tools. You can access these prompts in chat with slash commands, using the format /mcp.servername.promptname. MCP servers provide resources, which are any kind of data that the server wants to make available. For example, the GitHub MCP server provides repository content as a resource. To add resources from an MCP server to your chat context, click Add Context... in the chat box, then click MCP Resources. For more information on using MCP servers in Visual Studio Code, see Use MCP servers in Visual Studio Code in the Visual Studio Code documentation. Using existing MCP configurations If you already have an MCP configuration in Claude Desktop, you can use that configuration in Visual Studio Code to access the same MCP servers. To do this, add the following configuration to your settings.json file in Visual Studio Code: JSON "chat.mcp.discovery.enabled": true Visual Studio Code will automatically find your existing configuration and use it in your Visual Studio Code instance. Creating a new MCP server You can create a new MCP server to fulfill your specific needs, and then integrate it with Copilot Chat. For example, you can create an MCP server that connects to a database or a web service, and then use that server in Copilot Chat to perform tasks on that database or web service. For more information on creating and configuring your own MCP servers, see the official MCP documentation. Further reading Extending GitHub Copilot coding agent with the Model Context Protocol (MCP) Using the GitHub MCP Server Enhancing GitHub Copilot agent mode with MCP

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ElSrJuez/tinydb-emcipi'

If you have feedback or need assistance with the MCP directory API, please join our Discord server