← Back to directory
D

D365 F&O MCP Server

Community
AI tools grounded in real metadata for Dynamics 365 Finance & Operations
GitHub source repository ↗
★ 134 Stars Category · Dev Tools Popular Source revision 2426920a7955
57FMRS · C
Reliability
8/20
Security and permissions
9/20
Maintenance
12/20
Documentation
15/20
Setup experience
13/20

This server provides strong tooling to ground AI code generation in real metadata, aiming to dramatically reduce compilation errors and improve code quality in X++. It offers features like pattern validation, safe writes, and security tracing. However, it requires a live D365FO environment and Node.js 24+, and has a steep learning curve.

Read the FMRS scoring method →

This MCP server pre-indexes your entire D365FO installation (580,000+ symbols across standard, ISV, and custom models) and exposes it via 26 specialized MCP tools. It ensures AI-generated code is based on real method signatures, fields, labels, and form patterns, reducing compilation errors and hallucinated code. It supports guided form pattern development, safe metadata writes, SDLC integration (MSBuild, DB sync, best practices), and a queryable X++ knowledge base.

Tools

extension_info
Retrieves extension info, including CoC wrappers, with mode 'coc'.
object_patterns
Analyzes or validates form patterns, with domain 'form' and actions 'analyze', 'spec', 'validate'.
prepare
Issues grounding tokens to ensure generated code is based on real metadata.
validate_code
Validates code references (mode 'references') or syntax (mode 'syntax').
generate_object
Generates objects by cloning from reference forms, with objectType 'form'.
d365fo_file
Creates or modifies metadata files, with action 'create', and registers them in the project.

Setup

On a D365FO VM, run as Administrator in PowerShell: irm https://raw.githubusercontent.com/dynamics365ninja/d365fo-mcp-server/main/install.ps1 | iex. Alternatively, if Node.js 24+ is installed, run npm install -g d365fo-mcp and d365fo-mcp setup. For a shared server, run npx d365fo-mcp connect https://your-server.azurewebsites.net.

Fit and risk

Best for

  • AI-assisted development for Dynamics 365 Finance & Operations
  • X++ developers looking to reduce compilation errors
  • Teams using Claude Code, GitHub Copilot, or Cursor

Not for

  • Non-D365FO projects
  • Scenarios where AI should not reference actual metadata
  • Those unfamiliar with MCP or X++ development

Required permissions

  • Read access to D365FO metadata index
  • Write access to metadata objects (via C# bridge or XML writers)
  • Ability to run MSBuild and DB sync in development environment
  • Install Node.js and npm packages if not present

Risks and side effects

  • Code generation still requires human review despite gates
  • Metadata index may expose sensitive information if deployed on shared server
  • Changing D365FO platform requires updates to server for compatibility

Troubleshooting

  1. Check Node.js version (requires 24+)
  2. Verify server URL and MCP configuration
  3. Ensure metadata index is up to date
  4. Check that C# bridge build succeeded

Use cases

Verify AI-generated X++ code references and method signatures
Automatically clone reference forms and validate against Microsoft patterns
Find the correct label key (@SYS or @MODULE)
Trace security chains (Role → Duty → Privilege → Entry Point)
Run MSBuild compilation and DB sync from chat

Supported clients

Claude DesktopFull support
GitHub CopilotFull support
Claude CodeFull support
CursorFull support