Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

D365 Warehouse Operations

БесплатноНе проверен

Bridges Microsoft Dynamics 365 Supply Chain Management warehouse operations to AI agents.

GitHubEmbed

Описание

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 orders
  • confirmWork — 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:

  1. Go to Azure PortalAzure Active DirectoryApp registrations+ New registration
  2. Fill in details and register
  3. Copy:
    • Tenant ID (from Overview)
    • Client ID (from Overview)
  4. Go to Certificates & secrets+ New client secret → copy Value
  5. 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:

  1. Log in as admin
  2. Go to: Azure Active Directory applications
  3. Click: + New
  4. Paste your Client ID
  5. Set User ID to a service account
  6. 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)

  1. Install Azure App Service extension
  2. Sign in to Azure
  3. Press Ctrl+Shift+P"Azure App Service: Deploy to Web App"
  4. 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 value
  • D365_CLIENT_ID = your value
  • D365_CLIENT_SECRET = your value
  • D365_BASE_URL = your value
  • WEBSITE_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

  1. Go to: BuildAgents → Your agent
  2. Tools → Add MCP tool
  3. Enter URL: https://your-app.azurewebsites.net/mcp
  4. Click: Create
  5. Ref:https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/tools/model-context-protocol?pivots=java

Copilot Studio

  1. Go to: ToolsAdd a toolNew toolModel Context Protocol
  2. Fill in:
    • Name: RJ D365 MCP Server
    • Description: Reads pick orders and confirms warehouse work from D365
    • URL: https://your-app.azurewebsites.net/mcp
  3. Click: Create
  4. 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

from github.com/granjan7779/rj-mcp-d365-server-2

Установка D365 Warehouse Operations

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/granjan7779/rj-mcp-d365-server-2

FAQ

D365 Warehouse Operations MCP бесплатный?

Да, D365 Warehouse Operations MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для D365 Warehouse Operations?

Нет, D365 Warehouse Operations работает без API-ключей и переменных окружения.

D365 Warehouse Operations — hosted или self-hosted?

Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.

Как установить D365 Warehouse Operations в Claude Desktop, Claude Code или Cursor?

Открой D365 Warehouse Operations на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare D365 Warehouse Operations with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории ai