# Connect Dataverse MCP to GitHub Copilot in VS Code

Set up Dataverse MCP in VS Code with GitHub Copilot. Find your endpoint, configure mcp.json, sign in, verify the connection, and troubleshoot missing tools.

Author: [Rudraraju Bharath Sai Vyaas](https://bharathvyaas.vercel.app/#about)
Canonical: https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode

Published: 2026-11-04
Updated: 2026-11-05

## The connection in brief

**Connect GitHub Copilot to your [Dataverse](https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode#term-dataverse) environment by enabling the Copilot [MCP](https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode#term-mcp) client, adding your environment’s `/api/mcp` URL in VS Code, and signing in with your Microsoft work account.** Then test the connection with a read-only request.

The steps follow the same route as the walkthrough: **Power Platform admin center → Power Apps → VS Code**. I use **Global → Copilot Global** for the connection. If you prefer a project-only setup, the configuration alternatives are included in step 3.

## Before you start

* A Dataverse environment and a Microsoft account with access to it.
* VS Code with GitHub Copilot available and signed in. Your GitHub sign-in enables Copilot; the Microsoft sign-in gives it access to Dataverse.
* A Power Platform administrator who can enable the Copilot MCP client if needed.
* Your organization’s approval to use the environment through Copilot. Check applicable Dataverse MCP billing with your administrator.

MCP uses your Dataverse permissions; connecting does not grant extra access to tables or records. See Microsoft’s [Dataverse MCP FAQ](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp-faq) for permissions and billing.

## 1. Enable the Copilot client

Open the [Power Platform admin center](https://admin.powerplatform.microsoft.com/) with an administrator account.

1. Go to **Manage → Environments**, select your environment, and open **Settings → Product → Features**.
2. Find **Dataverse Model Context Protocol**. Select **Allow MCP clients to interact with Dataverse MCP server**, then **Save** if you changed it.
3. Open **Advanced Settings**. In **Active Allowed MCP Clients**, open **Microsoft GitHub Copilot**.
4. Set **Is Enabled** to **Yes**, then choose **Save & Close**.

**Checkpoint:** both the environment setting and the Microsoft GitHub Copilot client are enabled. Enabling Copilot Studio alone does not enable GitHub Copilot. These controls are covered in Microsoft’s [environment configuration guide](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp-disable).

> **I cannot change these settings**
>
> These settings require the Power Platform administrator role. Ask your administrator to enable Microsoft GitHub Copilot for the specific environment you need. The [client allowlist](https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode#term-client-allowlist) permits the connection; your Dataverse security roles still determine which operations you can perform.

## 2. Find your Dataverse MCP URL

Switch to [Power Apps](https://make.powerapps.com/) and select **the same environment**. Open the **Settings** gear → **Session details**, then copy **[Instance URL](https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode#term-instance-url)**. Remove a trailing slash and append `/api/mcp` once.

```text
Instance URL
https://YOUR-ENVIRONMENT.crm.dynamics.com

MCP server URL
https://YOUR-ENVIRONMENT.crm.dynamics.com/api/mcp
```

Keep your regional hostname exactly as copied—for example, `crm8.dynamics.com`. Use the Instance URL, rather than an app link containing `/main.aspx` or a [Web API endpoint](https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode#term-endpoint) containing `/api/data/v9.2`.

**Checkpoint:** your URL starts with `https://`, points to the intended environment, and ends in `/api/mcp`. This is the address used in Microsoft’s [VS Code connection steps](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp-vscode).

## 3. Add the server in VS Code

Open **VS Code** with GitHub Copilot signed in.

1. Press **⌘⇧P** on Mac or **Ctrl+Shift+P** on Windows/Linux to open the Command Palette. Run **MCP: Add Server…**.
2. Select **HTTP**—shown as **HTTP (HTTP or Server-Sent Events)** in my screenshots. The URL you enter still uses HTTPS.
3. Paste your MCP URL and press **Enter**.
4. Give the server a recognizable name, such as **DataverseMcp**, and press **Enter**.
5. Choose **Global**, then **Copilot Global** when the destination picker appears. This makes the connection available across your projects.

The generated configuration for this route uses `mcpServers`. Check that it contains your server name and environment URL, then save any edits.

```json
{
  "mcpServers": {
    "DataverseMcp": {
      "type": "http",
      "url": "https://YOUR-ENVIRONMENT.crm.dynamics.com/api/mcp"
    }
  }
}
```

Replace the example hostname. If the file already contains other servers, add only the new entry inside its existing `mcpServers` object.

> **See the HTTP option in VS Code**
>
> ![VS Code Add MCP Server menu with HTTP (HTTP or Server-Sent Events) selected.](https://bharathvyaas.vercel.app/images/dataverse-mcp/http-transport.png "Actual setup capture: choose HTTP for the remote Dataverse endpoint. Menu wording can vary by VS Code version.")

> **Global or workspace? Which configuration file should I use?**
>
> Choose [global scope](https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode#term-global-scope) to reuse the connection across projects, or [workspace scope](https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode#term-workspace-scope) to keep it with one project. VS Code’s destination options depend on its version and selected [agent harness](https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode#term-agent-harness).
>
> | Destination                                 | File                                    | Top-level key |
> | ------------------------------------------- | --------------------------------------- | ------------- |
> | Copilot Global, as shown in the walkthrough | `~/.copilot/mcp-config.json` by default | `mcpServers`  |
> | Copilot workspace                           | `.mcp.json` at the project root         | `mcpServers`  |
> | VS Code workspace format                    | `.vscode/mcp.json`                      | `servers`     |
>
> If `COPILOT_HOME` is configured, Copilot’s user configuration lives there instead of the default `~/.copilot` directory. Use the destination shown by your client. The [VS Code configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration) explains the supported formats.
>
> For `.vscode/mcp.json`, use this shape:
>
> ```json
> {
>   "servers": {
>     "DataverseMcp": {
>       "type": "http",
>       "url": "https://YOUR-ENVIRONMENT.crm.dynamics.com/api/mcp"
>     }
>   }
> }
> ```
>
> Keep the key that belongs to your chosen format; do not paste `mcpServers` into a file expecting `servers`. You only need one connection for this setup, not a copy in every file. If the destination picker marks an older User Configuration option as deprecated, choose Copilot Global for the route shown here.

## 4. Sign in and enable the tools

Run **MCP: List Servers**, select the server you just named, and choose **Start Server** if it is stopped. If a trust prompt appears, check the linked configuration and choose **Trust** for your intended connection.

**Microsoft sign-in can appear at either of these points:**

* **When the server starts:** allow the Microsoft authentication request, choose the work account that has access to your environment, and complete any browser sign-in prompts.
* **When you first ask Copilot to use it:** select **Authenticate** on the **MCP authentication required** message, complete sign-in, then resume the request.

Already signed in? You may not see either prompt. You do not need to add another server just because authentication appears later.

Open **Copilot Chat** and use [Agent mode](https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode#term-agent-mode), or the Copilot session with tools enabled in newer versions. Open the chat’s customization/tools control, select **Tools**, and expand your server under **Connected Sources**. Make sure the server and the tools you need are enabled.

**Checkpoint:** your server is running and its tools appear in the current Copilot session. The next step checks an actual request.

> **Trust, sign-in, and Allow Once are different prompts**
>
> **Trust** lets the MCP server start. **Microsoft sign-in** gives it access using your account. **Allow Once** approves the particular action Copilot wants to perform. Completing one does not automatically complete the others. Review the tool and its inputs before approving a request.
>
> ![VS Code prompt asking whether to trust and run the configured MCP server, with Do not trust and Trust buttons.](https://bharathvyaas.vercel.app/images/dataverse-mcp/server-trust.png "Actual VS Code trust prompt. Review the linked server configuration before choosing Trust.")
>
> For workspace configurations, VS Code’s Workspace Trust can control startup instead of a separate server prompt. Only trust a workspace you have reviewed. See [VS Code’s server trust guidance](https://code.visualstudio.com/docs/agents/run/manage-mcp-servers#review-trust-and-isolation).

> **Find the tools button and inspect the connected server**
>
> In my screenshots, the four-tile icon beside the chat header’s plus button and dropdown opens the customization controls. Choose **Tools**, then expand **Connected Sources → your server**. Other versions place **Configure Tools** near the chat input.
>
> ![Copilot Chat header showing the four-tile customization icon between the dropdown and More Actions.](https://bharathvyaas.vercel.app/images/dataverse-mcp/copilot-toolbar.png "Actual Copilot toolbar. Open the customization controls, then Tools.")
>
> The screenshots use the name **MCP Server**; the walkthrough uses **DataverseMcp**. These are connection names I chose, not different Dataverse services. Look for the name you entered in step 3.
>
> ![Expanded MCP Server tools showing read_query, invoke_api, and other Dataverse operations.](https://bharathvyaas.vercel.app/images/dataverse-mcp/available-tools.png "Actual Dataverse tool list. Expand your own server to see the tools available to your session.")
>
> You can also run **Chat: Open Customizations** and select **MCP Servers** to manage the connection. See [VS Code’s server controls](https://code.visualstudio.com/docs/agents/run/manage-mcp-servers).

## 5. Verify with a read-only request

Send this prompt in Copilot Chat. Replace **DataverseMcp** if you chose another server name.

```text
Use the DataverseMcp MCP connection to find the Account table
and describe its logical name and available columns.
Use metadata tools only. Do not create, update, or delete records.
Show which tools you called and report any connection errors.
```

If Copilot asks for approval, inspect the requested tool and inputs, then choose **Allow Once** for the intended read. Expand the tool result and check that it came from your Dataverse server and describes the Account table. If Copilot answers without calling the server, the connection has not been tested.

**You’re connected when a request to your intended server returns the expected table [metadata](https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode#term-metadata).** The number of tables or tools does not need to match the walkthrough.

> **Why my table-count test also asked to run a terminal command**
>
> In my setup test, I asked how many tables the server exposed. Copilot retrieved the table catalog with `describe`, then requested permission to count the returned entries using a local terminal command. That command was a separate action, not part of Microsoft sign-in or a requirement for connecting Dataverse.
>
> Review each requested action. If you only want to check the connection, use the Account-table prompt above; you can also tell Copilot to use MCP metadata tools only and avoid local commands.

Once connected, follow my [Custom API case study](https://bharathvyaas.vercel.app/case-studies/dataverse-mcp-custom-api) to see Copilot discover and call an order-placement API, including the prompts, stock rejection, successful response, and C# implementation.

## Troubleshooting

Open the symptom that matches what you see.

> **MCP: Add Server is missing, or my menus look different**
>
> Open the Command Palette in VS Code—not a terminal—and search for **MCP**. Check that VS Code and GitHub Copilot are up to date and that you are signed in. In versions with the customization editor, use **Chat: Open Customizations → MCP Servers**. The options depend on the selected Copilot session and organization settings; ask your administrator if MCP is restricted. [VS Code server management](https://code.visualstudio.com/docs/agents/run/manage-mcp-servers).

> **I cannot sign in, or the server returns HTTP 401**
>
> Confirm the Instance URL and that **Microsoft GitHub Copilot** is enabled in that environment. Choose the Microsoft work account that can access it; being signed in to GitHub alone is not enough. Complete any pending **Authenticate** prompt. If it still fails, open **MCP: List Servers → your server → Show Output** and investigate the latest error before retrying. [Microsoft’s authentication FAQ](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp-faq).

> **The output shows warnings or “Waiting for server to respond”**
>
> My startup log showed authentication-metadata warnings and waiting messages before it eventually discovered tools. An earlier warning alone does not tell you whether startup ultimately failed. Finish any pending sign-in, check the latest status, and test a read-only request.
>
> If the server remains stuck, use **Show Output** to check the endpoint, network access, and authentication error. After fixing the cause, restart the server. Do not treat a persistent error as harmless because the screenshot later succeeded. [VS Code troubleshooting](https://code.visualstudio.com/docs/agents/run/manage-mcp-servers#troubleshoot-mcp-servers).

> **The server is running, but Copilot cannot see or use its tools**
>
> Open **Tools → Connected Sources** and check that the intended server is enabled. Confirm the current workspace, configuration destination, and selected Copilot session. A server configured for another [agent harness](https://bharathvyaas.vercel.app/blogs/connect-dataverse-mcp-github-copilot-vscode#term-agent-harness) may not be available here. Check its output, restart after configuration changes, and retry the read-only prompt with the server’s name.

> **I see duplicate servers, or Copilot uses the wrong environment**
>
> Open the server’s **Show Configuration** action and compare its URL with Power Apps **Session details**. For one environment, keep one clearly named connection enabled for the test. Disable the duplicate in the server controls rather than repeatedly adding new entries.
>
> For multiple environments, use separate names such as **Dataverse-Dev** and **Dataverse-Test**, each with its own URL. Name the intended server in your prompt and check the server shown on the tool call. [Microsoft’s multiple-environment guidance](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp-faq).

> **My tool list or table count differs from the screenshots**
>
> Use your connected server’s list as the reference. Tools can change between releases, and access depends on your environment and permissions. Older tutorials may mention `list_tables` or `describe_table`; Microsoft now documents `describe` in their place. `search` finds metadata, while `search_data` searches data and requires Dataverse search to be enabled. [Microsoft’s tool FAQ](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp-faq).
>
> A missing `invoke_api` tool is separate from a Custom API that cannot be found. Check the server’s available tools first; for API discovery and invocation, see the [case study’s troubleshooting section](https://bharathvyaas.vercel.app/case-studies/dataverse-mcp-custom-api#user-content-troubleshooting-and-common-questions).

> **I connected, but a table or operation is unavailable**
>
> Check the signed-in user’s Dataverse privileges and confirm the environment. Enabling the MCP client does not grant table permissions. Use the returned error to identify whether the problem is access, a missing table, or an unavailable operation. [Dataverse permissions](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp-faq).

> **Should I use /api/mcp or /api/mcp_preview?**
>
> Use `/api/mcp` for this guide. `/api/mcp_preview` exposes additional preview tools and requires the preview setting to be enabled. Choose it only when following a specific preview feature’s instructions. [Endpoint differences](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp-faq).

> **Is this the GitHub MCP server or the Power Platform CLI MCP server?**
>
> This connection targets Microsoft’s hosted Dataverse server for your environment. GitHub’s MCP server works with GitHub resources; Power Platform CLI has its own MCP setup. You do not need to configure either of those to follow this guide.

## Where to go next

* **Explore Custom APIs.** Follow the [Copilot discovery and invocation case study](https://bharathvyaas.vercel.app/case-studies/dataverse-mcp-custom-api#user-content-what-the-copilot-tests-showed).
* **Work with a Dataverse query.** Use the [FetchXML workspace](https://bharathvyaas.vercel.app/tools/fetchxml#workspace) to inspect a query and prepare its Web API URL.
* **Compare configurations.** Use the [text comparer](https://bharathvyaas.vercel.app/tools/text-compare#workspace) to review changes before updating an existing file.

The interactive walkthrough above reconstructs the setup with example environment details. Use **Chapters** to jump to a step, or **Settings → Sign-in appears** to see authentication during setup or on the first chat request. It does not connect to your environment.


## Terms in this article

### Microsoft Dataverse

The data platform behind these Power Platform applications. It stores business records in tables and applies permissions and server-side business logic.

### Model Context Protocol (MCP)

A standard way for an AI application to connect to external tools and context. Here, GitHub Copilot is the client and Microsoft’s Dataverse MCP server exposes the environment’s available tools.

### Client allowlist

The environment setting that permits particular MCP clients, such as GitHub Copilot, to connect. It does not grant the signed-in user extra permissions to Dataverse records.

### Instance URL

The base address of your Dataverse environment, such as https://contoso.crm.dynamics.com. Copy it from Power Apps Session details; it is not a link to an individual app or record.

### Endpoint

The address a client connects to. In this setup, the environment’s instance URL plus /api/mcp is the MCP endpoint; /api/data/v9.2 is a different endpoint for the Dataverse Web API.

### Global scope

A connection available across projects for the selected user profile or agent setup. Its configuration location depends on the client and destination you choose.

### Workspace scope

A connection configured for the project or workspace you currently have open. Copilot uses a project-root .mcp.json; the VS Code format uses .vscode/mcp.json. Keep the format that matches your chosen destination.

### Agent harness

The software that runs an agent session and manages its tools, configuration, and approvals. Different harnesses in VS Code can use different MCP configuration formats and destinations.

### Agent mode

A Copilot chat mode that can use enabled tools to carry out a task, subject to the client’s permissions and approvals. Availability of a tool does not by itself authorize a write.

### Metadata

Information describing the available tables, columns, relationships, or API inputs and outputs. Reading metadata describes how data is organized; it is different from reading or changing business records.
