by dynamics365ninja
Provides IntelliSense‑like navigation, AI‑driven table and form generation, and pattern‑based code completion for Dynamics 365 Finance & Operations X++ development, exposing a searchable metadata index to GitHub Copilot.
D365 F&O MCP Server indexes every X++ class, table, method, enum, EDT and related metadata from both standard and custom D365FO models (over 580,000 symbols). It makes this knowledge available to GitHub Copilot and other tools via 54 specialized functions, enabling accurate code generation, navigation, and validation.
dotnet build -c Release in bridge/D365MetadataBridge)..env – set PACKAGES_PATH, CUSTOM_MODELS, etc.).npm install
npm run extract-metadata # pulls XML from D365FO packages
npm run build-database # creates the SQLite index
npm run dev
.mcp.json file (global or per‑solution) that points to the local server and supplies workspace paths. Example:
{
"servers": {
"d365fo-local": {
"command": "node",
"args": ["K:/d365fo-mcp-server/dist/index.js"],
"env": {
"MCP_SERVER_MODE": "write-only",
"D365FO_SOLUTIONS_PATH": "K:/VSProjects/MySolution",
"D365FO_WORKSPACE_PATH": "K:/AosService/PackagesLocalDirectory/YourPackage/YourModel"
}
}
}
}
sync.exe, SysTestRunner, xppbp.exe.@SYS/@MODULE keys.Q: Do I need the C# bridge on Linux? A: The bridge is required only for write operations on Windows VMs where D365FO runs. Read‑only queries work without it.
Q: Can I run the server on Azure? A: Yes. Deploy the repository using the provided ARM template; the server will download the SQLite database from Blob storage on startup.
Q: How large is the indexed database? A: Approximately 2.5–3.5 GB for symbols and labels (excluding optional unit‑test models).
Q: Is any source code sent to GitHub Copilot? A: No. The server stays within your environment; Copilot only receives lookup results via the MCP protocol.
Q: How do I update the index after adding new models?
A: Re‑run npm run extract-metadata and npm run build-database, or trigger the Azure DevOps pipeline defined in docs/PIPELINES.md.
54 AI tools that know every X++ class, table, method, and EDT in your D365FO codebase
Built for D365FO developers who write X++ in Visual Studio — not for generic web dev
GitHub Copilot excels at C#, Python, and JavaScript — languages with rich public training data. X++ is different. Your D365FO codebase is private, highly customized, and deeply interconnected: thousands of CoC extensions layered over standard Microsoft code, ISV packages adding their own tables and classes, custom EDTs that drive field validation across dozens of forms. Copilot has never seen any of it.
The result is AI that confidently generates code that doesn't compile: wrong method signatures, missing parameters, fields that don't exist on the table, CoC chains broken because Copilot didn't know an extension already wrapped the method.
This MCP server solves that by pre-indexing your entire D365FO installation — 584,799+ symbols across standard and custom models — and exposing it to Copilot as 54 specialized tools. Before generating any X++ code, Copilot can look up exact method signatures, check what CoC extensions already exist, trace security hierarchies, find label translations, and understand the full shape of your data model. The result is code that compiles on the first try and integrates correctly with your existing customizations.

