The Dynamics 365 ERP MCP Server replaces that entire approach for AI agent scenarios. It exposes your F&O environment — including your custom data entities, forms, buttons, and X++ classes — to any compatible AI agent through a single, standardised protocol called Model Context Protocol (MCP).
In this article I will cover what MCP is, how the three categories of tools work, show you working code and agent call sequences for each one, and walk through everything you need to set it up in your environment.
What is MCP?
Model Context Protocol (MCP) is an open standard developed by Anthropic that defines how AI agents communicate with external data sources and business applications. Instead of each AI tool building its own integration to each business system, MCP provides a universal protocol that any agent can use to discover and invoke capabilities in any MCP-compatible server.
Think of it as the USB-C standard for AI-to-application connectivity. Before USB-C, every device had its own connector. Before MCP, every AI integration had its own custom API.
In D365 F&O, the MCP server sits between your AI agent and your ERP environment:
Tool Category 1 — Data Tools (CRUD via OData / SQL)
Data tools are the fastest and most efficient way for an agent to create, read, update, or delete records. They work through the existing OData data entity layer — the same entities you expose for standard integrations. Custom data entities you have built are automatically discoverable.
Tool Category 2 — Form Tools (Button-driven business logic)
Form tools are the most powerful category. They let the agent interact with D365 F&O the same way a human user would — opening forms, setting field values, clicking action buttons, filtering grids, and saving records. This is not screen scraping. The agent works through server APIs that expose the application view model — the same model the client uses. Every form interaction respects the same security roles and runs the same business logic as a human click.
Use form tools when the operation involves button-driven business logic that is not available through a data entity — like releasing a purchase order, approving a workflow, posting a journal from a form, or any custom action button you have built through extensions.
Tool Category 3 — Action Tools (Custom X++ business logic)
Action tools are for scenarios where neither data entities nor form navigation can reach the logic you need to expose — for example, a custom calculation engine, a complex validation that spans multiple tables, or a business rule that is not triggered by any existing button.
You write an X++ class that implements the ICustomAPI interface, register it through the Dataverse Custom APIs form, and it becomes discoverable and invocable through api_find_actions and api_invoke_action.
Configuration — setting up MCP in your environment
Prerequisites checklist
- D365 F&O version 10.0.47, or 10.0.46 PQU-2, or 10.0.45 PQU-7
- Tier 2+ environment or Unified Developer Environment — CHE (Cloud Hosted Environments) are not supported
- Feature "Dynamics 365 ERP Model Context Protocol server" enabled in Feature Management (on by default)
- Agent platform registered in Allowed MCP Clients
- Agent identity assigned the System agent security role + task-appropriate roles
Allowed MCP Clients
By default only two clients can connect to your MCP server:
To add another platform (Azure AI Foundry, Claude Desktop, a custom agent host):
- Register the application in Microsoft Entra ID and note the Application (Client) ID
- In F&O: System Administration → Setup → Allowed MCP Clients
- Add a new row with the Client ID, set Allowed =
true
Agent security — the System agent role
Agent identities assigned the System agent role are exempt from D365 F&O user licensing. The role has no permissions — it is solely for license exemption. Assign additional roles to the agent identity that grant only the permissions needed for its tasks.
The MCP server excludes security management and user management forms, but assigning System Admin to an agent identity still violates least-privilege principles and creates an audit risk. Always scope agent roles to the minimum required for its tasks.
MCP server URL format
When connecting a compatible agent client (e.g. VS Code, Azure AI Foundry) to your environment, the MCP server URL follows this format:
https://<your-environment>.operations.dynamics.com/mcpIn VS Code, add this to your .vscode/mcp.json:
{
"servers": {
"d365fo": {
"type": "http",
"url": "https://<your-environment>.operations.dynamics.com/mcp",
"gallery": false
}
}
}Known limitations
form_open_or_close_tab before accessing any controls inside a closed FastTab.form_filter_grid.data_create_entities cannot create parent and child records in a single call. Create them sequentially.Conclusion
The Dynamics 365 ERP MCP Server is the most significant extensibility change to D365 F&O since the introduction of the Extension model. It shifts the integration surface from custom APIs you build and maintain to a universal protocol that any agent can use — without you writing a single connector.
The three tool categories each serve a clear purpose: Data Tools for efficient CRUD, Form Tools for button-driven business logic that mirrors exactly what a human would do, and Action Tools for custom X++ logic that neither of the first two can reach.
As an F&O developer, your role in this new architecture is to ensure your custom data entities are well-structured, your custom forms and buttons are logically named (because the agent navigates by name), and your custom X++ classes implement the ICustomAPI framework correctly so they are discoverable as Action Tools. That is the foundation of Agentic ERP — and the developers who understand how to build it are the ones who will shape the next generation of ERP implementations.
That's all for now. Please let us know your questions or feedback in comments section !!!!
No comments:
Post a Comment