business-central-mcp
概述
属性 | 值 |
语言 | TypeScript / Node 20+ |
npm 包 | |
BC 版本 | BC27、BC28(线缆兼容) |
认证 | NavUserPassword(OAuth 已列入路线图) |
工具 | 12 |
测试 | 284 个单元/协议测试 + 111 个集成测试 |
许可证 | MIT |
安装
VSCode
点击徽章。VSCode 会打开,提示添加服务器,并写入你的用户 mcp.json。
你仍然需要在条目的 env 块中设置 BC_BASE_URL、BC_USERNAME 和 BC_PASSWORD。VSCode 会打开该文件供你编辑。
工作区:创建 .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"
}
}
}
}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 project 将其限定到当前项目。有关作用域选项,请参阅 claude mcp --help。
Claude Desktop
从 Releases 下载最新的
.dxt。双击。Claude Desktop 会打开设置 → 扩展,并提示输入 BC URL、用户名和密码。
重启 Claude Desktop。
编辑 claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.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"
}
}
}
}重启 Claude Desktop。
配置
变量 | 必填 | 默认值 | 描述 |
| 是 | — | BC 服务器基础 URL,例如 |
| 是 | — | NavUserPassword 用户名 |
| 是 | — | NavUserPassword 密码 |
| 否 | 服务器默认 | 配置文件 ID,例如 |
| 否 |
| 仅限多租户部署。 |
| 否 |
| 会话打开时向 BC 报告的版本。 |
| 否 |
| HTTP 传输端口(stdio 传输忽略此项)。 |
| 否 |
|
|
| 否 |
| 日志文件目录。 |
| 否 |
| 会话状态目录。 |
| 否 |
| 单次调用的超时时间(毫秒)。会终止挂起的会话。 |
| 否 |
| 会话终止后的重连尝试次数。 |
| 否 |
| 指数退避重连的基础延迟(毫秒)。 |
它能做什么?
工具 | 功能 |
| 按 ID 打开任意页面——列表、卡片、单据、Role Center。将页面以 |
| 刷新单个分区:筛选、分页、切片、投影选项卡/列。返回与 |
| 写入字段值;BC 会验证并回显确认值。支持分区感知(行、FactBox、页眉)。 |
| 运行页眉/行/向导操作,或通过 |
| 处理确认提示和请求页面 |
| 选择行、下钻记录、字段查找 |
| Tell Me 搜索。每个结果返回 |
| 关闭页面并释放服务器资源 |
| 在会话中途切换到其他公司 |
| 发现可用的公司 |
| 执行报表并填写请求页面参数 |
| 驱动 NavigatePage / 向导流程(上一步 / 下一步 / 完成 / 取消) |
工作原理
该服务器直接使用 BC 的内部 WebSocket 协议——与基于浏览器的 Web 客户端使用的协议相同。它是从反编译的 BC 服务器程序集中逆向工程而来。无需 OData 端点、无需 SOAP 服务、无需 Selenium。
每个会话一个 WebSocket 连接。所有操作通过 promise 队列串行化。BC27 和 BC28 线缆兼容。
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 Serverbc_open_page 将页面作为扁平的 section 列表返回:
{
"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": [...] }
]
}每个 section 携带自己的内容结构:
卡片式(Card 页面上的
header、factbox、requestPage):fields[]以及(对于header)actions[]列表式(单据上的
lines、List 页面上的header、repeater 子页面):rows[]和totalRowCount提示磁贴(Role Center 托管的 CardPart):
cues[],每个磁贴包含name、value、groupCaption、synopsis、hasAction。使用bc_execute_action { section, cue }下钻。
bc_read_data 为请求的 sectionId(默认为 "header")返回单个 Section。FactBox 或子页面的 section ID 来自 bc_open_page 响应。
会话终止后自动重连,采用指数退避
处理崩溃后 BC 约 15 秒的 NTLM 认证槽位占用
在新数据库上自动关闭许可证弹窗
调用超时终止挂起会话并触发恢复
会话中途自动从
LogicalModalityViolationException恢复:协调模态栈并透明重试;当 BC 持续保持确认对话框时,回退到会话重置
关键文件
文件 | 用途 |
| npm |
| HTTP MCP 传输入口 |
| MCP 工具注册表、schema、请求处理器 |
| 每个工具一个处理器( |
| 页面、数据、操作、导航、搜索业务逻辑 |
| WebSocket 传输、线缆类型、捕获 |
| 会话生命周期、模态栈、重连 |
| Claude Desktop 扩展清单 |
| 为 Claude Desktop 构建 |
| 在 |
| 延后工作(OAuth、Cursor、初始化向导) |
开发
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)路线图
OAuth、Cursor 支持、交互式 init 向导,以及一些协议缺口。
完整列表和优先级请参阅 ROADMAP.md。
作者: Torben Leth(sshadows@sshadows.dk) 许可证: MIT(参见 LICENSE)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for LeadDelta — manage LinkedIn connections and CRM data via AI assistants.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/masoniqbal777/Business-Central-Mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server