Edit

Share via


Connect Dataverse MCP with GitHub Copilot in Visual Studio Code and Copilot CLI

This article explains how to set up and use the Microsoft Dataverse model context protocol (MCP) server with GitHub Copilot in Visual Studio Code and GitHub Copilot CLI.

GitHub Copilot in Visual Studio Code

Prerequisites

Steps to connect to Dataverse MCP server in Visual Studio Code

  1. Open Visual Studio Code. Select View > Command Palette (Ctrl+Shift+P), type MCP: Add Server and press Enter.

  2. Select HTTP or Server Sent Events and then press Enter.

  3. Paste your instance URL, such as https://contoso.crm.dynamics.com/, append /api/mcp to it, and press Enter. You can get the instance URL at make.powerapps.com > Settings (gear icon) > Session details > Instance url. Organization URL with appendix.

    This step generates the MCP server configuration in Visual Studio Code.

  4. Press Ctrl+Alt+I and ensure that agent mode is selected. Agent mode in Visual Studio Code GitHub Copilot

GitHub Copilot CLI

Prerequisites

Option 1: Manually add the MCP server

You can configure the Dataverse MCP server in GitHub Copilot CLI by editing the MCP configuration file directly.

  1. Open your MCP configuration file. For global configuration, edit ~/.copilot/mcp-config.json. For project-scoped configuration, edit .mcp/copilot/mcp.json in your project directory.

  2. Add the following JSON snippet. Replace <your org URL> with your Dataverse environment URL (for example, https://contoso.crm.dynamics.com).

    {
      "mcpServers": {
        "DataverseMcp": {
          "type": "http",
          "url": "<your org URL>/api/mcp"
        }
      }
    }
    
  3. Save the file and restart GitHub Copilot CLI for the changes to take effect.

Option 2: Use the Dataverse plugin from the Awesome Copilot marketplace

The Awesome Copilot marketplace provides a Dataverse plugin that includes an mcp-configure skill. This skill guides you through configuring the Dataverse MCP server interactively, including environment discovery and endpoint selection.

  1. Add the Awesome Copilot marketplace to your Copilot CLI:

    copilot plugin marketplace add github/awesome-copilot
    
  2. Install the Dataverse plugin:

    copilot plugin install dataverse@awesome-copilot
    
  3. In a Copilot chat session, use the /dataverse:mcp-configure skill to configure the Dataverse MCP server. The skill walks you through selecting your environment and choosing between the generally available (/api/mcp) and preview (/api/mcp_preview) endpoints.

Connect to Dataverse with Model Context Protocol