convez.ai
MCP Server
dynamics365ninja

d365fo-mcp-server

dynamics365ninja/d365fo-mcp-server

Ver no GitHub
BomPluginScore · de 0 a 100

🚀 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.

Instalação

$npx convez-ai dynamics365ninja/d365fo-mcp-server

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
173
Forks
68
Acompanhando
14
Saúde
42%
Último commit
há 1 dia
Versão
v1.24.0
Issues abertas
1
Contribuidores
13

README

A tradução para o português deste README ainda está na fila.

D365 F&O MCP Server

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

License: MIT Node.js TypeScript Tests

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

One-click install connects to an already-deployed server — VS Code asks for the URL, Cursor installs a placeholder to edit. Visual Studio & Claude Code: see Quick Start.


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 61 specialized MCP tools. 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 searchfind_coc_extensions 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_change/prepare_create issue grounding tokens, resolve_references proves every identifier, validate_xpp 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, validates structure and blocks invalid writes
✍️ Safe metadata writesC# bridge uses Microsoft's own IMetadataProvider — no string-replacement XML corruption, automatic .rnrproj registration, one-call undo
🏗️ SDLC integrationMSBuild compilation with structured diagnostics, DB sync, xppbp best practices, SysTestRunner — all from chat
📐 X++ knowledge baseQueryable rules: select grammar, CoC authoring, SysDa, FormRun lifecycle, 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["get_form_patterns<br/>(recommend)"] --> B["get_form_pattern_spec<br/>structure + reference forms"]
    B --> C["generate_smart_form<br/>clone + re-bind tables"]
    C --> D["validate_form_pattern<br/>FP001–FP010"]
    D -->|clean| E["create_d365fo_file<br/>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

Pick your path:

PathWhoInstall effort
A — Azure clientTeam member, server already deployed.mcp.json only — 2 minutes
B — Hybrid (recommended for teams)Azure search + local writes on your VMClone + build, no indexing
C/E — LocalSingle developer, everything on the VMClone + build + index (~15 min)

Full walkthrough with all scenarios: docs/QUICK_START.md

# Local / hybrid install (on the D365FO VM)
git clone https://github.com/dynamics365ninja/d365fo-mcp-server.git K:\d365fo-mcp-server
cd K:\d365fo-mcp-server
npm install
cd bridge\D365MetadataBridge; dotnet build -c Release; cd ..\..   # C# bridge — required for writes
npm run build

# Local only — build the metadata index (skip for hybrid)
copy .env.example .env            # set PACKAGES_PATH, CUSTOM_MODELS
npm run extract-metadata
npm run build-database

UDE / Power Platform Tools? Run npm run select-config instead of editing PACKAGES_PATH.

Connect GitHub Copilot

  1. Enable MCP servers in Copilot at github.com/settings/copilot/features
  2. Visual Studio → Tools → Options → GitHub → Copilot → Enable MCP server integration in agent mode
  3. Create %USERPROFILE%\.mcp.json:
{
  "servers": {
    "d365fo-azure": { "url": "https://your-server.azurewebsites.net/mcp/" },
    "d365fo-local": {
      "command": "node",
      "args": ["K:\\d365fo-mcp-server\\dist\\index.js"],
      "env": {
        "MCP_SERVER_MODE": "write-only",
        "D365FO_SOLUTIONS_PATH": "K:\\repos\\MySolution\\projects",
        "D365FO_WORKSPACE_PATH": "K:\\AosService\\PackagesLocalDirectory\\YourPackage\\YourModel"
      }
    }
  }
}
  1. Copy the instruction files into a parent folder of your solutions (one copy covers everything beneath it):
Copy-Item -Path ".github" -Destination "C:\source\repos\" -Recurse

All options: docs/MCP_CONFIG.md

Connect Claude Code

claude mcp add-json --scope user d365fo-mcp-tools '{"type":"http","url":"https://your-server.azurewebsites.net/mcp/","alwaysLoad":true}'
Copy-Item "K:\d365fo-mcp-server\CLAUDE.template.md" "C:\source\repos\CLAUDE.md"

Stdio variant and troubleshooting: docs/CLAUDE_CODE_SETUP.md

Verify

Open the AI chat (Copilot Agent Mode / Claude Code) and ask:

What tables contain "CustAccount" field?

A search tool call returning results from your codebase = you're connected.


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 · CI/CD automation: docs/PIPELINES.md


Documentation

Getting startedReferenceOperations
Quick Start — 5 steps to runningAll 61 toolsAzure deployment
Setup scenarios A–F.mcp.json referenceDevOps pipelines
Claude Code setupArchitectureTesting
Usage examples — real tool chainsC# BridgeCustom / ISV models
Workspace detectionSQLite vs Bridge

License

MIT

Ver o original no GitHub

Bom para

Relacionados