How to Connect Microsoft Dynamics 365 to MCP
Integrate Dynamics 365 Sales, Customer Service, and Finance with AI agents via MCP. Manage accounts and opportunities through the AnythingMCP dashboard.
Connect Dynamics 365 to AI Agents
Microsoft Dynamics 365 is a leading ERP and CRM platform. By connecting D365 to MCP with AnythingMCP, AI agents can access accounts, opportunities, cases, and financial data through natural language.
Step-by-Step Guide
Step 1: Deploy AnythingMCP
git clone https://github.com/HelpCode-ai/anythingmcp.git
cd anythingmcp && docker compose up -d
Step 2: Create a REST Connector
Open the AnythingMCP dashboard at http://localhost:3000 and create a new REST connector. Set the base URL to your Dynamics 365 Web API endpoint (e.g., https://yourorg.crm.dynamics.com/api/data/v9.2).
Step 3: Configure Authentication
In the connector settings, configure OAuth 2.0 with your Azure AD App Registration credentials. Use Client Credentials flow with appropriate Dynamics 365 API permissions.
Step 4: Import and Customize Tools
Configure endpoints for accounts, opportunities, leads, invoices, and cases in the dashboard. Customize tool names and descriptions for AI agent clarity.
Step 5: Test and Connect
Test each tool in the dashboard, then configure your MCP client:
{
"mcpServers": {
"dynamics365": {
"url": "http://localhost:4000/mcp"
}
}
}
AI Agent Use Cases
- "Show me all opportunities closing this quarter over $100k"
- "Create a lead for Sarah at GlobalTech, industry: Technology"
- "What are the top 10 accounts by revenue?"
- "Open a high-priority service case for Contoso Ltd"
- "Show unpaid invoices older than 30 days"
Best Practices
- Register an Azure AD app with Dynamics 365 API permissions
- Use $select to limit returned fields for efficiency
- OData filters — Leverage
$filter,$top,$orderbyfor efficient queries - Security roles — Application user must have appropriate D365 security roles
- Test in sandbox — Use a Dynamics 365 sandbox environment first
Next Steps
- Salesforce to MCP Guide — Alternative CRM
- SAP HANA to MCP Guide — ERP integration