D365 Warehouse Operations
FreeNot checkedBridges Microsoft Dynamics 365 Supply Chain Management warehouse operations to AI agents.
About
Bridges Microsoft Dynamics 365 Supply Chain Management warehouse operations to AI agents.
README
A Node.js-based Model Context Protocol (MCP) server that connects your warehouse operations in Microsoft Dynamics 365 Supply Chain Management (D365 SCM) to AI agents.
This server runs on Azure Web App and exposes warehouse operations as AI-callable tools:
readOpenLines— Get open outbound pick ordersconfirmWork— Confirm completed warehouse work
🚀 Overview
This project acts as a bridge between:
- AI agents in Azure AI Foundry or Copilot Studio
- D365 SCM warehouse APIs (MHAX)
- MCP tool execution layer on Azure Web App It enables AI-driven warehouse operations like:
- Reading pick work queues from D365
- Confirming warehouse work execution via AI
- Automating logistics decisions in real-time
🏗️ Architecture
Warehouse User (Teams / App)
↓
Azure AI Foundry Agent or Copilot Studio Agent
↓
MCP Server (Azure Web App)
↓
D365 SCM (MHAX / REST APIs)
📦 Features
✅ MCP Streamable HTTP server — Compatible with Copilot Studio & Azure AI Foundry
✅ OAuth 2.0 client credentials — Secure D365 authentication
✅ D365 SCM integration — Direct access to warehouse APIs
✅ Azure App Service ready — Deploy in minutes
✅ Session-based execution — Stateful MCP sessions
✅ REST fallback endpoints — Test with Postman or REST Client
✅ Secure configuration — Environment-based secrets
🧰 Prerequisites
Required tools
- Node.js 22+
- Git
- Azure CLI — for deployment
- VS Code with Azure App Service extension
Azure & Copilot Studio requirements
- Azure subscription or Microsoft 365 with Copilot Studio
- Permission to create:
- App Registrations (Azure AD)
- App Services (Azure Web App)
- Access to D365 SCM environment with admin rights
📁 Project Structure
src/
├── server.js (Main MCP server)
├── tools/
│ ├── registry.js (Tool catalog)
│ ├── readLines.js (Tool: readOpenLines)
│ └── confirmWork.js (Tool: confirmWork)
├── auth/
│ └── d365Auth.js (OAuth 2.0 token management)
└── middleware/
└── validate.js (Request validation)
.env (Your secrets - DO NOT COMMIT)
.env.example (Template)
package.json
test.http (REST Client test file)
⚙️ Installation
git clone https://github.com/<your-org>/<repo>.git
cd <repo>
npm install
🔐 Environment Configuration
Create .env file
cp .env.example .env
Required variables
D365_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
D365_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
D365_CLIENT_SECRET=your-secret-value-here
D365_BASE_URL=https://yourcompany.operations.dynamics.com
PORT=3000
SERVER_API_KEY=your-generated-key-optional
Variable reference
| Variable | Description | Where to get it |
|---|---|---|
D365_TENANT_ID |
Azure AD tenant ID | Azure Portal → Azure Active Directory → Overview |
D365_CLIENT_ID |
App registration client ID | Azure Portal → App Registrations → Your app |
D365_CLIENT_SECRET |
OAuth secret | Azure Portal → App Registrations → Certificates & secrets |
D365_BASE_URL |
D365 environment URL | Your D365 domain (no trailing slash) |
SERVER_API_KEY |
Optional security key | Generate: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" |
🔑 Azure App Registration Setup
Create an app in Azure Portal:
Steps:
- Go to Azure Portal → Azure Active Directory → App registrations → + New registration
- Fill in details and register
- Copy:
- Tenant ID (from Overview)
- Client ID (from Overview)
- Go to Certificates & secrets → + New client secret → copy Value
- Go to API permissions → + Add a permission
- Search: Dynamics ERP
- Select: Microsoft Dynamics ERP
- Check: AX.FullAccess
- Click: Grant admin consent ✓
🏢 D365 Configuration
In Microsoft Dynamics 365:
- Log in as admin
- Go to: Azure Active Directory applications
- Click: + New
- Paste your Client ID
- Set User ID to a service account
- Click: Save
▶️ Run Locally
npm start
Expected output:
✅ Startup: D365 OAuth credentials verified.
🚀 MCP Server v3.1.0 listening on port 3000
Verify it works:
curl http://localhost:3000/health
Response:
{
"status": "healthy",
"server": "RJ D365 MHAX MCP Server",
"version": "3.1.0"
}
☁️ Deploy to Azure Web App
Option 1: From VS Code (Easiest)
- Install Azure App Service extension
- Sign in to Azure
- Press Ctrl+Shift+P → "Azure App Service: Deploy to Web App"
- Select folder → subscription → Web App
Option 2: Azure CLI
# Create Web App
az webapp create \
--name your-mcp-app-name \
--resource-group your-resource-group \
--plan your-app-service-plan \
--runtime "NODE:22-lts"
# Deploy
zip -r deploy.zip . -x "node_modules/*" ".env" ".git/*"
az webapp deployment source config-zip \
--resource-group your-resource-group \
--name your-mcp-app-name \
--src deploy.zip
⚙️ Azure Web App Configuration
In Azure Portal → Your Web App:
Application Settings
Add these environment variables:
D365_TENANT_ID= your valueD365_CLIENT_ID= your valueD365_CLIENT_SECRET= your valueD365_BASE_URL= your valueWEBSITE_NODE_DEFAULT_VERSION= ~22
General Settings
- Startup Command:
node src/server.js - Always On: Enable (required for MCP sessions)
- Node Version: 22 LTS
🔗 MCP Endpoint
After deployment, your MCP server is available at:
https://your-mcp-app-name.azurewebsites.net/mcp
Use this URL when connecting to:
- Azure AI Foundry Agents
- Copilot Studio
🔌 Connect to Agents
Azure AI Foundry
- Go to: Build → Agents → Your agent
- Tools → Add MCP tool
- Enter URL:
https://your-app.azurewebsites.net/mcp - Click: Create
- Ref:https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/tools/model-context-protocol?pivots=java
Copilot Studio
- Go to: Tools → Add a tool → New tool → Model Context Protocol
- Fill in:
- Name:
RJ D365 MCP Server - Description:
Reads pick orders and confirms warehouse work from D365 - URL:
https://your-app.azurewebsites.net/mcp
- Name:
- Click: Create
- Ref: https://learn.microsoft.com/en-us/microsoft-copilot-studio/mcp-add-existing-server-to-agent
🧪 Testing
Health check
curl https://your-app.azurewebsites.net/health
List tools
curl https://your-app.azurewebsites.net/tools
Installing D365 Warehouse Operations
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/granjan7779/rj-mcp-d365-server-2FAQ
Is D365 Warehouse Operations MCP free?
Yes, D365 Warehouse Operations MCP is free — one-click install via Unyly at no cost.
Does D365 Warehouse Operations need an API key?
No, D365 Warehouse Operations runs without API keys or environment variables.
Is D365 Warehouse Operations hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install D365 Warehouse Operations in Claude Desktop, Claude Code or Cursor?
Open D365 Warehouse Operations on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
by modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
by xuzexin-hzCompare D365 Warehouse Operations with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All ai MCPs
