1
0
mirror of synced 2025-12-19 09:57:42 -05:00
Files
docs/content/copilot/customizing-copilot/using-model-context-protocol/extending-copilot-chat-with-mcp.md
Jules 6dc3535774 Remote GitHub MCP server (#55768)
Co-authored-by: Jules Porter <jules-p@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Adam Holt <omgitsads@github.com>
Co-authored-by: Sarita Iyer <66540150+saritai@users.noreply.github.com>
Co-authored-by: Sam Morrow <sammorrowdrums@github.com>
2025-06-12 16:21:46 +00:00

12 KiB

title, allowTitleToDifferFromFilename, shortTitle, intro, versions, topics, type, redirect_from
title allowTitleToDifferFromFilename shortTitle intro versions topics type redirect_from
Extending Copilot Chat with the Model Context Protocol (MCP) true Extend Copilot Chat with MCP Learn how to use the Model Context Protocol (MCP) to extend {% data variables.copilot.copilot_chat_short %}.
feature
copilot
Copilot
how_to
/copilot/customizing-copilot/extending-copilot-chat-with-mcp

Note

  • MCP support is currently in {% data variables.release-phases.public_preview %} and subject to change.
  • MCP support is available in {% data variables.copilot.copilot_chat_short %} for {% data variables.product.prodname_vscode %}, JetBrains, Eclipse, and Xcode.
  • The AUTOTITLE apply to your use of this product.

{% vscode %}

Overview

The Model Context Protocol (MCP) is an open standard that defines how applications share context with large language models (LLMs). MCP provides a standardized way to connect AI models to different data sources and tools, enabling them to work together more effectively.

You can use MCP to extend the capabilities of {% data variables.copilot.copilot_chat_short %} by integrating it with a wide range of existing tools and services. For example, the {% data variables.product.github %} MCP server allows you to use {% data variables.copilot.copilot_chat_short %} in {% data variables.product.prodname_vscode %} to perform tasks on {% data variables.product.github %}. You can also use MCP to create new tools and services that work with {% data variables.copilot.copilot_chat_short %}, allowing you to customize and enhance your experience.

For more information on MCP, see the official MCP documentation.

For information on some of the other currently available MCP servers, see the MCP servers repository.

Prerequisites

  • Access to {% data variables.product.prodname_copilot_short %}. {% data reusables.copilot.subscription-prerequisite %}
  • {% data variables.product.prodname_vscode %} version 1.99 or later. For information on installing {% data variables.product.prodname_vscode %}, see the {% data variables.product.prodname_vscode %} download page.

Configuring MCP servers in {% data variables.product.prodname_vscode %}

To configure MCP servers in {% data variables.product.prodname_vscode %}, 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:

{% data reusables.copilot.mcp.mcp-configuration-location %}

>[!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 {% data variables.product.prodname_vscode %} settings. Details on how to configure other MCP servers are available in the MCP servers repository.

For information on configuring the {% data variables.product.github %} MCP server, see AUTOTITLE.

  1. Add the following configuration to your .vscode/mcp.json file:

    {
    "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"]
      }
     }
    }
    
  2. Save the .vscode/mcp.json file.

  3. 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 {% data variables.product.prodname_vscode %}. The "Start" button is outlined in dark orange.

  4. Open {% data variables.copilot.copilot_chat_short %} by clicking the {% octicon "copilot" aria-hidden="true" aria-label="copilot" %} icon in the title bar of {% data variables.product.prodname_vscode %}.

  5. In the {% data variables.copilot.copilot_chat_short %} box, select Agent from the popup menu.

    Screenshot of the {% data variables.copilot.copilot_chat_short %} box in {% data variables.product.prodname_vscode %}. The "Agent" option is outlined in dark orange.

  6. 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 {% data variables.product.prodname_vscode %} instance.

For more information on configuring MCP servers in {% data variables.product.prodname_vscode %}, see Use MCP servers in {% data variables.product.prodname_vscode %} (Preview) in the {% data variables.product.prodname_vscode %} documentation.

Using MCP servers in {% data variables.copilot.copilot_chat_short %}

Once you have configured your MCP servers, you can use them in {% data variables.copilot.copilot_chat_short %} 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.

