> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spojit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect the Dynamics 365 (Dataverse) MCP server

> Connect the Microsoft Dataverse MCP server behind Dynamics 365 and Power Apps to Spojit: register a Microsoft Entra app, allow it in the Power Platform admin center, and sign in.

The **Dataverse MCP server** gives AI agents access to the tables and records behind Dynamics 365 and Power Apps. Connect it to Spojit to look up accounts and contacts, create records from other systems, or answer questions about your data.

<Note>
  Spojit connects to this server through a [custom MCP server](/connectors/remote-mcp-servers/custom) connection, so you add it with **Add custom server** rather than from the connector catalog. Microsoft maintains it and decides which tools it offers; see [Microsoft's guide to connecting non-Microsoft clients to Dataverse MCP](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp-other-clients) for the current list.
</Note>

## Before you start

The remote endpoint requires your own Microsoft Entra app, allowed for your environment.

<Steps>
  <Step title="Enable the Dataverse MCP server">
    The server must be enabled for the environment. See [Configure the Dataverse MCP server](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp-disable).
  </Step>

  <Step title="Copy Spojit's redirect URI">
    In Spojit, go to **Connections**, click **Add custom server**, and choose **OAuth 2.0**. Copy the **Redirect URI** shown in the form (for example `https://miraxa.spojit.com/api/connectors/oauth/callback`).
  </Step>

  <Step title="Register an Entra app">
    In the [Microsoft Entra admin center](https://entra.microsoft.com/), go to **Identity > Applications > App registrations** and select **New registration**. Name it (for example `Spojit Dataverse MCP`), choose the supported account types, add a **Web** redirect URI with Spojit's redirect URI, and register. Copy the **Application (client) ID** and **Directory (tenant) ID**.
  </Step>

  <Step title="Create a client secret">
    Under **Certificates & secrets**, create a new client secret and copy its value.
  </Step>

  <Step title="Grant the MCP permission">
    Under **API permissions**, select **Add a permission > Microsoft APIs > Dynamics CRM**, choose **mcp.tools**, and add it.
  </Step>

  <Step title="Allow the app for your environment">
    In the [Power Platform admin center](https://admin.powerplatform.microsoft.com/), go to **Manage > Environments**, select the environment, then **Settings > Product > Features**. Under **Dataverse Model Context Protocol**, select **Advanced Settings**, add a client entry with your **Application (client) ID**, set **Is Enabled** to **Yes**, and save.
  </Step>
</Steps>

## Server URL

Use your environment URL with `/api/mcp`:

```
https://<your-org>.crm.dynamics.com/api/mcp
```

Environments outside North America use a regional host such as `crm4.dynamics.com`; copy the host from your environment URL.

## Connect in Spojit

<Steps>
  <Step title="Add a custom server">
    In **Add custom server**, enter a **Name** such as `Dataverse` and paste the **Server URL**.
  </Step>

  <Step title="Choose Auto authentication">
    Choose **Auto** and click **Save & connect**. Because Dataverse needs your own Entra app, the **OAuth 2.0** form opens with Microsoft's sign-in endpoints already filled in.
  </Step>

  <Step title="Enter your app's credentials">
    Paste the **Application (client) ID** as **Client ID** and the secret value as **Client Secret**, then click **Save & connect**.
  </Step>

  <Step title="Sign in with Microsoft">
    Microsoft opens its sign-in page. Sign in with an account that can use the environment and accept the permissions. Spojit marks the connection **Connected**.
  </Step>
</Steps>

If the form does not prefill, choose **OAuth 2.0** and enter the [Microsoft identity platform endpoints](https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow) for your tenant: **Authorization URL** `https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize` and **Token URL** `https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token`, with **Scopes** `https://<your-org>.crm.dynamics.com/.default offline_access`.

## Use it in a workflow

Add a **Connector** node, pick your Dataverse server under **Custom Servers**, and choose **Agent Mode** or **Direct Mode**. See [Use a custom server in a workflow](/connectors/remote-mcp-servers/custom#use-a-custom-server-in-a-workflow).

## Troubleshooting

<AccordionGroup>
  <Accordion title="Sign-in succeeds but calls are rejected">
    The app's client ID is not enabled under **Dataverse Model Context Protocol > Advanced Settings** for this environment, or the **mcp.tools** permission is missing.
  </Accordion>

  <Accordion title="Admin consent is required">
    Your tenant requires an administrator to consent to the app's permissions. Ask an Entra admin to grant consent on the app's **API permissions** page.
  </Accordion>

  <Accordion title="The connection stops refreshing">
    Make sure **Scopes** includes `offline_access`, then click **Reconnect**.
  </Accordion>
</AccordionGroup>

## Learn more

* [Connect to Dataverse with MCP in non-Microsoft clients](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp-other-clients)
* [Connect to Dataverse with model context protocol](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-mcp)

<Snippet file="start-free.mdx" />
