
Dynamics 365
STDIOMCP server for Dynamics 365 integration with tools for managing accounts and opportunities.
MCP server for Dynamics 365 integration with tools for managing accounts and opportunities.
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.
Tool Name | Description | Input | Output |
---|---|---|---|
get-user-info | Fetches information about the currently authenticated user. | None | User details including name, user ID, and business unit ID. |
fetch-accounts | Fetches all accounts from Dynamics 365. | None | List of accounts in JSON format. |
get-associated-opportunities | Fetches opportunities associated with a given account. | accountId (string, required) | List of opportunities in JSON format. |
create-account | Creates a new account in Dynamics 365. | accountData (object, required) containing account details. | Details of the created account in JSON format. |
update-account | Updates an existing account in Dynamics 365. | accountId (string, required), accountData (object, required) containing updated details. | Details of the updated account in JSON format. |
Before setting up the project, ensure you have the following installed:
Follow these steps to set up and run the project locally:
git clone https://github.com/your-repo/dynamics365-mcp-server.git cd dynamics365-mcp-server
npm install
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
npm run build
node build\index.js
You should see the following output:
Dynamics365 MCP server running on stdio...
{ "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
npx @modelcontextprotocol/inspector node build/index.js
Go to 🔍 http://localhost:5173 🚀
Now you can connect to server and terst all the tools!!
If you encounter issues, ensure the following:
console.error("Debugging: Loaded environment variables:", process.env);
Contributions are welcome! Feel free to submit a pull request or open an issue for any bugs or feature requests.
To contribute: