# Dynamics 365 MCP

> Microsoft Dynamics 365 MCP Server connects your AI client directly into your core CRM and ERP systems. It lets you manage accounts, update opportunities, create support cases, and run financial queries using natural language chat. Stop clicking through dashboards; just tell your agent what needs doing on the platform.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** account-management, opportunity-pipeline, business-processes, crm-integration, lead-tracking, enterprise-data

## Description

**Microsoft Dynamics 365 MCP Server** connects your AI client directly into your core CRM and ERP systems. Forget clicking through dashboards just to do simple work; you'll just tell your agent what needs doing on the platform, period.

This server exposes tools that let you manage accounts, handle support tickets, move deals through the pipeline, and check financial records—all using natural language chat. You don't need to know where the button is; you just ask for the data or tell it to make the change.

**Managing Accounts and Contacts:**
You can list multiple customer **accounts**, filtering them down by whatever criteria you need. When you need details on a specific account, your agent uses `get_record` to pull every piece of information associated with that unique ID. If you're tracking who works at those companies, the server lets you list all **contacts** tied to any given account through `list_contacts`. You can also change basic account details or update records using `update_record`, specifying only the fields that need tweaking.

**Tracking the Sales Pipeline:**
To get a read on current revenue, your agent uses **list_opportunities**, pulling open deals filtered by stage, close date, or estimated value. If you've closed a deal and need to document it, you can use `create_record` to build brand new sales orders into Dynamics 365. You can also handle the whole lifecycle of an opportunity using core tools like **get_record** and **update_record**, making sure every detail is current.

**Handling Support Cases:**
Need to know what’s broken? The server lets you retrieve a list of support incidents using `list_cases`. When a new issue pops up, your agent can create it immediately with `create_record`, letting you track resolution status without lifting a finger. You'll also use **get_record** and **update_record** to manage the specific details of any case file.

**Running Complex Queries and Finance:**
The real power here is in its versatility. Instead of clicking through multiple menus, your agent uses `query_dataverse` to query virtually any Dataverse entity set—that includes accounts, contacts, opportunities, invoices, and everything else stored in custom tables. If you need hard numbers for accounting, this tool lets you access financial records by querying journal entries or G/L accounts using OData filter syntax. You can also use `list_accounts` to get a general count of your base records with the **count_records** tool, which is perfect for quick dashboard checks.

**General Data Manipulation (CRUD):**
Your agent has full control over core data operations across any entity set. It uses **create_record** when you need to build something from scratch; it relies on **get_record** to pull down specific details using an ID; and it employs **update_record** to change existing values without deleting anything important. Remember, if a record is garbage, your agent can use **delete_record** to permanently wipe it out of the system. It’s that much power in one chat window.

## Tools

### count_records
Counts the number of records within a specified Dynamics 365 entity set for dashboard use.

### create_record
Makes a brand new record in Dynamics 365 by accepting field values formatted as JSON.

### delete_record
Permanently deletes an existing Dynamics 365 record. Be careful, this action cannot be reversed.

### get_record
Retrieves all details for one specific Dynamics 365 record using its unique ID.

### list_accounts
Lists multiple accounts, allowing you to filter the results by specific criteria.

### list_cases
Retrieves a list of support cases or incidents currently tracked in Dynamics 365.

### list_contacts
Lists all contacts associated with accounts within your Dynamics 365 environment.

### list_opportunities
Retrieves a list of open sales opportunities, filtered by stage, close date, or estimated value.

### query_dataverse
Queries any Dataverse entity set (accounts, contacts, opportunities, invoices, etc.) using OData filter syntax.

### update_record
Changes the values of an existing Dynamics 365 record; you must only specify which fields need changing.

## Prompt Examples

**Prompt:** 
```
Show me all opportunities closing this month with value above $100K.
```

**Response:** 
```
Found 8 opportunities closing this month with value > $100K: 1. 'Enterprise Cloud Migration' — $450,000 (Stage: Negotiate, Probability: 85%), 2. 'Digital Transformation Q2' — $280,000 (Stage: Propose, Probability: 70%), and 6 more. Total pipeline value: $1,890,000. Want details on any deal?
```

**Prompt:** 
```
Create a new support case for account 'Contoso Ltd' about a billing discrepancy.
```

**Response:** 
```
Support case CAS-2026-12345 created successfully. Account: Contoso Ltd, Subject: 'Billing Discrepancy', Priority: High, Status: Active. The case has been assigned to the Billing Support queue. Would you like to attach any documents or add internal notes?
```

**Prompt:** 
```
What's the total revenue from the EMEA region this quarter?
```

**Response:** 
```
EMEA Revenue (Q2 2026): Total closed-won revenue: €3,240,000 across 34 deals. Top contributors: 1. UK — €1,120,000 (15 deals), 2. Germany — €890,000 (8 deals), 3. France — €620,000 (6 deals). Quarter-over-quarter growth: +14.2%. Want a breakdown by product line?
```

