Get started in five steps
You need Business Central online, version 29 or later. Steps 2 to 4 are for an administrator. A user only does step 5.
- Install the appInstall Appfabriek Diagnose from AppSource or from the Business Central admin center. Installing creates nothing yet.
- Give admin consentA Microsoft Entra administrator of your organization opens one link and accepts, so your users can sign in to the MCP server with Claude Code. See Sign-in and consent. Not needed for VS Code and Copilot Studio.
- Run the assisted setupIn Business Central, search for Appfabriek Diagnose and choose Set up for AI assistants. It creates the MCP configuration Appfabriek Diagnose. See The assisted setup.
- Assign permission setsGive
AFB DIAGNOSEto everyone who uses the diagnostics, andAFB DIAG ADMINto whoever runs the setup. See Permission sets. - Connect your assistantCopy the settings the setup shows into Claude Code or VS Code, or add the MCP server in Copilot Studio. Sign in with your own Business Central account. See Connect your assistant.
Then ask, for example: “Make a diagnostic report of this environment.”
Sign-in and consent
Every assistant signs in to the Business Central MCP server with Microsoft Entra ID, as the user. The assistant then has that user's permissions in Business Central, and no more. Microsoft Entra ID does not let clients register themselves, so a client outside Microsoft needs an app registration. You choose one of two ways.
Our app: Appfabriek Diagnose MCP
Appfabriek has a multi-tenant app for MCP clients: Appfabriek Diagnose MCP, client ID d3d37e60-ac80-48fb-8a99-f81fa28df7d4. It is a public client without a secret, from a verified publisher (Rozendom B.V., the company behind Appfabriek). It asks for one delegated permission: Dynamics 365 Business Central Financials.ReadWrite.All, plus sign-in (openid, offline_access). Its redirect URI is http://localhost:33418/callback, the one Claude Code uses.
An administrator with the role Cloud Application Administrator, Application Administrator or Privileged Role Administrator opens this link once, signs in and accepts:
https://login.microsoftonline.com/organizations/adminconsent?client_id=d3d37e60-ac80-48fb-8a99-f81fa28df7d4
Open the consent link. organizations gives consent in the tenant of the account you sign in with. You can also put your tenant ID or domain in its place. After you accept, the browser may go to a localhost address that does not open. That is fine: the consent is saved. You find the app afterwards in the Microsoft Entra admin center under Enterprise apps, where you can also limit who may use it.
Why Financials.ReadWrite.All? It is the permission Microsoft prescribes for the Business Central MCP server. It does not decide what the assistant can do. That is decided by the user's permissions in Business Central and by the MCP configuration, which allows reading only.
Your own Entra app
You can also use an app registration of your own. Follow Microsoft's steps in Connect Business Central MCP Server to non-Microsoft hosts:
- Register an app in the Microsoft Entra admin center (App registrations › New registration).
- Add the redirect URI of your client under Authentication, platform Mobile and desktop applications. For Claude Code that is
http://localhost:33418/callback. The port must matchcallbackPortin the client settings. - Under API permissions, add Dynamics 365 Business Central › Delegated permissions ›
Financials.ReadWrite.All, and grant admin consent. - Enter its client ID in step 2 of the assisted setup, in the field MCP client app (client ID). The settings the setup shows then use your client ID.
VS Code and Copilot Studio
VS Code with GitHub Copilot and Copilot Studio sign in with an app that Microsoft registered in advance. They need neither our app nor yours.
The assisted setup
Open it from the page Appfabriek Diagnose with Set up for AI assistants, or from the assisted setup list: Set up Appfabriek Diagnose for AI assistants. You need the permission set AFB DIAG ADMIN (or SUPER). Run it as a person: a service-to-service (app) user cannot register the client app.
- Welcome and costsWhat it sets up. Microsoft can charge for use of the Business Central MCP server by AI agents; check the Business Central licensing guide before you allow agents.
- OptionsMCP client app (client ID): keep
d3d37e60-ac80-48fb-8a99-f81fa28df7d4, or enter your own. Allow data queries: on by default; turns on Microsoft's Data Query Tools. Choose Set up. - ReadyThe settings for Claude Code (
.mcp.json) and VS Code (.vscode/mcp.json), with your tenant, environment and company filled in.
What Set up does:
- creates the MCP configuration Appfabriek Diagnose (description Read-only diagnostics of Business Central by Appfabriek.), or repairs it if it is already there;
- turns on API tools and adds the seven API pages of the app, each with Allow Read only;
- turns Microsoft's Data Query Tools (preview) on or off, as you chose;
- activates the configuration;
- records the client app as Appfabriek Diagnose MCP on the page Model Context Protocol (MCP) Server Entra Applications.
The setup only adds what is missing, so you can run it again at any time. Run it in every environment where you want to use the diagnostics. After an update of the app, Business Central adds new API pages to an existing configuration by itself, in a background task.
You find the configuration in Business Central on the page Model Context Protocol (MCP) Server Configurations.
Permission sets
| Permission set | For | Contains |
|---|---|---|
AFB DIAGNOSEAppfabriek Diagnose | everyone who uses the diagnostics, in Business Central or through an assistant | the page, the checks and the seven API pages; read access to the job queue, its log, the change log, error messages, number series, accounting periods, the setup tables, users and permissions, and installed apps |
AFB DIAG ADMINAppfabriek Diagnose Admin | whoever runs the assisted setup | AFB DIAGNOSE, Microsoft's MCP - Admin, and the setup |
Neither set can change data. A user who does not have SUPER can use the diagnostics with AFB DIAGNOSE on top of their normal permissions.
Connect your assistant
All clients connect to https://mcp.businesscentral.dynamics.com. Four headers choose what they see: TenantId, EnvironmentName, Company and ConfigurationName (here always Appfabriek Diagnose). The assisted setup fills them in for the environment and company where you run it. A company name with characters outside ASCII (such as é or ø) comes out as =?base64?…?=; that is how the MCP server expects it.
Claude Code
- Copy the text under Claude Code (.mcp.json) from the last step of the setup.
- Save it as
.mcp.jsonin the folder where you start Claude Code. Is there one already, addbc-diagnoseto itsmcpServers. - Start
claudein that folder and allow the project server when it asks. - Type
/mcp, choosebc-diagnoseand Authenticate. Your browser opens; sign in with your Business Central account. Claude Code receives the sign-in on port 33418, so that port must be free.
The setup shows it on one line. Formatted, it looks like this:
.mcp.json{
"mcpServers": {
"bc-diagnose": {
"type": "http",
"url": "https://mcp.businesscentral.dynamics.com",
"headers": {
"TenantId": "<your tenant ID>",
"EnvironmentName": "<your environment>",
"Company": "<your company>",
"ConfigurationName": "Appfabriek Diagnose"
},
"oauth": {
"clientId": "d3d37e60-ac80-48fb-8a99-f81fa28df7d4",
"callbackPort": 33418
}
}
}
}
With your own Entra app, clientId is your client ID. Install the Claude skill as well: it tells Claude how to use the tools.
VS Code with GitHub Copilot
- Copy the text under VS Code (.vscode/mcp.json) from the last step of the setup.
- Save it as
.vscode/mcp.jsonin your workspace, or paste the server into your user configuration (MCP: Open User Configuration in the Command Palette). - Select Start above
bc-diagnosein the file and sign in with your Business Central account when VS Code asks. - Open GitHub Copilot Chat in Agent mode and ask your question. Under Configure tools you can check that
bc-diagnoseis on.
{
"servers": {
"bc-diagnose": {
"type": "http",
"url": "https://mcp.businesscentral.dynamics.com",
"headers": {
"TenantId": "<your tenant ID>",
"EnvironmentName": "<your environment>",
"Company": "<your company>",
"ConfigurationName": "Appfabriek Diagnose"
}
}
}
}
Keep the headers. Without Company, the MCP server switches to dynamic tool mode and the seven tools no longer appear by name. More in Microsoft's Use Business Central MCP server with Visual Studio Code.
Copilot Studio
- Open your agent in Copilot Studio and go to Tools › Add a tool.
- Add Dynamics 365 Business Central MCP Server. Create a connection and sign in with your Business Central account if it asks.
- Fill in Environment, Company and, under MCP Server Configuration,
Appfabriek Diagnose. - Give the agent instructions. The sections How to build a diagnosis and How to write the report of the Claude skill work well as instructions.
Copilot Studio needs its own licence with Copilot Credits. See Microsoft's Create agents in Copilot Studio that connect to Business Central.
Two environments: sandbox and production
To compare environments, add the MCP server twice, with a different name and a different EnvironmentName. Install the app and run the assisted setup in both environments. Then ask, for example, “Compare the setup of sandbox and production.”
{
"mcpServers": {
"bc-diagnose-sandbox": {
"type": "http",
"url": "https://mcp.businesscentral.dynamics.com",
"headers": {
"TenantId": "<your tenant ID>",
"EnvironmentName": "Sandbox",
"Company": "<your company>",
"ConfigurationName": "Appfabriek Diagnose"
},
"oauth": { "clientId": "d3d37e60-ac80-48fb-8a99-f81fa28df7d4", "callbackPort": 33418 }
},
"bc-diagnose-production": {
"type": "http",
"url": "https://mcp.businesscentral.dynamics.com",
"headers": {
"TenantId": "<your tenant ID>",
"EnvironmentName": "Production",
"Company": "<your company>",
"ConfigurationName": "Appfabriek Diagnose"
},
"oauth": { "clientId": "d3d37e60-ac80-48fb-8a99-f81fa28df7d4", "callbackPort": 33418 }
}
}
}
Use the names of your own environments, as they appear in the Business Central admin center. Sign in to each server once with /mcp.
Claude skill
The skill appfabriek-diagnose tells Claude when to use which tool, how to build a diagnosis (first the findings and the environment, then deeper), how to write the report, how to compare environments, and that it changes nothing. Read or download the skill.
Save it as SKILL.md in a folder appfabriek-diagnose. For yourself, in every project (macOS, Linux):
mkdir -p ~/.claude/skills/appfabriek-diagnose
curl -fsSL https://appfabriek.com/diagnose/skill/SKILL.txt -o ~/.claude/skills/appfabriek-diagnose/SKILL.md
Windows (PowerShell):
New-Item -ItemType Directory -Force "$HOME\.claude\skills\appfabriek-diagnose" | Out-Null
Invoke-WebRequest https://appfabriek.com/diagnose/skill/SKILL.txt -OutFile "$HOME\.claude\skills\appfabriek-diagnose\SKILL.md"
For one project only, and for everyone who works in it: save it as .claude/skills/appfabriek-diagnose/SKILL.md in that project, next to .mcp.json. Start Claude Code again after installing.
The tools
The app has seven API pages (appfabriek/diagnose/v1.0). The MCP server makes a tool of each one, named List_<EntitySet>_PAG<page ID>. All of them only read. A call returns at most 50 rows; the client asks for more with skip and can filter with an OData filter.
| Tool | What it returns |
|---|---|
List_Findings_PAG11366962 | The diagnostic report. Per finding: severity, check, area, title, details, advice, the page where you fix it, and the record. Calculated again on every call. See The checks. |
List_EnvironmentInfo_PAG11366963 | The environment: name, type (Sandbox or Production), tenant, company, user, server time (UTC), work date, Base Application version and Diagnose version. Then every installed app with its version, publisher and app ID. |
List_JobQueueEntries_PAG11366964 | Every job queue entry: object, description, status, error message, user, earliest start, last ready state, when its session started, recurring or not, minutes between runs, category and attempts. Without the parameter string, which can hold secrets. |
List_JobQueueLogEntries_PAG11366965 | The job queue log, newest first: start and end, object, description, status, error message, user and category. |
List_ChangeLogEntries_PAG11366966 | The change log, newest first: when, who, table, field, type of change, old and new value. Secret fields and keys come back as ***. Only filled when the change log is activated. |
List_ErrorMessages_PAG11366967 | Error messages that Business Central kept in an error message register, newest first: when, type, message, additional information, table, field and context. |
List_SetupSnapshot_PAG11366968 | Every normal field of Company Information, General Ledger Setup, Sales & Receivables Setup, Purchases & Payables Setup, Inventory Setup, Warehouse Setup and Change Log Setup, with table and field number. Secrets as ***. |
With Allow data queries on, the assistant also has Microsoft's Data Query Tools: bc_data_find_tables, bc_data_get_table_schema, bc_data_get_table_relations and bc_data_query. They read other tables, within the user's permissions, and cannot change data. They are a preview of Microsoft.
The checks
Every time the findings are read, in Business Central or through a tool, all checks run again. A check only reads. If a check fails, the others still run, and the failure becomes a finding itself.
| Check | Finds | Severity | Fix it on |
|---|---|---|---|
| Failed job queue entries | a job queue entry with status Error, with its error message | Error | Job Queue Entries |
| Stuck job queue entries | a job queue entry In Process whose session started more than 6 hours ago | Warning | Job Queue Entries |
| Job queue errors | runs with status Error in the job queue log in the last 24 hours: the number, and the last failure | Warning | Job Queue Log Entries |
| Recurring jobs on hold | a recurring job queue entry with status On Hold | Info | Job Queue Entries |
| Number series | full: a number series has lines, but none is open | Error | No. Series |
| almost full: on an open line, the last number used has reached the warning number | Warning | ||
| Posting dates | today is outside Allow Posting From and Allow Posting To in General Ledger Setup | Warning | General Ledger Setup |
| users who cannot post today because of their User Setup: the number | Info | User Setup | |
| Accounting periods | there are no accounting periods, or none that starts after today | Warning | Accounting Periods |
| Change log | the change log is not activated | Info | Change Log Setup |
| Users and permissions | enabled users (full, limited or device) without permission sets assigned directly: the number | Info | Users |
| more than 3 users with the permission set SUPER | Info | ||
| Company information | Company Information is not set up, or the company has no name | Warning | Company Information |
| the company has no VAT registration number | Info | ||
| Error messages | error message registers created in the last 24 hours: the number, and the last message | Info | Error Message Register |
Two findings come from the app itself: The check … could not run (Error, with the error in the details), and No problems found (Info) when no check found anything.
Other apps can add checks without changing this one: a value in the enum AFB Diag Check that implements the interface AFB Diag Check, or a subscriber to the event OnAfterCollect of codeunit AFB Diag Findings that calls Findings.Add. Such findings show up everywhere the others do. A check must only read.
The page in Business Central
Search for diagnose and open Appfabriek Diagnose. It shows the same findings as the tool, worst first: errors in red, warnings in amber. The columns are Severity, Area, Title, Details and Advice.
- Refresh runs all checks again.
- Open page opens the page where you fix the selected finding.
- Set up for AI assistants starts the assisted setup.
The page is read-only. It is useful without an assistant too: open it after a busy day, or before you close a period.
Good questions to ask
- Make a diagnostic report of this environment.
- Why does the nightly job fail?
- Which job queue entries have been running for hours?
- Why can't users post today?
- Which number series are about to run out?
- What changed in the setup since Monday, and who changed it?
- Which errors did users get in the last 24 hours?
- Which apps and versions are installed?
- Compare the setup of sandbox and production.
Ask in your own words and your own language. Say what you saw and when (“the invoice run failed this morning at 7”), so the assistant can look at the right time.
Limits
- 50 rows per call. The MCP server returns at most 50 rows per tool call. The assistant asks for the next ones with
skip, or filters. - No active sessions. Business Central online does not show active sessions to apps, so the diagnostics cannot say who is working right now.
- Data Query Tools are a preview of Microsoft and do not work on virtual tables.
- Online only. The Business Central MCP server exists only in Business Central online.
- One company per connection. The headers choose one environment and one company. For another company, add another server.
- The change log only shows something when it is activated, and only for the tables and fields set up in Change Log Setup.
- Error messages only include messages kept in an error message register.
- Costs of Microsoft. Microsoft plans to charge for Business Central MCP tools. Check the Business Central licensing guide.
Privacy and security
- Read-only, three times over. The API pages cannot write, the MCP configuration allows reading only, and the user keeps their own permissions in Business Central.
- No server of Appfabriek in between. Your assistant talks to Microsoft's MCP server, which talks to your environment. Your data does not pass through Appfabriek.
- Secrets stay hidden. Fields with passwords, tokens and keys come back as
***, and job queue parameters are left out. - Your assistant, your terms. What the assistant reads goes to the AI service you chose (for example Anthropic, GitHub or Microsoft), under your agreement with that service.
- Telemetry without customer data. The app sends Appfabriek counts, names of checks and error codes, to Application Insights in Azure (West Europe). Business Central adds standard fields such as country, company name, user role and app version. Never an error message or a field value.
The full text is in the privacy statement. More about the app: Appfabriek Diagnose.
Frequently asked questions
Can the assistant change data?
No. The configuration Appfabriek Diagnose has no tools that write, and the API pages of the app cannot write. If the assistant suggests a fix, a person makes it in Business Central.
Can the assistant see everything?
No. It sees what the signed-in user may read in Business Central, in the environment and company of the connection. A user without access to the change log sees no change log through the assistant either.
Do I need Claude?
No. Any client that speaks MCP and can sign in to Microsoft Entra ID works. These docs cover Claude Code, VS Code with GitHub Copilot and Copilot Studio.
Does it work with Business Central on-premises?
No. The Business Central MCP server exists only online.
Why does the sign-in ask for Financials.ReadWrite.All?
Microsoft prescribes that permission for the MCP server. What the assistant can do is decided by the user's permissions in Business Central and by the configuration, which allows reading only. If you prefer, use your own Entra app.
Do we have to use the Entra app of Appfabriek?
No. Enter your own client ID in the assisted setup. VS Code and Copilot Studio use neither: they sign in with an app of Microsoft.
What does Appfabriek see of our data?
Nothing. Appfabriek only receives telemetry: counts, names of checks and error codes. See Privacy and security.
Does Microsoft charge for the MCP server?
Microsoft plans to charge for Business Central MCP tools and will publish the details. Check the Business Central licensing guide before you allow agents.
Can we add our own checks?
Yes, in your own app, without changing this one. Add a value to the enum AFB Diag Check with your own implementation of the interface AFB Diag Check, or subscribe to OnAfterCollect of codeunit AFB Diag Findings.
enumextension 50100 "My Checks" extends "AFB Diag Check"
{
value(50100; MyCheck) { Caption = 'My check'; Implementation = "AFB Diag Check" = "My Check"; }
}
codeunit 50100 "My Check" implements "AFB Diag Check"
{
procedure Run(var Findings: Codeunit "AFB Diag Findings")
begin
Findings.Add("AFB Diag Severity"::Warning, 'myArea', 'Title', 'Details', 'Advice', Page::"My Page", '');
end;
}Which languages does the app speak?
English and Dutch. The assistant answers in the language you ask in.
Troubleshooting
A tool is missing, for example after an update
Run the assisted setup again. It adds what is missing and changes nothing else. In VS Code and Copilot Studio, refresh the tools afterwards.
No access, or no rows where you expect them
The user needs the permission set AFB DIAGNOSE. For the setup: AFB DIAG ADMIN. Also check that the connection points to the right environment and company (EnvironmentName, Company).
Sign-in asks for admin approval (AADSTS65001, AADSTS90094)
Your organization has not given consent for the client app yet. An administrator opens the consent link once.
Redirect URI does not match (AADSTS50011)
The port in callbackPort must match the redirect URI of the app. Our app uses http://localhost:33418/callback, so keep port 33418. With your own app, add the redirect URI you use.
Application not found in the directory (AADSTS700016)
The client ID is wrong, or you sign in to another tenant. Check clientId and TenantId.
Claude Code cannot finish the sign-in
Another program uses port 33418. Close it and run /mcp again.
Claude Code does not show the server
Start claude in the folder with .mcp.json, allow the project server, and check with /mcp.
The setup says “The MCP client app could not be registered”
The configuration itself was created, but the client app could not be recorded. Run the setup as a person with AFB DIAG ADMIN, not as an app user, and try again.
A finding says “The check … could not run”
The other checks ran. The details show the error. If it keeps happening, contact support and send the details along.
The company name has special characters
The setup encodes it for you as =?base64?…?=. If you type the header by hand, encode the name in Base64 (UTF-8) the same way.
Support
Not solved here? Go to Appfabriek Diagnose support, or email support@appfabriek.com. Tell us the version of the app (in environmentInfo or on the page Extension Management), the environment type, and what you saw.