Skip to main content

Extending GitHub Copilot Chat with Model Context Protocol (MCP) servers

Connect MCP servers to Copilot 채팅 to share context from other applications.

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 모델 컨텍스트 프로토콜(MCP) 정보.

For a curated list of MCP servers from partners and the community, see the GitHub MCP Registry.

엔터프라이즈 및 조직은 Copilot의 ​​MCP 서버 정책을 통해 조직 또는 엔터프라이즈 구성원의 MCP 사용을 활성화하거나 비활성화하도록 선택할 수 있습니다. 이 정책은 기본적으로 사용하지 않도록 설정되어 있습니다. 기업에서 GitHub Copilot에 대한 정책 및 기능 관리조직의 GitHub Copilot 대한 정책 및 기능 관리을(를) 참조하세요. MCP 정책은 정책을 구성하는 조직이나 엔터프라이즈의 Copilot Business 또는 Copilot Enterprise 구독이 있는 사용자에게 적용됩니다. 무료 Copilot이나 Copilot Pro 또는 Copilot Pro+의 경우, 이 정책을 통해 제어되는 MCP 액세스 권한이 없습니다.

Prerequisites

  • Access to Copilot. GitHub 코필로트란?을(를) 참조하세요.
  • Visual Studio Code version 1.99 or later. For information on installing Visual Studio Code, see the Visual Studio Code download page.
  • Copilot Business 또는 Copilot Enterprise 플랜을 사용하는 조직이나 엔터프라이즈의 구성원인 경우, Copilot에서 MCP를 사용하려면 "Copilot의 MCP 서버" 정책을 활성화해야 합니다.

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

참고

The GitHub MCP Registry is in 공개 미리 보기 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.

  1. In Visual Studio Code, open the extensions panel by clicking the extensions icon in the sidebar or pressing Ctrl+Shift+X (Windows/Linux) / Command+Shift+X (Mac).
  2. In the extensions search bar, type @mcp followed by the name of the MCP server you want to add. This opens the MCP server gallery and shows matching results.
  3. Select the MCP server from the search results. On the MCP server's details page, click Install.
  4. When prompted, confirm that you trust the server to start it. VS Code discovers the server's tools and makes them available in chat.
  5. To verify that the MCP server is configured correctly, open the command palette by pressing Ctrl+Shift+P (Windows/Linux) / Command+Shift+P (Mac).
  6. Type and select MCP: List Servers. You should see the MCP server listed as a configured server.

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:

  • 특정 리포지토리입니다. 이를 통해 Visual Studio Code에서 프로젝트를 여는 모든 사용자와 MCP 서버를 공유할 수 있습니다. 이렇게 하려면 리포지토리의 루트에 .vscode/mcp.json 파일을 만듭니다.

  • Visual Studio Code의 개인 인스턴스입니다. 구성된 MCP 서버에 액세스 권한이 있는 유일한 사용자가 됩니다. 이렇게 하려면 Visual Studio Code에서 settings.json 파일에 구성을 추가합니다. 이러한 방식으로 구성된 MCP 서버는 모든 작업 영역에서 사용할 수 있습니다.

    참고

    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 in your IDE.

  1. 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"]
      }
     }
    }
    
  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 Visual Studio Code. The "Start" button is outlined in dark orange.

  4. Open Copilot 채팅 by clicking the icon in the title bar of Visual Studio Code.

  5. In the Copilot 채팅 box, select Agent from the popup menu.

    Screenshot of the Copilot 채팅 box in Visual Studio Code. 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 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 채팅

Once you have configured your MCP servers, you can use them in Copilot 채팅 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.

  1. Visual Studio Code의 제목 표시줄에 있는 아이콘을 클릭하여 Copilot 채팅을 엽니다.

  2. 상자의 Copilot 채팅 에이전트 드롭다운 메뉴에서 에이전트 를 선택합니다.

  3. 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.

  4. Ask Copilot 채팅 to fetch the details of a URL. For example:

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

  5. If Copilot asks you to confirm that you want to proceed, click Continue.

  6. 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.

Prerequisites

  • Access to Copilot. GitHub 코필로트란?을(를) 참조하세요.
  • Visual Studio version 17.14 or later. For more information on installing Visual Studio, see the Visual Studio downloads page.
  • Sign in to GitHub from Visual Studio.
  • Copilot Business 또는 Copilot Enterprise 플랜을 사용하는 조직이나 엔터프라이즈의 구성원인 경우, Copilot에서 MCP를 사용하려면 "Copilot의 MCP 서버" 정책을 활성화해야 합니다.