## Capabilities

### Manage Account Records
The agent can list contacts (`list_contacts`), retrieve specific accounts (`get_record`), and update basic account details using `update_record`.

### Track the Sales Pipeline
You can query all open opportunities (`list_opportunities`) based on criteria like stage or estimated value, and you can create new records for sales orders (`create_record`).

### Handle Support Cases
The server allows creation of support incidents via `create_record` and retrieval of existing cases using `list_cases`, letting you track resolution status.

### Query Financial Data
You can access financial records by querying journal entries and G/L accounts directly through the versatile `query_dataverse` tool.

### Execute General CRUD Operations
Use core tools like `get_record`, `create_record`, `update_record`, or `delete_record` to interact with any entity set, including custom tables.

## Use Cases

### Need to check Q3 pipeline value fast
A rep needs to know the total value of all opportunities in the 'Negotiate' stage for the next quarter. Instead of running a report and clicking through filters, they prompt: 'What's the total opportunity value that is Negotiating this quarter?' The agent uses `list_opportunities` to return the total figure instantly.

### A customer service issue needs logging
An agent gets a call about billing. They ask the agent: 'Create a high-priority support case for Acme Corp regarding invoice #456.' The agent uses `create_record`, fills in all required fields, and gives the ticket number back immediately.

### Update an old deal value
A sales manager knows a deal is bigger than expected. Instead of finding the Opportunity ID and manually opening it to update the field, they prompt: 'Increase the estimated value for opportunity XYZ by $50k.' The agent uses `update_record` directly.

### Audit account data structure
The admin needs to see if there are any orphaned contacts linked to a specific account. They ask: 'List all contacts for Account ABC.' The agent runs `list_contacts`, providing an immediate, clean list of every associated person.

## Benefits

- You can update deal values or ownership instantly. Instead of clicking into the Opportunity record, just tell the agent to use `update_record` on a specific ID with new values.
- Get instant pipeline health checks using `list_opportunities`. The agent filters by stage and probability, giving you a quick summary without manual filtering in the UI.
- Need contact info? Running `list_contacts` lets your agent pull all associated contacts for an account ID. It groups the data so you don't have to open 20 different profile pages.
- Stop navigating complex financial menus. Use `query_dataverse` to ask for specific journal entries or G/L accounts, and get the raw data back in seconds.
- It handles case management better than anything else. Creating a new ticket with `create_record` is one prompt; tracking its status requires zero clicks.

## How It Works

The bottom line is: your AI client runs complex business logic against your enterprise data without you ever leaving the chat window.

1. First, you subscribe to the server and supply your Azure AD credentials (Client ID, Client Secret, Tenant ID) along with your Dynamics 365 environment URL.
2. Next, you talk to your AI client. You tell it what business task you need done—like 'Find all opportunities over $100K closing this quarter.'
3. The agent translates that request into the necessary tool calls (e.g., `list_opportunities` or `query_dataverse`), executes them against Dynamics 365, and returns a clean, actionable answer.

## Frequently Asked Questions

**How does authentication work with Dynamics 365?**
Dynamics 365 uses OAuth 2.0 via Microsoft Entra ID (Azure AD). You register an app in Azure Portal, obtain a Client ID and Client Secret, configure API permissions for Dynamics CRM, and create an Application User in your Dynamics environment.

**Can I query custom entities and tables in Dataverse?**
Yes. The `query_dataverse` tool queries any entity in Dataverse — standard or custom. Use OData filter expressions, $expand for related entities, and $select for specific columns.

**Does it work with both Dynamics 365 Sales and Business Central?**
Yes. The MCP server supports the Dataverse Web API (for Sales, Service, Marketing) and the Business Central API (for financials, inventory, purchasing). Just point to the correct environment URL.

**Can I advance opportunities through pipeline stages?**
Absolutely. The `update_record` tool can update the stage, probability, estimated revenue, and close date of any opportunity. The agent also supports advancing records through Business Process Flows.

**How do I use filters when calling the `list_opportunities` tool?**
You must specify criteria using OData syntax in your call. This allows you to narrow down results by stage, close date, or estimated value before fetching them.

**What permissions are required to use the `create_record` tool?**
The calling user must have write access rights for the target entity set. If you lack permission, your agent will receive a specific error code detailing the scope restriction.

**If I run `get_record` with an invalid or non-existent GUID, what happens?**
The system returns a clear 'Record Not Found' error. Your AI client must handle this failure state and prompt the user for the correct identifier.

**How can I optimize data retrieval when using `query_dataverse`?**
Always use OData filter syntax to limit the scope of the query. Don't pull all fields or records; specify exactly which criteria and fields you need.