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.

注意

  • 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 公共预览版 and is subject to change.
  • The GitHub 预发行许可条款 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

  • 对 Copilot 的访问权限****。 若要在 Eclipse 中使用 GitHub Copilot,需要拥有有效的 GitHub Copilot 订阅。 有关如何访问 Copilot 的信息,请参阅“什么是 GitHub Copilot?”。
  • 兼容的 Eclipse 版本****。 若要使用 GitHub Copilot 扩展,必须拥有 Eclipse 版本 2024-09 或更高版本。 请参阅 Eclipse 下载页

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