Skip to main content
Microsoft Dataverse is the data platform behind Power Platform and Dynamics 365. Every Dataverse environment exposes a hosted MCP server at /api/mcp that lets agents search table schemas and data, run Dataverse SQL SELECT queries with read_query, create, update, and delete rows, and manage tables. Every request runs as the signed-in user and honors that user’s Dataverse security roles. Register it on the TrueFoundry MCP Gateway and your agents reach Dataverse through one governed endpoint, with per-user OAuth, tool-level access control, tracing, and guardrails applied by the Gateway.
Dataverse is per-environment: the MCP URL and the OAuth scope both embed your environment’s host. Dataverse does not support Dynamic Client Registration (DCR), so you must register your own Entra app and add it to the environment’s allowed MCP clients list.

Using Dataverse through the MCP Gateway

When you use the Dataverse MCP server through the AI Gateway, TrueFoundry provides:
  • Authentication - Clients authenticate inbound to the AI Gateway with a Personal Access Token, Virtual Account, or IDE OAuth flow. For outbound access, the AI Gateway runs the OAuth2 Authorization Code flow against your Entra app.
  • Tool-level access control - Enable or disable individual Dataverse tools from the server detail page. Disabling the write tools at the Gateway keeps an agent read-only.
  • Access control - Collaborators and role-based policies define who can use the server and which tools they can invoke.
  • Observability - Tool calls are traced with caller identity, tool name, inputs, and latency. Monitor server- and tool-level usage in MCP Metrics and export traces to your observability stack via OpenTelemetry.
  • Guardrails - Apply pre-tool and post-tool guardrails on MCP tool calls - useful here because a single read_query or search_data call can return customer records.

Prerequisites

  • A TrueFoundry account with permission to add MCP servers, and your TrueFoundry control plane base URL.
  • A Dataverse environment and its environment URL.
  • The Power Platform administrator role, to enable the Dataverse MCP server and add your app to the allowed MCP clients list for the environment.
  • Permission to register an application in Microsoft Entra ID, and an admin who can grant tenant-wide consent if your tenant blocks user consent.

Adding Dataverse MCP server to TrueFoundry

1

Find your Dataverse environment URL

  1. Go to the Power Platform admin center and select Manage → Environments.
  2. Select your environment and copy the Environment URL from the details panel.
The URL looks like https://<org-name>.crm<region>.dynamics.com. The region suffix depends on where the environment is hosted - for example crm.dynamics.com for North America, crm4.dynamics.com for EMEA, or crm8.dynamics.com for India. Use the host exactly as shown; this guide refers to it as <org-host> (for example contoso.crm4.dynamics.com).
2

Enable the Dataverse MCP server for the environment

  1. In the Power Platform admin center, open your environment and select Settings.
  2. Select Product → Features and scroll to Dataverse Model Context Protocol.
  3. Make sure Allow MCP clients to interact with Dataverse MCP server is turned on. See Microsoft’s Configure the Dataverse MCP server for details.
Leave this page open - you add your Entra app to Advanced Settings here in Step 5.
3

Register an Entra ID application

  1. In the Microsoft Entra admin center, go to Entra ID → App registrations → New registration. For general guidance, see Register an application with the Microsoft identity platform.
  2. Give it a recognizable name, such as TrueFoundry Dataverse Connector.
  3. Set Supported account types to Accounts in this organizational directory only (single tenant).
  4. Under Redirect URI, choose the Web platform and enter TrueFoundry’s OAuth callback:
    Replace <tfy-control-plane-base-url> with your TrueFoundry control plane URL. It must match exactly, including the https:// scheme.
  5. Select Register, then copy the Application (client) ID and the Directory (tenant) ID from the overview page.
  6. Open Certificates & secrets → New client secret, set a description and expiry, and copy the secret Value immediately - it is shown only once, and it is the Value, not the Secret ID, that TrueFoundry needs.
Store the secret in the TrueFoundry secrets store and reference it by FQN in the server config rather than pasting it inline. Rotate it before it expires.
4

Add the Dataverse MCP permission

  1. In the app registration, open API permissions → Add a permission.
  2. Select Microsoft APIs → Dynamics CRM.
  3. Select Delegated permissions, check mcp.tools, and select Add permissions.
  4. If your tenant doesn’t allow users to consent to apps, select Grant admin consent for <your tenant> and confirm. The status must turn green.
5

Add the app to the allowed MCP clients list

Dataverse only accepts tokens from MCP clients on the environment’s allow list. See Microsoft’s Connect Dataverse MCP with non-Microsoft clients.
  1. Back on Settings → Product → Features → Dataverse Model Context Protocol, select Advanced Settings.
  2. Add a new client entry. Enter a name (for example TrueFoundry) and the Application (client) ID from Step 3.
  3. Set Is Enabled to Yes, then select Save & Close.
6

Register the MCP server in TrueFoundry

In MCP Servers, click Add new MCP Server, select Connect any Remote MCP Server, and configure:Add Collaborators - the users and teams that can use or manage this server - and assign each an MCP Server Manager or MCP Server User role. Then save.https://<org-host>/.default requests the Dynamics CRM permissions configured on the app (including mcp.tools) for your environment. offline_access lets the Gateway refresh tokens; without it users have to reauthorize when the access token expires.
7

Connect and verify

Open the server’s Tools tab and click Connect Now. TrueFoundry runs the authorization-code flow: you sign in with your Microsoft account, consent, and land back on the server detail page. Each user connects once with their own identity.After connecting, the Tools tab lists the Dataverse MCP tools. To confirm the round trip, click Try on read_query and run a read-only query such as:
A JSON list of account names confirms that authentication, the allow list, and the user’s Dataverse permissions are all working.

Connecting to an MCP Client

Open the How To Use tab on the Dataverse server detail page for your tenant-specific Gateway URL and ready-to-paste client snippets - don’t build the endpoint manually. The tab includes snippets for Claude Code, VS Code, Claude Web, Claude Desktop, Cursor, Windsurf, Codex, and the Python and TypeScript MCP SDKs. Use Show API Key if your client requires a Gateway token in a header. For step-by-step setup in each client, see Connect MCP from your IDE.

Tool Metrics

The Tool Metrics tab tracks invocation count, latency, and error rates per tool. See MCP Metrics for server- and tool-level dashboards across your Gateway.

Disabling Individual Tools

On the Tools tab, toggle off any Dataverse tools your agents don’t need. Disabled tools are hidden from MCP clients and cannot be invoked. Turning off the record, table, skill, and file-upload write tools gives you a read-only Dataverse server at the Gateway, independent of the user’s Dataverse security roles. See MCP Tool Management for denylist and allowlist modes.