D365fo MCP Server

by dynamics365ninja• 167•• Scanned•Claim this listing•Request removal
Cloud Infrastructureazureclaude codecode completiond365fodynamics 365

Exposes MCP tools that prove every method, field, label and form pattern against your real metadata before the AI writes code.

D365fo MCP Server is an open-source mcp server by dynamics365ninja, written mainly in TypeScript, with 167 GitHub stars and the MIT license. Its code was last updated Nov 1, 2026. The latest npm release is d365fo-mcp 1.24.0, published Nov 12, 2026, with 475 downloads last week.

D365 F&O MCP Server

<div align="center">

22 AI tools that know every X++ class, table, form, and EDT in your D365FO codebase

npm License: MIT Node.js TypeScript Tests

<!-- coverage-badge:start -->

Core coverage Total coverage

<!-- coverage-badge:end -->

Grounded AI development for Dynamics 365 Finance & Operations — works with GitHub Copilot and Claude Code

Install in VS Code Install in VS Code Insiders Add to Cursor

These connect an editor to a server that is already deployed — see Quick Start if you still need to set one up.

</div>

Why

AI assistants excel at C#, Python, and JavaScript. X++ is different: your D365FO codebase is private, deeply customized, and invisible to every model — so AI confidently generates code that doesn't compile.

This server pre-indexes your entire D365FO installation (580 000+ symbols across standard, ISV, and custom models) and exposes it as 22 specialized MCP tools (axdb_sql and trace_d365fo only once configured). Every signature, every CoC wrapper, every label, every form pattern — verified against your real metadata before the AI writes a single line.

Solution Architecture

TaskWithout this serverWith this server
Method signaturesGuessed → compile errorsExact, from your codebase
Existing CoC wrappersManual AOT searchextension_info(mode="coc") in < 50 ms
New formsHand-written XML, broken patternsCloned from reference forms, validated against the pattern catalog
LabelsHardcoded stringsRight @SYS/@MODULE key found instantly
Security chainsHours of manual tracingRole → Duty → Privilege → Entry Point in one call
Generated codeHallucinated fields and typesEvery reference proven against the index, gated before write

Capabilities

FeatureDescription
🔍 Full-codebase intelligence580K+ symbols indexed: classes, tables, forms, EDTs, enums, labels (20M+ rows), security artifacts — FTS5 search in < 10 ms
🛡️ Grounded generationFail-closed gates: prepare issues grounding tokens, validate_code(mode="references") proves every identifier, validate_code(mode="syntax") enforces best practices — hallucinated code never reaches disk
🧩 Form pattern engineComplete catalog of Microsoft form patterns and sub-patterns: recommends the right pattern, clones reference forms with datasource re-binding, deterministically expands patterns that have no reference form, auto-repairs a form's missing required controls, validates structure and blocks invalid writes
✍️ Safe metadata writesC# bridge uses Microsoft's own IMetadataProvider wherever it can express the object; the few types and ops it cannot go through structured XML writers with ambiguity guards — never blind string replacement. Automatic .rnrproj registration, one-call undo
🏗️ SDLC integrationMSBuild compilation with structured diagnostics, DB sync, xppbp best practices, SysTestRunner — all from chat. Optional restartAos: true refreshes the matching local IIS/IIS Express runtime after a successful build and requested sync. Runtime restart
🗄️ Optional AxDB SQLOff by default and not even published until configured: axdb_sql runs read-only, parameterized queries against AxDB on the development VM, so the agent can check what the code actually persisted. Windows authentication; one SELECT checked on the parsed T-SQL tree, inside a transaction that is always rolled back; no result cache. Setup
⏱️ Optional performance traceOff by default and not published until enabled: trace_d365fo captures the AOS's ETW events (X++ method enter/exit, SQL latency) on the development VM while the agent — or you — reproduce a slow scenario, and analyses the capture: where the time goes per method, which statements run thousands of times from one caller. No timer code added to the application; parameter values never returned. Setup and accuracy
📐 X++ knowledge baseQueryable rules: select grammar, CoC authoring, financial dimensions, the posting engine (LedgerVoucher), number sequences, SysExtension, Electronic Reporting, AX2012→D365FO migration — prevents deprecated APIs

Pattern-grounded form development

Forms are the hardest artifact to generate correctly — each pattern dictates required containers, ordering, and allowed sub-patterns. The form pattern engine makes it a guided pipeline:

flowchart LR
    A["object_patterns<br/>(domain=form, action=analyze)"] --> B["object_patterns<br/>(domain=form, action=spec)"]
    B --> C["generate_object<br/>objectType=form, cloneFrom"]
    C --> D["object_patterns<br/>(domain=form, action=validate) FP001–FP011"]
    D -->|clean| E["d365fo_file<br/>(action=create) write + project"]
    D -->|errors| C

Structural violations (wrong order, missing container, disallowed control) block the write — recommendations only warn. Mined pattern statistics from your own environment ground every suggestion in reality.


Quick Start

From D365FO platform update 10.0.49 (PU74), Visual Studio 2026 is the supported IDE for X++ development — Microsoft no longer supports VS 2022. Earlier platform versions still use VS 2022 ≥ 17.14. Details

Installing on your own D365FO VM — the usual case. One line in PowerShell installs Node.js if it is missing, installs the server from npm, and runs the setup wizard, which asks where the index should live and builds the C# bridge for you:

irm https://raw.githubusercontent.com/dynamics365ninja/d365fo-mcp-server/main/install.ps1 | iex

Already have Node.js 24+? Then the one-liner has nothing to bootstrap and you can skip it:

npm install -g d365fo-mcp
d365fo-mcp setup

Re-running either is safe. An installation made before the npm package existed is a git checkout, and both are left exactly where they are and updated in place.

Your team already runs a shared server? Then you install nothing — point your editor at it:

npx d365fo-mcp connect https://your-server.azurewebsites.net

Both paths in full — prerequisites, editor configuration for every scenario, the required instruction file, and how to verify grounding actually works: docs/QUICK_START.md


Azure Deployment

One shared instance for the whole team — the metadata index lives in Blob Storage and downloads automatically on startup.

Deploy to Azure

Deployment guide: docs/SETUP_AZURE.md — includes CI/CD pipeline automation


Documentation

Getting startedReferenceOperations
Quick Start — connect or installAll 22 toolsAzure deployment
Setup scenarios A–F.mcp.json referenceDevOps pipelines
Claude Code setupConfigurationTesting
Usage examples — real tool chainsArchitectureCustom / ISV models
ChangelogKnowledge authoringCoverage — what the badge counts
Backlog — deferred workNew tool checklistEval loop — the self-improvement harness

License

MIT

D365fo MCP Server alternatives

View more →

Similar mcp servers in Cloud Infrastructure, ranked by GitHub stars. Compare licence, recent activity and scan status before you choose.

NameStarsLicenceLast updatedScan
D365fo MCP Server (this page)
dynamics365ninja
167MITNov 1, 2026Scanned, no flagged issues
TREK
liketrek
15kAGPL-3.0Nov 1, 2026Scanned, no flagged issues
MCP
awslabs
9.9kApache-2.0Oct 31, 2026Scanned, no flagged issues
MCP Context Forge
IBM
4.7kApache-2.0Oct 30, 2026Scanned, no flagged issues
Mcpo
open-webui
4.4kMITMay 17, 2026Scanned, no flagged issues
Lean Ctx
yvgude
3.9kApache-2.0Oct 31, 2026Scanned, no flagged issues