D365FO MCP Server — Claude Code MCP server: install and use
Connects Microsoft Dynamics 365 Finance & Operations to AI coding assistants via MCP. Useful for running ERP integration workflows directly from your editor.
claude mcp add --env D365FO_CLIENT_ID=<D365FO_CLIENT_ID> --env D365FO_CLIENT_SECRET=<D365FO_CLIENT_SECRET> --env D365FO_TENANT_ID=<D365FO_TENANT_ID> --env D365FO_BASE_URL=<D365FO_BASE_URL> --transport stdio d365fo-mcp-server -- uvx d365fo-clientWhat D365FO MCP Server does
This MCP server bridges Microsoft Dynamics 365 Finance & Operations with AI agents over the Model Context Protocol. You can run it locally with uvx or package it in Docker using the ghcr.io/mafzaal/d365fo-client:latest container image.
Connection requires Azure Active Directory credentials: D365FO_CLIENT_ID, D365FO_CLIENT_SECRET, and D365FO_TENANT_ID, alongside your instance address in D365FO_BASE_URL. Without an active Azure AD app registration, requests fail immediately at the authorization stage.
For remote access, you can deploy the server as an HTTP endpoint to Azure Container Apps using the deploy-aca.sh script. That deployment model supports authentication through OAuth or an API key.
What it helps with
- connect AI assistants to Dynamics 365 Finance & Operations
- host an ERP MCP server on Azure Container Apps
- authenticate MCP requests using Azure Active Directory credentials
Example prompts for the agent
- Verify the connection to our Dynamics 365 F&O instance
- Query D365FO records through the configured MCP server
How to install D365FO MCP Server
Platform CLI
claude mcp add --env D365FO_CLIENT_ID=<D365FO_CLIENT_ID> --env D365FO_CLIENT_SECRET=<D365FO_CLIENT_SECRET> --env D365FO_TENANT_ID=<D365FO_TENANT_ID> --env D365FO_BASE_URL=<D365FO_BASE_URL> --transport stdio d365fo-mcp-server -- uvx d365fo-clientReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from d365fo-client <command>
Platform CLI
codex mcp add d365fo-mcp-server --env D365FO_CLIENT_ID=<D365FO_CLIENT_ID> --env D365FO_CLIENT_SECRET=<D365FO_CLIENT_SECRET> --env D365FO_TENANT_ID=<D365FO_TENANT_ID> --env D365FO_BASE_URL=<D365FO_BASE_URL> -- uvx d365fo-clientReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from d365fo-client <command>
Config file
{
"mcpServers": {
"d365fo-mcp-server": {
"command": "uvx",
"args": [
"d365fo-client"
],
"env": {
"D365FO_CLIENT_ID": "<D365FO_CLIENT_ID>",
"D365FO_CLIENT_SECRET": "<D365FO_CLIENT_SECRET>",
"D365FO_TENANT_ID": "<D365FO_TENANT_ID>",
"D365FO_BASE_URL": "<D365FO_BASE_URL>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from d365fo-client <command>
Config file
{
"servers": {
"d365fo-mcp-server": {
"type": "stdio",
"command": "uvx",
"args": [
"d365fo-client"
],
"env": {
"D365FO_CLIENT_ID": "<D365FO_CLIENT_ID>",
"D365FO_CLIENT_SECRET": "<D365FO_CLIENT_SECRET>",
"D365FO_TENANT_ID": "<D365FO_TENANT_ID>",
"D365FO_BASE_URL": "<D365FO_BASE_URL>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from d365fo-client <command>
Platform CLI
gemini mcp add -e D365FO_CLIENT_ID=<D365FO_CLIENT_ID> -e D365FO_CLIENT_SECRET=<D365FO_CLIENT_SECRET> -e D365FO_TENANT_ID=<D365FO_TENANT_ID> -e D365FO_BASE_URL=<D365FO_BASE_URL> d365fo-mcp-server uvx d365fo-clientReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from d365fo-client <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about D365FO MCP Server
How to install D365FO MCP Server in Claude Code?
Run `claude mcp add d365fo-client -e D365FO_CLIENT_ID=<D365FO_CLIENT_ID> -e D365FO_CLIENT_SECRET=<D365FO_CLIENT_SECRET> -e D365FO_TENANT_ID=<D365FO_TENANT_ID> -- uvx d365fo-client`.
What does D365FO MCP Server do?
It exposes Dynamics 365 Finance & Operations to AI tools and compatible IDEs using standard MCP interfaces.
Which environment variables are required to connect?
You need Azure AD credentials: D365FO_CLIENT_ID, D365FO_CLIENT_SECRET, and D365FO_TENANT_ID, plus the instance URL D365FO_BASE_URL.