/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_queryorsearch_datacall 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
- Go to the Power Platform admin center and select Manage → Environments.
- Select your environment and copy the Environment URL from the details panel.
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
- In the Power Platform admin center, open your environment and select Settings.
- Select Product → Features and scroll to Dataverse Model Context Protocol.
- Make sure Allow MCP clients to interact with Dataverse MCP server is turned on. See Microsoft’s Configure the Dataverse MCP server for details.
3
Register an Entra ID application
- 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.
-
Give it a recognizable name, such as
TrueFoundry Dataverse Connector. - Set Supported account types to Accounts in this organizational directory only (single tenant).
-
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 thehttps://scheme. - Select Register, then copy the Application (client) ID and the Directory (tenant) ID from the overview page.
- 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.
4
Add the Dataverse MCP permission
- In the app registration, open API permissions → Add a permission.
- Select Microsoft APIs → Dynamics CRM.
- Select Delegated permissions, check mcp.tools, and select Add permissions.
- 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.
- Back on Settings → Product → Features → Dataverse Model Context Protocol, select Advanced Settings.
- Add a new client entry. Enter a name (for example
TrueFoundry) and the Application (client) ID from Step 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 A JSON list of account names confirms that authentication, the allow list, and the user’s Dataverse permissions are all working.
read_query and run a read-only query such as: