Dynamics 365 MCP Server
The Dynamics 365 MCP Server enables interaction with Microsoft Dynamics 365 using the Model Context Protocol (MCP). With this server, you can:
Retrieve authenticated user information (
get-user-info)Fetch all accounts from Dynamics 365 (
fetch-accounts)Retrieve opportunities associated with a specific account (
get-associated-opportunities)Create new accounts in Dynamics 365 (
create-account)Update existing accounts in Dynamics 365 using its ID and updated details (
update-account)
Manages environment configuration for Dynamics 365 connection credentials including client ID, client secret, tenant ID, and service URL.
Provides version control for the codebase, allowing collaborative development through clone, branch, and pull request operations.
Hosts the repository for the MCP server code, enabling collaborative development and issue tracking.
Uses Node.js runtime environment (v16+) to execute the MCP server that connects to Dynamics 365.
Manages package dependencies for the project, including the Model Context Protocol SDK.
Displays status badges in the README showing Node.js version, TypeScript version, MCP status, and license information.
Implements the server using TypeScript 4.x for type-safe interaction with the Dynamics 365 APIs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Dynamics 365 MCP Server show me all accounts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Dynamics 365 MCP Server 🚀
Overview
The Microsoft Dynamics 365 MCP Server is a MCP server that provides tools to interact with Microsoft Dynamics 365 using the Model Context Protocol(MCP) by Anthorpic. It allows users to perform various operations such as retrieving user information, accounts, opportunities associated with an account, create and update accounts from Claude Desktop.
This project uses the @modelcontextprotocol/sdk library to implement the MCP server and tools, and it integrates with Dynamics 365 APIs for data operations.
Related MCP server: Dataverse MCP Server
List of Tools 🛠️
Tool Name | Description | Input | Output |
| Fetches information about the currently authenticated user. | None | User details including name, user ID, and business unit ID. |
| Fetches all accounts from Dynamics 365. | None | List of accounts in JSON format. |
| Fetches opportunities associated with a given account. |
| List of opportunities in JSON format. |
| Creates a new account in Dynamics 365. |
| Details of the created account in JSON format. |
| Updates an existing account in Dynamics 365. |
| Details of the updated account in JSON format. |
Prerequisites 📝
Before setting up the project, ensure you have the following installed:
Node.js (v16 or higher)
NPM (Node Package Manager)
A Dynamics 365 instance with API access
Azure Active Directory (AAD) application configured for Dynamics 365 API access
Configuration Steps ⚙️
Follow these steps to set up and run the project locally:
1. Clone the Repository
git clone https://github.com/your-repo/dynamics365-mcp-server.git
cd dynamics365-mcp-server2. Install Dependencies
npm install3. Configure Environment Variables
Create a .env file in the root of the project and add the following variables:
CLIENT_ID=your-client-id
CLIENT_SECRET=your-client-secret
TENANT_ID=your-tenant-id
D365_URL=https://your-org.crm.dynamics.com
4. Compile TypeScript Files
npm run build
4. Run MCP Server
node build\index.jsYou should see the following output:
Dynamics365 MCP server running on stdio...5. (Optional) Register your MCP Server with Claude Desktop
Install Claude Desktop
Navigate to Settings > Developer > Edit Config
Edit claude_desktop_config.json
{
"mcpServers": {
"Dynamics365": {
"command": "node",
"args": [
"<Path to your MCP server build file ex: rootfolder/build/index.js>"
],
"env": {
"CLIENT_ID": "<D365 Client Id>",
"CLIENT_SECRET": "<D365 Client Secret>",
"TENANT_ID": "<D365 Tenant ID>",
"D365_URL": "Dynamics 365 url"
}
}
}
}Restart Claude Desktop
Now you should be able to see the server tools in the prompt window

Let's test a prompt by invoking tool - get-user-info

6. (Optional) Test tools using MCP Interceptor
Run following command in terminal
npx @modelcontextprotocol/inspector node build/index.js
Go to 🔍 http://localhost:5173 🚀

Now you can connect to server and terst all the tools!!
Debugging 🐛
If you encounter issues, ensure the following:
If you encounter issues, ensure the following:
The .env file is properly configured.
The Azure AD application has the necessary permissions for Dynamics 365 APIs.
The Dynamics 365 instance is accessible from - your environment.
You can also add debug logs in the code to trace issues. For example:
console.error("Debugging: Loaded environment variables:", process.env);Contributing 🤝
Contributions are welcome! Feel free to submit a pull request or open an issue for any bugs or feature requests.
To contribute:
Fork the repository.
Create a new branch for your feature or bug fix.
Commit your changes and submit a pull request.
We appreciate your contributions! 😊
Available Tools
5 toolscreate-accountC
Create a new account in Dynamics 365
Inputs: accountData (required).
fetch-accountsB
Fetch accounts from Dynamics 365
Inputs: no named parameters.
get-associated-opportunitiesC
Fetch opportunities for a given account from Dynamics 365
Inputs: accountId (required).
get-user-infoC
Get user info from Dynamics 365
Inputs: no named parameters.
update-accountC
Update an existing account in Dynamics 365
Inputs: accountId (required), accountData (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose with no overlap: create-account and update-account handle account creation and modification, fetch-accounts retrieves accounts, get-associated-opportunities fetches related opportunities, and get-user-info handles user data. The descriptions clearly differentiate the target resources and actions.
The tools follow a consistent verb-noun pattern with hyphens (e.g., create-account, fetch-accounts), except for get-user-info which uses 'info' instead of a more specific noun like 'user'. This minor deviation slightly affects consistency, but the overall pattern is clear and readable.
With 5 tools, the server is well-scoped for managing Dynamics 365 accounts and related data. Each tool earns its place by covering essential CRUD operations for accounts and providing useful related functions like fetching opportunities and user info, without being overly sparse or bloated.
The toolset provides solid coverage for account management with create, fetch, and update operations, plus useful extensions for opportunities and user info. A minor gap exists in lacking a delete-account tool, which agents might need to work around, but core workflows are well-supported.
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Official Microsoft MCP Server to query Microsoft Entra data using natural language
API-first CRM for LLMs - contacts, companies, deals and activities over a native MCP server.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseBqualityCmaintenanceA Model Context Protocol (MCP) server that provides intelligent access to PowerPlatform/Dataverse entities and records. This tool offers context-aware assistance, entity exploration and metadata access.38990 npm45MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables CRUD operations and querying on Microsoft Dataverse through natural language.MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that lets Claude and any other MCP-compatible client work with an OpenText AppWorks Platform tenant in plain English.MIT
- FlicenseNot gradedqualityCmaintenanceMCP server that integrates with Microsoft Dynamics 365 Business Central, enabling querying of customers, items, and sales orders through natural language commands in Claude Desktop.10-