{% data reusables.copilot.open-chat-vs-code %} {% data reusables.copilot.select-agent %}

  1. 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 {% data variables.product.prodname_vscode %}. The "Running" status is outlined in dark orange.

  2. Ask {% data variables.copilot.copilot_chat_short %} to fetch the details of a URL. For example:

    Fetch https://github.com/github/docs.

  3. If {% data variables.product.prodname_copilot_short %} asks you to confirm that you want to proceed, click Continue.

  4. {% data variables.product.prodname_copilot_short %} will fetch the details of the URL and display them in the chat box.

For more information on using MCP servers in {% data variables.product.prodname_vscode %}, see Use MCP servers in {% data variables.product.prodname_vscode %} (Preview) in the {% data variables.product.prodname_vscode %} documentation.

Using existing MCP configurations

If you already have an MCP configuration in Claude Desktop, you can use that configuration in {% data variables.product.prodname_vscode %} to access the same MCP servers. To do this, add the following configuration to your settings.json file in {% data variables.product.prodname_vscode %}:

"chat.mcp.discovery.enabled": true

{% data variables.product.prodname_vscode %} will automatically find your existing configuration and use it in your {% data variables.product.prodname_vscode %} instance.

{% endvscode %}

{% jetbrains %}

Overview

{% data reusables.copilot.mcp-overview-other-ides %}

For information on other currently available MCP servers, see the MCP servers repository.

Prerequisites

  • Access to {% data variables.product.prodname_copilot_short %}. {% data reusables.copilot.subscription-prerequisite %}

  • A compatible JetBrains IDE. {% data variables.product.prodname_copilot %} is compatible with the following IDEs:

    {% data reusables.copilot.jetbrains-compatible-ides %} {% data reusables.copilot.jetbrains-plugin-prerequisites %}

Configuring MCP servers in JetBrains IDEs

  1. In the lower right corner, click {% octicon "copilot" aria-hidden="true" aria-label="copilot" %}.

  2. From the menu, select "Edit settings".

  3. Under the MCP section, click "Edit in mcp.json".

  4. Define your MCP servers. You can use the following configuration as an example:

    {% data reusables.copilot.mcp-chat-json-snippet-for-other-ides %}

Alternatively, to access the MCP settings, once you're in "Agent Mode", click the tools icon, then click Add more tools.

{% endjetbrains %}

{% xcode %}

Overview

{% data reusables.copilot.mcp-overview-other-ides %}

For information on other currently available MCP servers, see the MCP servers repository.

Prerequisites

  • Access to {% data variables.product.prodname_copilot_short %}. {% data reusables.copilot.subscription-prerequisite %}
  • {% data variables.product.prodname_copilot %} for Xcode extension. See AUTOTITLE.

Configuring MCP servers in Xcode

  1. Open the {% data variables.product.prodname_copilot %} for Xcode extension.

  2. In agent mode, click the tools icon.

  3. Select "Edit config".

  4. Define your MCP servers, editing mcp.json. You can use the following configuration as an example:

    {% data reusables.copilot.mcp-chat-json-snippet-for-other-ides %}

{% endxcode %}

{% eclipse %}

Overview

{% data reusables.copilot.mcp-overview-other-ides %}

For information on other currently available MCP servers, see the MCP servers repository.

Prerequisites

{% data reusables.copilot.eclipse-prerequisites %}

  • Latest version of the {% data variables.product.prodname_copilot %} extension. Download this from the Eclipse Marketplace. For more information, see AUTOTITLE.
  • Sign in to {% data variables.product.company_short %} from Eclipse.

Configuring MCP servers in Eclipse

  1. To open the {% data variables.copilot.copilot_chat_short %} panel, click the {% data variables.product.prodname_copilot_short %} icon ({% octicon "copilot" aria-hidden="true" aria-label="copilot" %}) in the status bar at the bottom of Eclipse.

  2. From the menu, select "Edit preferences".

  3. In the left pane, expand {% data variables.copilot.copilot_chat_short %} and click MCP.

  4. Define your MCP servers. You can use the following configuration as an example:

    {% data reusables.copilot.mcp-chat-json-snippet-for-other-ides %}

{% endeclipse %}

Creating a new MCP server

You can create a new MCP server to fulfill your specific needs, and then integrate it with {% data variables.copilot.copilot_chat_short %}. For example, you can create an MCP server that connects to a database or a web service, and then use that server in {% data variables.copilot.copilot_chat_short %} 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