Configuring MCP servers in Visual Studio

  1. In the Visual Studio menu bar, click View, then click GitHub Copilot Chat.

  2. At the bottom of the chat panel, select Agent from the mode dropdown.

  3. In the Copilot 채팅 window, click the tools icon, then click the plus icon in the tool picker window.

  4. In the "Configure MCP server" pop-up window, fill out the fields, including server ID, type, and any additional fields required for the specific MCP server configuration.

    Visual Studio supports both remote and local servers. Remote servers, defined with a URL and credentials, are hosted externally for easier setup and sharing, while local servers, defined with command-line invocation, run on your local machine and can access local resources. See example configurations below, using the GitHub MCP server as an example.

  5. Click Save.

  6. If you are using a remote server with OAuth authentication, in the mcp.json file, click Auth from the CodeLens above the server to authenticate to the server. A pop-up or new window will appear, allowing you to authenticate with your account. The server will only be able to access the scopes you approve, and that your organization policies allow.

  7. In the Copilot 채팅 window, click the tools icon. You should now see additional tools from the MCP server that you configured.

Remote server configuration example with OAuth

  1. For "Server ID", type github.

  2. For "Type", select "HTTP/SSE" from the dropdown.

  3. For "URL", type https://api.githubcopilot.com/mcp/.

  4. After clicking Save, the configuration in the mcp.json file should look like this:

    JSON
        {
          "servers": {
            "github": {
              "url": "https://api.githubcopilot.com/mcp/"
            }
          }
        }
    
  5. In the mcp.json file, click Auth from the CodeLens above the server to authenticate to the server. A pop-up will come up allowing you to authenticate with your GitHub account.

Local server configuration example

  1. For "Server ID", type github.

  2. For "Type", select "stdio" from the dropdown.

  3. For "Command (with optional arguments)", type docker "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"

  4. Add an environment variable "GITHUB_PERSONAL_ACCESS_TOKEN" set to your personal access token.

  5. After clicking Save, the configuration in the mcp.json file should look like this:

    JSON
        {
          "servers": {
            "github": {
              "type": "stdio",
              "command": "docker",
              "args": [
                "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
                "ghcr.io/github/github-mcp-server"
              ],
              "env": {
                "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT"
              }
            }
          }
        }
    

For more information on configuring MCP servers in Visual Studio, see Use MCP servers in Visual Studio (Preview) in the Visual Studio documentation.

Prerequisites

  • Access to Copilot. GitHub 코필로트란?을(를) 참조하세요.

  • A compatible JetBrains IDE. GitHub Copilot is compatible with the following IDEs:

    • IntelliJ IDEA(Ultimate, Community, Educational)
    • Android Studio
    • AppCode
    • CLion
    • Code With Me 게스트
    • DataGrip
    • DataSpell
    • GoLand
    • JetBrains 클라이언트
    • MPS
    • PhpStorm
    • PyCharm(Professional, Community, Educational)
    • Rider
    • RubyMine
    • RustRover
    • WebStorm
    • Writerside

    다운로드할 JetBrains IDE 도구 찾기를 참조하세요.

  • Copilot Business 또는 Copilot Enterprise 플랜을 사용하는 조직이나 엔터프라이즈의 구성원인 경우, Copilot에서 MCP를 사용하려면 "Copilot의 MCP 서버" 정책을 활성화해야 합니다.

Configuring MCP servers from your MCP registry

  1. In your JetBrains IDE, open Copilot 채팅.
  2. In the Copilot 채팅 window, click the MCP icon.
  3. In the MCP Registry window, find the MCP server(s) you want to add from the list of available servers.
  4. Next to each MCP server you want to add, click Install.
  5. When you are finished adding MCP servers, click OK.
  6. In the Copilot 채팅 window, click the tools icon. You should now see additional tools from the MCP server(s) that you installed.

Configuring MCP servers manually

  1. 오른쪽 아래 모서리에서 을 클릭합니다.
  2. 메뉴에서 "Open Chat"을 선택하고, 에이전트 모드에 있는지 확인한 다음, 채팅 창 하단에 있는 도구 아이콘("MCP 서버 구성"이라고 함)을 클릭합니다.
  3. Add MCP Tools를 클릭합니다.
  4. In the mcp.json file, define your MCP servers. JetBrains IDEs support both remote and local servers. Remote servers are hosted externally for easier setup and sharing, while local servers run on your local machine and can access local resources.

You can use the following configurations as examples:

Remote server configuration example with PAT

