d365-bc-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@d365-bc-mcp Show me the 10 most recent sales invoices with their totals"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
d365-bc-mcp
A read-only MCP server for Dynamics 365 Business Central. It gives Claude Code, Claude Desktop, or any MCP client governed access to live ERP data — customers, items, orders, invoices, and any other BC API entity — without ever being able to change anything.
Built by an IT admin who wanted AI assistance over production ERP data and refused to hand an LLM write access to the general ledger to get it.
Every tool issues GET requests only. Nothing is created, modified, or deleted in Business Central, by construction — there is no code path that issues a write.
Design
Read-only by construction, then again by permission. The server only performs GETs, and the recommended setup also runs under an identity that BC itself restricts to read-only permission sets. Two independent layers; either alone would hold.
Dual auth, auto-selected. Personal use gets delegated device-code auth (BC sees you, your permissions apply). Shared/deployed use gets client-credentials with a dedicated Entra app. Set one env var to switch.
Two transports. stdio for local MCP clients; stateless Streamable HTTP (
--http) for remote/shared use, with optional bearer-key protection.Boring dependencies. TypeScript,
@modelcontextprotocol/sdk, MSAL, Express, Zod. No framework, ~2.5k lines, readable in one sitting.
Mode | When | How it authenticates |
|
| Delegated — you sign in once as yourself; BC sees your user and your BC permissions apply |
|
| Service-to-service — a dedicated Entra app with its own (read-only) BC permission set |
Related MCP server: Microsoft Business Central MCP Server
Prerequisites
Node.js 20+
A Business Central online tenant and an Entra app registration:
Device-code mode: a public-client app registration — Authentication → Allow public client flows: Yes, plus the delegated
Dynamics 365 Business Central / user_impersonationAPI permission. If your org already has one (many BC integrations create one), you can reuse it.Client-credentials mode: see Service-to-service setup below.
Quick start (device code)
git clone https://github.com/vinaybabuv/d365-bc-mcp
cd d365-bc-mcp
npm install
npm run build
cp .env.example .env # then edit: tenant ID, client ID, environment, companySign in once, then verify the pipe end to end:
node --env-file=.env dist/index.js login
node --env-file=.env dist/index.js testlogin runs the device-code flow (open the URL, enter the code) and caches tokens at %LOCALAPPDATA%\d365-bc-mcp\token-cache.json (override with BC_TOKEN_CACHE) — refresh is silent from then on. test lists companies and three sample customers to prove auth, environment, and company selection all work.
Hook up to Claude Code
claude mcp add bc \
--env BC_TENANT_ID=<your-tenant-guid> \
--env BC_CLIENT_ID=<your-app-client-id> \
--env BC_ENVIRONMENT=Production \
--env "BC_COMPANY_NAME=CRONUS USA, Inc." \
-- node /path/to/d365-bc-mcp/dist/index.js(Add --scope user to make it available in every project.)
Hook up to Claude Desktop
Add to claude_desktop_config.json (%APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on macOS) under mcpServers:
{
"mcpServers": {
"business-central": {
"command": "node",
"args": ["/path/to/d365-bc-mcp/dist/index.js"],
"env": {
"BC_TENANT_ID": "<your-tenant-guid>",
"BC_CLIENT_ID": "<your-app-client-id>",
"BC_ENVIRONMENT": "Production",
"BC_COMPANY_NAME": "CRONUS USA, Inc."
}
}
}
}Service-to-service setup (for a shared connector)
For a connector that runs without a signed-in user (deployed to a server, used by a team), create a dedicated app registration:
Task 1 — Entra (entra.microsoft.com → App registrations → New):
Single tenant, no redirect URI needed.
Certificates & secrets → New client secret — copy the value immediately.
API permissions → Add → Microsoft APIs → Dynamics 365 Business Central → Application permissions →
API.ReadWrite.All→ Add, then Grant admin consent. (The permission name says ReadWrite, but actual data access is governed by the BC permission set you assign in Task 2 — assign a read-only one.)
Task 2 — Business Central:
In BC, search Microsoft Entra Applications → New.
Paste the app's Application (client) ID, set State = Enabled.
Assign a read-only permission set (e.g.
D365 READplus the specific read sets your data needs). Least privilege is the point: even though the server never writes, the identity it runs as shouldn't be able to.
Then: set BC_CLIENT_ID to the new app's ID and BC_CLIENT_SECRET to the secret. The server switches to client-credentials mode automatically. Verify with node --env-file=.env dist/index.js test.
HTTP mode (remote / shared use)
node --env-file=.env dist/index.js --httpServes stateless Streamable HTTP at http://localhost:3010/mcp (PORT to change), plus GET /healthz. Set MCP_API_KEY to require Authorization: Bearer <key> on every MCP request — do this for anything beyond localhost, and put real TLS in front of anything beyond your machine.
Connect Claude Code to it:
claude mcp add --transport http bc http://localhost:3010/mcp --header "Authorization: Bearer <MCP_API_KEY>"Note on claude.ai custom connectors: claude.ai (Settings → Connectors) requires either an unauthenticated URL or OAuth — it cannot send a static bearer header. To expose this server there, put an OAuth layer in front (Entra ID works; claude.ai supports manually-entered client credentials), or use Microsoft's hosted Business Central MCP server instead. Claude Code and Claude Desktop work fine with the bearer-key approach.
Tools
All list tools accept top (default 20, max 100) and skip, and return { total_count, returned, has_more, records }.
Tool | What it does |
| Companies visible to this connection |
| Customers; |
| One customer by number or GUID |
| Items; |
| Vendors; |
| Orders; by customer, status, date range |
| One order incl. lines, by number or GUID |
| Invoices; by customer, status, dates, |
| One invoice incl. lines, by number or GUID |
| Read-only escape hatch: GET any BC API entity ( |
Environment variables
Var | Required | Notes |
| yes | Entra tenant GUID |
| yes | App registration client ID |
| no | Setting it switches to client-credentials mode |
| no | Explicit override: |
| no | BC environment name, default |
| no | Working company; auto-selected if the identity sees exactly one |
| no | Token cache path (device-code mode) |
| no | HTTP mode: require this bearer token |
| no | HTTP mode port, default 3010 |
Security notes
No secrets in code or in this repo — configuration is environment-only, and
.env/ token caches are git-ignored.Delegated mode inherits the signed-in user's BC permissions; it can never see more than that user could.
Client-credentials mode should run under a BC permission set that is read-only, so the transport-level GET-only guarantee is backed by an authorization-level one.
The HTTP transport is stateless and unauthenticated by default for localhost development; set
MCP_API_KEY(and TLS) before exposing it anywhere else.
License
MIT
Available Tools
10 toolsbc_get_customerGet customerA
Get one customer's full record by customer number (e.g. C00120) or GUID id.
Inputs: id, customer_number.
bc_get_sales_invoiceGet sales invoiceA
Get one sales invoice by invoice number or GUID id, including its lines.
Inputs: id, include_lines, invoice_number.
bc_get_sales_orderGet sales orderA
Get one sales order by order number (e.g. S-ORD101001) or GUID id, including its lines.
Inputs: id, order_number, include_lines.
bc_list_companiesList companiesA
List the Business Central companies visible to this connection.
Inputs: no named parameters.
bc_list_customersList customersA
List customers in the working company. Use search for a name substring match, or filter for a raw OData $filter.
Inputs: top, skip, filter, search.
bc_list_itemsList itemsA
List inventory items in the working company. Use search for a name substring match, or filter for a raw OData $filter (e.g. inventory lt 10).
Inputs: top, skip, filter, search.
bc_list_sales_invoicesList sales invoicesA
List posted/draft sales invoices, optionally filtered by customer number, status (Draft, In Review, Open, Paid, Canceled, Corrective), invoice date range, or unpaid balance.
Inputs: top, skip, filter, status, +4 more.
bc_list_sales_ordersList sales ordersA
List sales orders, optionally filtered by customer number, status (Draft, In Review, Open), or order date range.
Inputs: top, skip, filter, status, +3 more.
bc_list_vendorsList vendorsA
List vendors in the working company. Use search for a name substring match.
Inputs: top, skip, filter, search.
bc_queryQuery any BC API entity (read-only)A
Read-only escape hatch: GET any Business Central API entity set or record. Covers standard v2.0 entities not exposed as dedicated tools (salesShipments, purchaseOrders, generalLedgerEntries, ...) and custom APIs via api_route (publisher/group/version, e.g. 'contoso/sales/v1.0'). Example: path='salesShipments', params={'$filter': "customerNumber eq 'C00120'"}.
Inputs: path (required), params, api_route, company_scoped.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct resource and action: list vs get for companies, customers, sales orders, and invoices; separate list tools for items and vendors; and a generic query escape hatch. No two tools have overlapping purposes.
All tool names follow a predictable 'bc_<verb>_<resource>' pattern, using snake_case throughout. The verbs are consistently 'list' or 'get', and the singular/plural resource naming is standard (list_customers, get_customer).
With 10 tools, the set is well-scoped for a read-only Business Central connector. The main entities are covered with dedicated tools, plus a generic query tool for edge cases, without unnecessary bloat.
The tool set provides list/get coverage for core entities (customers, sales orders, invoices) and a generic query escape hatch for anything else, but it is entirely read-only. There are no create, update, or delete operations, which is a notable gap for a business management system.
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
The HubSpot MCP Server acts as a bridge that enables AI assistants and Large Language Models to securely interact with HubSpot CRM data through natural conversation, without requiring users to understand complex API structures. It provides read-only access to standard CRM objects (contacts, companies, deals, tickets, products, invoices, and more) and their associations, secured via OAuth 2.0, allowing AI agents to perform tasks like summarizing deals, fetching company updates, and looking up record changes.
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
Read-only MCP server for Point (Tetra M Labs): demo ledger, trial balance, partners.
Related MCP Servers
- AlicenseAqualityCmaintenanceModel Context Protocol (MCP) server for Microsoft Dynamics 365 Business Central. Provides AI assistants with direct access to Business Central data through properly formatted API v2.0 calls.61,934 npm10MIT
- AlicenseAqualityDmaintenanceMCP server for Microsoft Dynamics 365 Business Central that enables AI assistants to query and manage Business Central data via full CRUD operations.61,934 npmMIT
- AlicenseBqualityDmaintenanceMCP server for Microsoft Dynamics 365 Business Central, enabling AI assistants to perform CRUD operations, query data, and retrieve schemas via Business Central API v2.0.61,934 npmMIT
- AlicenseAqualityDmaintenanceMCP server that provides AI assistants direct access to Microsoft Dynamics 365 Business Central using its native WebSocket protocol, enabling page navigation, data operations, actions, and report execution without OData or browser automation.14472 npmMIT