business-central-mcp
Give AI assistants direct access to Microsoft Dynamics 365 Business Central via native WebSocket protocol.
README
<p align="center"> <h1 align="center">business-central-mcp</h1> <p align="center"> Give AI assistants direct access to Microsoft Dynamics 365 Business Central.<br/> Native WebSocket protocol -- no OData, no APIs, no browser automation. </p> </p>
<p align="center"> <a href="https://www.npmjs.com/package/business-central-mcp"><img src="https://img.shields.io/npm/v/business-central-mcp" alt="npm version"></a> <a href="https://www.npmjs.com/package/business-central-mcp"><img src="https://img.shields.io/npm/dm/business-central-mcp" alt="npm downloads"></a> <a href="https://github.com/SShadowS/business-central-mcp/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/business-central-mcp" alt="license"></a> <a href="vscode:mcp/install?%7B%22name%22%3A%22business-central%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22business-central-mcp%22%5D%7D"><img src="https://img.shields.io/badge/VSCode-Install-007ACC?logo=visualstudiocode" alt="Install in VSCode"></a> <a href="https://github.com/SShadowS/business-central-mcp/releases/latest"><img src="https://img.shields.io/badge/Claude%20Desktop-Download%20.dxt-d97757" alt="Download .dxt for Claude Desktop"></a> </p>
Overview
| Property | Value |
|---|---|
| Language | TypeScript / Node 20+ |
| npm package | business-central-mcp |
| BC versions | BC27, BC28 (wire-compatible) |
| Auth | NavUserPassword (OAuth on roadmap) |
| Tools | 12 |
| Tests | 284 unit/protocol + 111 integration |
| License | MIT |
Install
VSCode
Click the badge. VSCode opens, prompts to add the server, and writes to your user mcp.json.
You will still need to set BC_BASE_URL, BC_USERNAME, and BC_PASSWORD in the entry's env block. VSCode opens the file for you to edit.
<details> <summary><strong>Manual install</strong></summary>
Workspace: create .vscode/mcp.json:
{
"servers": {
"business-central": {
"command": "npx",
"args": ["-y", "business-central-mcp"],
"env": {
"BC_BASE_URL": "http://your-bc-server/BC",
"BC_USERNAME": "your-user",
"BC_PASSWORD": "your-password"
}
}
}
}
</details>
Claude Code
claude mcp add business-central \
-e BC_BASE_URL=http://your-bc-server/BC \
-e BC_USERNAME=you \
-e BC_PASSWORD=secret \
-- npx -y business-central-mcp
Scope it to the current project with --scope project. See claude mcp --help for scoping options.
Claude Desktop
- Download the latest
.dxtfrom Releases. - Double-click. Claude Desktop opens Settings → Extensions and prompts for BC URL, username, and password.
- Restart Claude Desktop.
<details> <summary><strong>Manual install</strong></summary>
Edit claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"business-central": {
"command": "npx",
"args": ["-y", "business-central-mcp"],
"env": {
"BC_BASE_URL": "http://your-bc-server/BC",
"BC_USERNAME": "your-user",
"BC_PASSWORD": "your-password"
}
}
}
}
Restart Claude Desktop.
</details>
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
BC_BASE_URL |
Yes | — | BC server base URL, e.g. http://your-bc-server/BC |
BC_USERNAME |
Yes | — | NavUserPassword username |
BC_PASSWORD |
Yes | — | NavUserPassword password |
BC_PROFILE |
No | server default | Profile id, e.g. BUSINESS MANAGER. Affects which Role Center loads and which pages Tell Me indexes. |
BC_TENANT_ID |
No | default |
Multi-tenant deployments only. |
BC_CLIENT_VERSION |
No | 27.0.0.0 |
Version reported to BC during session open. |
PORT |
No | 3000 |
HTTP transport port (stdio transport ignores this). |
LOG_LEVEL |
No | info |
debug / info / warn / error. |
LOG_DIR |
No | ./logs |
Directory for log files. |
STATE_DIR |
No | ./.state |
Directory for session state. |
BC_INVOKE_TIMEOUT |
No | 30000 |
Per-invoke timeout in ms. Kills hung sessions. |
BC_RECONNECT_MAX_RETRIES |
No | 4 |
Reconnect attempts after session death. |
BC_RECONNECT_BASE_DELAY |
No | 1000 |
Base delay (ms) for exponential reconnect backoff. |
What can it do?
| Tool | What it does |
|---|---|
bc_open_page |
Open any page by ID -- lists, cards, documents, role centers. Returns the page as sections[] with header, lines, factboxes, and Role Center cuegroup tiles. |
bc_read_data |
Refresh a single section: filter, paginate, slice, project tab/columns. Returns the same Section shape as bc_open_page. |
bc_write_data |
Write field values; BC validates and echoes confirmed values. Section-aware (lines, factboxes, header). |
bc_execute_action |
Run header / row / wizard actions, OR drill down on Role Center cue tiles via cue input. |
bc_respond_dialog |
Handle confirmation prompts and request pages |
bc_navigate |
Select rows, drill down into records, field lookups |
bc_search_pages |
Tell Me search. Returns { name, objectType, runTarget, departmentPath, category, score } per result. |
bc_close_page |
Close a page and free server resources |
bc_switch_company |
Switch to a different company mid-session |
bc_list_companies |
Discover available companies |
bc_run_report |
Execute reports and fill request page parameters |
bc_wizard_navigate |
Drive NavigatePage / wizard flows (back / next / finish / cancel) |
How it works
This server speaks BC's internal WebSocket protocol directly -- the same protocol the browser-based web client uses. It was reverse-engineered from decompiled BC server assemblies. No OData endpoints, no SOAP services, no Selenium.
One WebSocket connection per session. All operations serialized through a promise queue. BC27 and BC28 are wire-compatible.
LLM (Claude / Copilot / etc.)
|
v MCP (stdio or HTTP)
business-central-mcp
|
v WebSocket + JSON-RPC
BC Web Service Tier (BC27 / BC28)
|
v internal calls
BC Server
<details> <summary><strong>Page output shape</strong></summary>
bc_open_page returns the page as a flat list of sections:
{
"pageContextId": "session:page:21:abc",
"pageType": "Card",
"caption": "Customer Card",
"isModal": false,
"sections": [
{ "sectionId": "header", "kind": "header", "fields": [...], "actions": [...] },
{ "sectionId": "factbox:Customer Statistics", "kind": "factbox", "fields": [...] }
]
}
Each section carries its own content shape:
- Card-style (
headeron Card pages,factbox,requestPage):fields[]and (forheader)actions[] - List-style (
lineson Documents,headeron List pages, repeater subpages):rows[]andtotalRowCount - Cue tiles (Role Center hosted CardParts):
cues[]with each tile'sname,value,groupCaption,synopsis,hasAction. Drill down withbc_execute_action { section, cue }.
bc_read_data returns a single Section for the requested sectionId (defaults to "header"). The section ID for a FactBox or subpage comes from the bc_open_page response.
</details>
<details> <summary><strong>Session resilience</strong></summary>
- Automatic reconnect with exponential backoff after session death
- Handles BC's ~15s NTLM auth slot hold after crashes
- Auto-dismisses license popups on fresh databases
- Invoke timeout kills hung sessions and triggers recovery
- Auto-recovery from
LogicalModalityViolationExceptionmid-session: reconciles the modal stack and retries transparently; falls back to session reset when BC keeps a confirm dialog sticky
</details>
Key files
| File | Purpose |
|---|---|
src/stdio-server.ts |
npm bin entry -- stdio MCP transport |
src/server.ts |
HTTP MCP transport entry |
src/mcp/ |
MCP tool registry, schemas, request handler |
src/operations/ |
One handler per tool (bc_open_page, bc_read_data, etc.) |
src/services/ |
Page, data, action, navigation, search business logic |
src/protocol/ |
WebSocket transport, wire types, captures |
src/session/ |
Session lifecycle, modal stack, reconnect |
manifest.json |
Claude Desktop Extension manifest |
scripts/build-dxt.ts |
Builds .dxt artifact for Claude Desktop |
.github/workflows/release.yml |
Builds + attaches .dxt on v* tag pushes |
ROADMAP.md |
Deferred work (OAuth, Cursor, init wizard) |
Development
git clone https://github.com/SShadowS/business-central-mcp
cd business-central-mcp
npm install
npm run start:stdio-direct # Run from source
npm test # 284 unit + protocol tests
npm run test:integration # 111 integration tests against real BC (requires running BC server)
Roadmap
OAuth, Cursor support, an interactive init wizard, and a few protocol gaps.
See ROADMAP.md for the full list and priorities.
Author: Torben Leth (sshadows@sshadows.dk) License: MIT (see LICENSE)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。