| Without this server | With this server |
|---|---|
| Copilot guesses method signatures → compile errors | Exact signatures pulled from your actual codebase |
| "Does CustTable.validateWrite() have any CoC wrappers?" requires manual AOT search | find_coc_extensions answers in < 50 ms |
| ISV and custom model extensions invisible to Copilot | All models fully indexed and searchable |
| Security hierarchy takes hours to trace manually | get_security_coverage_for_object traces Role → Duty → Privilege → Entry Point instantly |
| Copilot generates hardcoded strings instead of label references | search_labels finds the right @SYS/@MODULE label key immediately |
| "Which tables reference CustTable?" requires digging through AOT relations | get_table_relations returns every FK relation and cardinality in one call |
| EDT base types and field lengths are a constant lookup | get_edt_details returns the full EDT definition including extends chain |
| Copilot doesn't know which SysOperation framework class to extend | search_classes with a description filter surfaces the right base class |
| New CoC extension may silently duplicate an existing one | find_coc_extensions reveals all existing wrappers before you write a line |
| Menu item to form mapping requires navigating the AOT manually | get_menu_item_details resolves the full path from menu item to form to data source |
Full step-by-step guide with all scenarios: docs/QUICK_START.md
Prerequisites — install required software via d365fo.tools:
Install-D365SupportingSoftware -Name vscode,python,node.js
git clone https://github.com/dynamics365ninja/d365fo-mcp-server.git
cd d365fo-mcp-server
npm install
# Build the C# bridge (required on Windows D365FO VMs for file create/modify)
cd bridge\D365MetadataBridge
dotnet build -c Release
cd ..\.. # Back to repo root
copy .env.example .env # Set PACKAGES_PATH, CUSTOM_MODELS, LABEL_LANGUAGES, ...
npm run extract-metadata # Extract XML from D365FO packages
npm run build-database # Build SQLite index
npm run dev
UDE / Power Platform Tools? Run
npm run select-configinstead of settingPACKAGES_PATHmanually.
1. Enable MCP servers in Copilot at github.com/settings/copilot/features
2. In Visual Studio: Tools → Options → GitHub → Copilot → check Enable MCP server integration in agent mode
3. Create %USERPROFILE%\.mcp.json (covers all solutions on the machine, recommended) or place .mcp.json next to a specific .sln file:
{
"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:\\VSProjects\\MySolution",
"D365FO_WORKSPACE_PATH": "K:\\AosService\\PackagesLocalDirectory\\YourPackageName\\YourModelName"
}
}
}
}
4. Copy the Copilot instruction files so Copilot knows the D365FO workflow rules:
# Place .github in a parent folder shared by all your D365FO solutions, e.g.:
Copy-Item -Path ".github" -Destination "C:\source\repos\" -Recurse
Tip: Visual Studio 2022 searches for
.github\copilot-instructions.mdupward from the solution folder, so one copy in a common parent directory covers all solutions underneath — no need to copy it into every solution separately.
Full config options (UDE paths, explicit projectPath, solutionPath): docs/MCP_CONFIG.md
Host on Azure App Service so the whole team shares one instance — nobody needs the server running locally.

| Resource | Configuration | Monthly cost |
|---|---|---|
| App Service Basic B3 | 4 vCPU, 7 GB RAM | ~$52 |
| Blob Storage | ~2.5–3.5 GB (symbols + labels, without/with UnitTest models) | ~$3 |
| Total | ~$55 / month |
The database downloads from Azure Blob Storage automatically on startup.
Setup guide: docs/SETUP.md · CI/CD pipeline: docs/PIPELINES.md
| File | Contents |
|---|---|
| docs/QUICK_START.md | Start here — 5 steps to get running, all .mcp.json parameters, logging |
| docs/SETUP.md | Detailed installation, configuration, all deployment scenarios |
| docs/MCP_CONFIG.md | .mcp.json reference — workspace paths, UDE, project settings |
| docs/MCP_TOOLS.md | All 54 tools with parameters and example prompts |
| docs/USAGE_EXAMPLES.md | Practical examples: search, CoC, SysOperation, security |
| docs/ARCHITECTURE.md | Technical architecture, dual-database design, cache invalidation |
| docs/BRIDGE.md | C# Metadata Bridge reference — mandatory on Windows VMs for all write operations |
| docs/CUSTOM_EXTENSIONS.md | ISV / custom model configuration |
| docs/PIPELINES.md | Automated metadata extraction via Azure DevOps |
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
{
"mcpServers": {
"d365fo-local": {
"command": "npx",
"args": [
"d365fo-mcp-server"
],
"env": {
"MCP_SERVER_MODE": "write-only",
"D365FO_SOLUTIONS_PATH": "K:\\VSProjects\\MySolution",
"D365FO_WORKSPACE_PATH": "K:\\AosService\\PackagesLocalDirectory\\YourPackageName\\YourModelName"
}
}
}
}claude mcp add d365fo-local npx d365fo-mcp-server