D365 F&O MCP Server
An MCP server that knows every class, table and form in your D365FO code and checks X++ signatures before the agent writes code
- 171 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- Writes X++ metadata and files into the project, registers them in .rnrproj and runs MSBuild, database sync and tests
- Optional tools read AxDB and capture an AOS trace, and restartAos restarts the local runtime
Install
- Works in
Manual install
npm install -g d365fo-mcp
d365fo-mcp setupFor a D365FO VM, needs Node.js 24 or newer. The wizard asks where to keep the index and builds the C# bridge.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Writes X++ metadata and files into the project, registers them in .rnrproj and runs MSBuild, database sync and tests
- Optional tools read AxDB and capture an AOS trace, and restartAos restarts the local runtime
This is third-party code. Review the repository files before installing.
What it does
The server pre-indexes a Dynamics 365 Finance and Operations installation, over 580 thousand symbols from standard, ISV and custom models, and gives the agent 22 tools. The agent looks up classes, tables, forms, EDTs, enums, labels and security artifacts, sees Chain of Command wrappers and the role, duty, privilege, entry point chain, and checks every identifier against the index before writing code. Writes are guarded by gates: an issued token proves that a lookup took place, validate_code checks references and syntax, and a C# bridge writes metadata through Microsoft's own IMetadataProvider. Forms are built from the catalog of Microsoft form patterns: the server clones a reference form, validates the FP001–FP010 rules and blocks the write on structural violations. It also runs MSBuild with parsed diagnostics, database sync, xppbp and SysTestRunner, holds an X++ knowledge base, and has two tools that are off by default: axdb_sql for reading AxDB and trace_d365fo for analysing an AOS ETW trace.
Who it is for. X++ developers and technical consultants on Dynamics 365 F&O who write extensions with GitHub Copilot or Claude Code on a development VM.
Good fit when
- The agent invents non-existent X++ methods and the code does not compile
- You need existing Chain of Command wrappers for a standard method across your own and ISV code
- A new form should follow Microsoft patterns strictly, without hand-written XML
- Labels @SYS and @MODULE hide among 20 million rows and finding them by hand is slow
- A role's security chain has to be traced to the entry point in one call
Not a fit when
- Development is not on Dynamics 365 F&O: the server only knows X++ and AOT metadata
- There is no development VM or PackagesLocalDirectory folder, so there is nothing to index
- The machine is short on memory: every stdio process loads an index of about 1.5 GB
Example request
Find all Chain of Command wrappers for SalesFormLetter.run and show which SalesLine table fields are affectedMCP
- Transport
- stdio, http
- Authentication
- API key
Environment variables
D365FO_WORKSPACE_PATH- A path like PackagesLocalDirectory\Package\Model from which the package and model are derived.
DB_PATHrequired- Absolute path to the SQLite symbol index, required in stdio mode.
LABELS_DB_PATHrequired- Absolute path to the labels database, required in stdio mode.
Limitations
Installing on your own machine needs a Windows D365FO VM, Node.js 24 or newer and Visual Studio: Visual Studio 2026 is supported from platform update 10.0.49, earlier it is 2022 version 17.14 or newer. The agent instruction file is mandatory, because the tool-routing rules do not work without it. Metadata writes go only through the C# bridge and validation gates, but the agent still changes the project on disk. The axdb_sql and trace_d365fo tools are not published until configured and work only on a development machine.
How to disable. Remove the d365fo-mcp-tools entry from the client config, for Claude Code run `claude mcp remove d365fo-mcp-tools`. The package is removed with `npm uninstall -g d365fo-mcp`.
FAQ
How do I connect D365FO MCP to Claude Code?
If your team already runs a shared server, run `npx d365fo-mcp connect https://server-address --client claude`. For your own VM install the package with `npm install -g d365fo-mcp` and run `d365fo-mcp setup`.
How is it different from plain code search?
It knows AOT metadata and checks every identifier in generated code against the index before anything is written to disk. Wrong fields and types never reach the project.
Does each developer need a separate install?
No. A team can deploy one server in Azure with the index in Blob Storage and developers connect with the `connect` command. For local work stdio mode on your own VM fits.
Which agents does it work with?
The README targets GitHub Copilot and Claude Code, and VS Code and Cursor have install buttons that attach an already deployed server.
Can the server read the AxDB database?
Yes, but the axdb_sql tool is off by default. Once configured it runs only a single checked SELECT inside a transaction that is always rolled back, on a development machine with Windows authentication.
Discussion
No questions or reviews yet.
Related
MCP serversAn MCP server that lets an agent read files, search code and run commands in a workspace
SAP Fiori MCP Server: Fiori apps with AI
SAP Fiori MCP Server
SAP's official MCP server: an agent creates and edits SAP Fiori elements apps from a plain-language description
A Neo4j graph of 1C configuration metadata and code with MCP tools, a web console and a built-in search agent
AI Finansist: MCP server for 1C
mcp_1c (AI Финансист)
An MCP server, a 1C OData client and a local language model bundled with a Gradio chat for questions about 1C data and uploaded PDFs
An MCP server with 69 tools for .accdb databases: forms, VBA, tables, queries and controls over COM, Windows only
An MCP server for Claude Code: full-text search over multiple 1C XML+BSL configuration exports in a local SQLite FTS5 database
README in short
The README explains why a model needs an index of your own X++ codebase, shows a with-and-without comparison, capabilities and the form development pipeline. It then covers a PowerShell quick start, connecting to a shared server, Azure deployment and links to the docs. MIT licence.