Skip to main content

Extending Copilot Chat with the Model Context Protocol (MCP)

Learn how to use the Model Context Protocol (MCP) to extend Copilot Chat.

Note

  • MCP support is generally available (GA) in Copilot Chat for Visual Studio Code.
  • MCP support for Copilot in Visual Studio, JetBrains, Eclipse, and Xcode is in public preview and is subject to change.
  • The GitHub Pre-release License Terms apply only to Copilot in IDEs where MCP support is still in preview. GA terms apply when using MCP for Copilot in Visual Studio Code.

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.

Prerequisites

Configuring MCP servers in Eclipse

  1. To open the Copilot Chat panel, click the Copilot icon () in the status bar at the bottom of Eclipse.

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

  3. In the left pane, expand Copilot Chat and click MCP.

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

    JSON
    {
      "servers": {
        "memory": {
          "command": "npx",
          "args": [
            "-y",
            "@modelcontextprotocol/server-memory"
          ]
        }
      }
    }
    

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