JSON
{
    "servers": {
        "github": {
            "url": "https://api.githubcopilot.com/mcp/",
            "requestInit": {
                "headers": {
                    "Authorization": "Bearer YOUR_PAT_HERE"
                }
            }
        }
    }
  }

Local server configuration example

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

Prerequisites

  • Access to Copilot. GitHub 코필로트란?을(를) 참조하세요.
  • GitHub Copilot for Xcode extension. See 사용자 환경에 GitHub Copilot 확장 설치.
  • Copilot Business 또는 Copilot Enterprise 플랜을 사용하는 조직이나 엔터프라이즈의 구성원인 경우, Copilot에서 MCP를 사용하려면 "Copilot의 MCP 서버" 정책을 활성화해야 합니다.

Configuring MCP servers from your MCP registry

  1. In Xcode, open Copilot 채팅.
  2. In the Copilot 채팅 window, click the icon to open settings.
  3. In the settings window, select the Tools tab.
  4. Next to MCP Registry URL (Optional), click Browse MCP Servers.
  5. In the MCP Registry window, find the MCP server(s) you want to add from the list of available servers.
  6. Next to each MCP server you want to add, click Install.
  7. When you are finished adding MCP servers, close the MCP Servers Marketplace window.
  8. In the settings window, under Available MCP Tools, click the > icon to expand the list of available MCP tools. You should now see additional tools from the MCP server(s) that you installed.

Configuring MCP servers manually

  1. Xcode용 GitHub Copilot 확장을 열고 "Settings"로 이동합니다.
    • 또는, 활성 Xcode 작업 영역의 메뉴 모음에서 Editor를 클릭하고 GitHub Copilot 을 선택한 다음, Open GitHub Copilot for Xcode Settings를 클릭하여 설정을 찾을 수 있습니다.
  2. MCP 탭을 선택한 다음, Edit Config를 클릭합니다.
  3. Define your MCP servers, editing mcp.json. Xcode supports both remote and local servers. Remote servers are hosted externally for easier setup and sharing, while local servers run on your local machine and can access local resources.

You can use the following configurations as examples:

Remote server configuration example with PAT

JSON
{
    "servers": {
        "github": {
            "url": "https://api.githubcopilot.com/mcp/",
            "requestInit": {
                "headers": {
                    "Authorization": "Bearer YOUR_PAT_HERE"
                }
            }
        }
    }
  }

Local server configuration example

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

Prerequisites

  • Copilot에 액세스합니다. GitHub 코필로트란?을(를) 참조하세요.
  • Eclipse의 호환 버전. GitHub Copilot 확장을 사용하려면 Eclipse 버전 2024-09 이상이 필요합니다. Eclipse 다운로드 페이지를 참조하세요.
  • Copilot Business 또는 Copilot Enterprise 플랜을 사용하는 조직이나 엔터프라이즈의 구성원인 경우, Copilot에서 MCP를 사용하려면 "Copilot의 MCP 서버" 정책을 활성화해야 합니다.

Configuring MCP servers from your MCP registry

  1. In Eclipse, open Copilot 채팅.
  2. In the Copilot 채팅 window, click the MCP icon.
  3. In the MCP Registry window, find the MCP server(s) you want to add from the list of available servers.
  4. Next to each MCP server you want to add, click Install.
  5. When you are finished adding MCP servers, click Close.
  6. In the Copilot 채팅 window, click the tools icon. You should now see additional tools from the MCP server(s) that you installed.

Configuring MCP servers manually

  1. Eclipse 하단의 상태 표시줄에 있는 Copilot 아이콘()을 클릭합니다.
  2. 메뉴에서 Open Chat을 선택하고 채팅 창에서 "Configure Tools..." 아이콘을 클릭합니다.
    • 또는 Edit preferences를 선택한 다음, 왼쪽 창에서 GitHub Copilot을 확장하고 MCP를 클릭합니다.
  3. Under "Server Configurations", define your MCP servers. Eclipse supports both remote and local servers. Remote servers are hosted externally for easier setup and sharing, while local servers run on your local machine and can access local resources.

You can use the following configurations as examples:

Remote server configuration example with PAT

JSON
{
    "servers": {
        "github": {
            "url": "https://api.githubcopilot.com/mcp/",
            "requestInit": {
                "headers": {
                    "Authorization": "Bearer YOUR_PAT_HERE"
                }
            }
        }
    }
  }

Local server configuration 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 채팅. For example, you can create an MCP server that connects to a database or a web service, and then use that server in Copilot 채팅 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