Skip to content
Back to search

d365fo-mcp-server

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

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/dynamics365ninja/d365fo-mcp-server with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/dynamics365ninja/d365fo-mcp-server'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/dynamics365ninja--d365fo-mcp-server/badge.svg)](/listings/dynamics365ninja--d365fo-mcp-server)

HTML

<a href="/listings/dynamics365ninja--d365fo-mcp-server"><img src="/api/listings/dynamics365ninja--d365fo-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

> **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](https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/get-started/whats-new-platform-updates-10-0-49)

**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](docs/QUICK_START.md)**

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 129 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # D365 F&O MCP Server
  2. <div align="center">
  3. **22 AI tools that know every X++ class, table, form, and EDT in your D365FO codebase**
  4. [![npm](https://img.shields.io/npm/v/d365fo-mcp.svg?logo=npm&color=cb3837)](https://www.npmjs.com/package/d365fo-mcp)
  5. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
  6. [![Node.js](https://img.shields.io/badge/node-%3E%3D24.0.0-brightgreen.svg)](https://nodejs.org/)
  7. [![TypeScript](https://img.shields.io/badge/TypeScript-7.0-blue.svg)](https://www.typescriptlang.org/)
  8. [![Tests](https://img.shields.io/badge/tests-5000%2B-brightgreen.svg)](docs/TESTING.md)
  9. <!-- coverage-badge:start -->
  10. [![Core coverage](https://img.shields.io/badge/core_coverage-100%25-brightgreen.svg)](eval/COVERAGE.md) [![Total coverage](https://img.shields.io/badge/total_coverage-100%25-lightgrey.svg)](eval/COVERAGE.md)
  11. <!-- coverage-badge:end -->
  12. *Grounded AI development for Dynamics 365 Finance & Operations — works with GitHub Copilot and Claude Code*
  13. [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_d365fo-0098FF?style=flat-square&logo=githubcopilot&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=d365fo&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22d365fo_server_url%22%2C%22description%22%3A%22D365FO%20MCP%20server%20URL%20(e.g.%20https%3A%2F%2Fyour-server.azurewebsites.net%2Fmcp%2F)%22%7D%5D&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22%24%7Binput%3Ad365fo_server_url%7D%22%7D)
  14. [![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install_d365fo-24bfa5?style=flat-square&logo=githubcopilot&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=d365fo&quality=insiders&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22d365fo_server_url%22%2C%22description%22%3A%22D365FO%20MCP%20server%20URL%20(e.g.%20https%3A%2F%2Fyour-server.azurewebsites.net%2Fmcp%2F)%22%7D%5D&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22%24%7Binput%3Ad365fo_server_url%7D%22%7D)
  15. [![Add to Cursor](https://img.shields.io/badge/Cursor-Add_d365fo-000000?style=flat-square&logo=cursor&logoColor=white)](https://cursor.com/install-mcp?name=d365fo&config=eyJ1cmwiOiJodHRwczovL3lvdXItc2VydmVyLmF6dXJld2Vic2l0ZXMubmV0L21jcC8ifQ%3D%3D)
  16. *These connect an editor to a server that is already deployed — see [Quick Start](#quick-start) if you still need to set one up.*
  17. </div>
  18. ---
  19. ## Why
  20. 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.
  21. 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.
  22. ![Solution Architecture](docs/img/solution-architecture-diagram.svg)
  23. | Task | Without this server | With this server |
  24. |------|--------------------|------------------|
  25. | Method signatures | Guessed → compile errors | Exact, from your codebase |
  26. | Existing CoC wrappers | Manual AOT search | `extension_info(mode="coc")` in < 50 ms |
  27. | New forms | Hand-written XML, broken patterns | Cloned from reference forms, validated against the pattern catalog |
  28. | Labels | Hardcoded strings | Right `@SYS`/`@MODULE` key found instantly |
  29. | Security chains | Hours of manual tracing | Role → Duty → Privilege → Entry Point in one call |
  30. | Generated code | Hallucinated fields and types | Every reference proven against the index, gated before write |
  31. ---
  32. ## Capabilities
  33. | Feature | Description |
  34. |---|---|
  35. | 🔍 **Full-codebase intelligence** | 580K+ symbols indexed: classes, tables, forms, EDTs, enums, labels (20M+ rows), security artifacts — FTS5 search in < 10 ms |
  36. | 🛡️ **Grounded generation** | Fail-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 |
  37. | 🧩 **Form pattern engine** | Complete 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 |
  38. | ✍️ **Safe metadata writes** | C# 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 |
  39. | 🏗️ **SDLC integration** | MSBuild 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](docs/AOS_RUNTIME_RESTART.md) |
  40. | 🗄️ **Optional AxDB SQL** | Off 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](docs/AXDB_SQL.md) |
  41. | ⏱️ **Optional performance trace** | Off 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](docs/TRACE.md) |
  42. | 📐 **X++ knowledge base** | Queryable rules: select grammar, CoC authoring, financial dimensions, the posting engine (`LedgerVoucher`), number sequences, `SysExtension`, Electronic Reporting, AX2012→D365FO migration — prevents deprecated APIs |
  43. ### Pattern-grounded form development
  44. 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:
  45. ```mermaid
  46. flowchart LR
  47. A["object_patterns<br/>(domain=form, action=analyze)"] --> B["object_patterns<br/>(domain=form, action=spec)"]
  48. B --> C["generate_object<br/>objectType=form, cloneFrom"]
  49. C --> D["object_patterns<br/>(domain=form, action=validate) FP001–FP011"]
  50. D -->|clean| E["d365fo_file<br/>(action=create) write + project"]
  51. D -->|errors| C
  52. ```
  53. 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.
  54. ---
  55. ## Quick Start
  56. > **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](https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/get-started/whats-new-platform-updates-10-0-49)
  57. **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:
  58. ```powershell
  59. irm https://raw.githubusercontent.com/dynamics365ninja/d365fo-mcp-server/main/install.ps1 | iex
  60. ```
  61. Already have Node.js 24+? Then the one-liner has nothing to bootstrap and you can skip it:
  62. ```powershell
  63. npm install -g d365fo-mcp
  64. d365fo-mcp setup
  65. ```
  66. 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.
  67. **Your team already runs a shared server?** Then you install nothing — point your editor at it:
  68. ```powershell
  69. npx d365fo-mcp connect https://your-server.azurewebsites.net
  70. ```
  71. 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](docs/QUICK_START.md)**
  72. ---
  73. ## Azure Deployment
  74. One shared instance for the whole team — the metadata index lives in Blob Storage and downloads automatically on startup.
  75. [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fdynamics365ninja%2Fd365fo-mcp-server%2Frefs%2Fheads%2Fmain%2Finfrastructure%2Fazuredeploy.json)
  76. Deployment guide: [docs/SETUP_AZURE.md](docs/SETUP_AZURE.md) — includes CI/CD pipeline automation
  77. ---
  78. ## Documentation
  79. | Getting started | Reference | Operations |
  80. |-----------------|-----------|------------|
  81. | [Quick Start](docs/QUICK_START.md) — connect or install | [All 22 tools](docs/MCP_TOOLS.md) | [Azure deployment](docs/SETUP_AZURE.md) |
  82. | [Setup scenarios A–F](docs/SETUP.md) | [`.mcp.json` reference](docs/MCP_CONFIG.md) | [DevOps pipelines](docs/SETUP_AZURE.md#azure-devops-pipelines) |
  83. | [Claude Code setup](docs/SETUP.md#claude-code-cli) | [Configuration](docs/CONFIGURATION.md) | [Testing](docs/TESTING.md) |
  84. | [Usage examples](docs/USAGE_EXAMPLES.md) — real tool chains | [Architecture](docs/ARCHITECTURE.md) | [Custom / ISV models](docs/CUSTOM_EXTENSIONS.md) |
  85. | [Changelog](CHANGELOG.md) | [Knowledge authoring](docs/KNOWLEDGE_AUTHORING.md) | [Coverage](eval/COVERAGE.md) — what the badge counts |
  86. | [Backlog](docs/BACKLOG.md) — deferred work | [New tool checklist](docs/NEW_TOOL_CHECKLIST.md) | [Eval loop](docs/AGENT_EVAL_LOOP.md) — the self-improvement harness |
  87. ## License
  88. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.