d365-troubleshooter-mcp
v1.0.2
Published
Give your coding agent direct access to Dynamics 365 / Dataverse metadata and web resources through a Model Context Protocol (MCP) server.
Readme
D365 Troubleshooter MCP
Give your coding agent direct access to Dynamics 365 / Dataverse metadata and web resources through a Model Context Protocol (MCP) server.
This server helps with CRM troubleshooting workflows like:
- finding entities quickly,
- checking plugin step registrations for a table,
- searching web resources,
- reading web resource source content.
How it works
- Your MCP client starts this server over stdio.
- The server authenticates with Microsoft Entra ID using app credentials.
- It queries Dynamics 365 Web API (
/api/data/v9.1). - Your AI client can call the exposed tools and use structured output for analysis.
Features
search_entities: Search Dataverse tables by logical or display name.get_entity_plugins: List plugin steps registered for a specific entity.search_webresources: Find web resources by name/display name.get_webresource_content: Read decoded web resource content by ID or name.- Access token caching in
.crm_auth_results.jsonto reduce repeated auth calls.
Requirements
- Node.js 18+ (recommended: latest LTS)
- A Dynamics 365 / Dataverse environment URL
- Microsoft Entra app registration with access to your Dataverse org
- Tenant ID, Client ID, and Client Secret
Required environment variables:
TENANT_IDCLIENT_IDCLIENT_SECRETDYNAMICS_365_URL(example:https://orgname.crm.dynamics.com)
Getting started
Many MCP clients (Cursor, VS Code MCP clients, Claude Desktop-compatible clients) support JSON-based server configuration.
MacOS / Linux
{
"mcpServers": {
"D365 Troubleshooter MCP": {
"command": "npx",
"args": ["-y", "d365-troubleshooter-mcp"],
"env": {
"TENANT_ID": "YOUR_TENANT_ID",
"CLIENT_ID": "YOUR_CLIENT_ID",
"CLIENT_SECRET": "YOUR_CLIENT_SECRET",
"DYNAMICS_365_URL": "https://orgname.crm.dynamics.com"
}
}
}
}Windows
{
"mcpServers": {
"D365 Troubleshooter MCP": {
"command": "cmd",
"args": ["/c", "npx", "-y", "d365-troubleshooter-mcp"],
"env": {
"TENANT_ID": "YOUR_TENANT_ID",
"CLIENT_ID": "YOUR_CLIENT_ID",
"CLIENT_SECRET": "YOUR_CLIENT_SECRET",
"DYNAMICS_365_URL": "https://orgname.crm.dynamics.com"
}
}
}
}Local development
pnpm install
pnpm buildRun from source build:
node dist/index.jsAvailable scripts:
pnpm dev– watch build withtsuppnpm build– production buildpnpm type-check– TypeScript checkpnpm inspect– launch MCP inspector
VS Code extension
A companion VS Code extension exists in vscode-extension/ for local credential configuration and MCP integration.
Notes
- The server uses OAuth client credential flow via
@azure/msal-node. - Auth results are cached in
.crm_auth_results.json. - Keep secrets in your MCP client env configuration (never hardcode them in source).
License
ISC
