d365fo
🚀 MCP server for Dynamics 365 Finance & Operations with standard and custom indexed X++ objects. Provides IntelliSense-like code navigation, intelligent EDT suggestions, AI-driven table/form generation, and pattern-based code completion for GitHub Copilot integration.
claude mcp add --transport stdio dynamics365ninja-d365fo-mcp-server npm run dev \ --env CUSTOM_MODELS="path/to/custom/models" \ --env PACKAGES_PATH="path/to/d365fo/packages"
How to use
This MCP server for Dynamics 365 F&O indexes your D365FO codebase and exposes 41 specialized tools to GitHub Copilot and local clients. The server runs locally (default at http://localhost:3000) and serves an MCP API with fast, in-process lookups for symbols, types, methods, and labels derived from your D365FO installation. You can use the included Copilot integration workflow by enabling the MCP server in your editor and pointing Copilot to the server’s URL. The 41 tools cover categories like Search & Discovery, Code Generation, Object Inspection, Smart Object Creation, Security & Extensions, and Label Management, enabling you to quickly query symbol information, generate code patterns, inspect objects, and manage labels. Typical workflows include asking for method signatures, locating where a class is used, generating event handlers, or creating a SysOperation batch job pattern tailored to your environment. The server is designed to respond to common prompts in under milliseconds to keep Copilot’s code generation iterative and accurate, reducing manual AOT searches and ensuring the code aligns with your actual D365FO installation. To use it, extract metadata from your D365FO environment, build the SQLite index, and run the dev server as described in the Quick Start section, then configure your editor’s MCP client to point to http://localhost:3000/mcp/ and provide your workspace context (paths to your model/workspace) via .mcp.json guidance as shown in the docs.
How to install
Prerequisites:
- Node.js v24.x or newer installed on your system
- Git installed
- Access to a D365FO environment for metadata extraction (XML) and index generation
Installation steps:
- Clone the repository and install dependencies:
git clone https://github.com/dynamics365ninja/d365fo-mcp-server.git
cd d365fo-mcp-server
npm install
- Prepare environment and metadata:
- Copy example env if needed and fill paths to your D365FO packages and models:
cp .env.example .env
- Set PACKAGES_PATH and CUSTOM_MODELS in .env or via the mcp_config env block as appropriate for your setup.
- Extract metadata and build index:
npm run extract-metadata
npm run build-database
- Run the MCP server:
npm run dev
- Verify the server is listening (defaults to http://localhost:3000):
curl -I http://localhost:3000/mcp/
Note: The Quick Start section in the README provides a complete, example workflow including cloning, installing, extracting metadata, building the database, and starting the server. Adjust PACKAGES_PATH and CUSTOM_MODELS to point to your actual D365FO installation directories.
Additional notes
Tips & common issues:
- Ensure your PACKAGES_PATH points to the root of your D365FO packages directory and that CUSTOM_MODELS is set to any custom label or model definitions you rely on.
- The first metadata extraction and indexing can take a long time (minutes to tens of minutes depending on environment). Monitor the progress with logs produced by npm scripts.
- If Copilot shows stale or missing results, validate that the SQLite index was rebuilt after any major environment changes; a full rebuild is often required after major D365FO updates.
- The MCP API URL path is typically /mcp/; configure this in your editor’s Copilot settings and in any local .mcp.json workspace configuration.
- If you upgrade Node.js, re-install dependencies (npm install) to ensure compatibility with TypeScript and tooling versions.
- Environment variables can be extended with additional placeholders for your CI/CD or local development workflows as described in docs/MCP_CONFIG.md.
Related MCP Servers
skills
Skills, MCP servers, Custom Agents, Agents.md for SDKs to ground Coding Agents
Security-Detections
MCP to help Defenders Detection Engineer Harder and Smarter
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
mcp-container-ts
This is a quick start guide that provides the basic building blocks to set up a remote Model Context Protocol (MCP) server using Azure Container Apps. The MCP server is built using Node.js and TypeScript, and it can be used to run various tools and services in a serverless environment.
drawio
A Model Context Protocol (MCP) server for programmatic diagram generation using Draw.io (Diagrams.net). This server generates Draw.io XML directly — no browser extension or Draw.io instance required.