Back to MCP directory
publicPublicdnsLocal runtime

mcp-business-central-server

一个轻量级的MCP服务器,用于与Microsoft Dynamics 365 Business Central无缝集成,支持通过MCP协议与Business Central中的任何实体进行交互。

article

README

🚀 商业中央 MCP 服务器

一个轻量级的 MCP 服务器,用于与微软 Dynamics 365 Business Central 进行无摩擦集成。借助它,MCP 客户能够与商业中央环境中的任何实体进行交互。本项目由 sofias tech 开发。

🚀 快速开始

安装

# 使用 pip 安装
pip install mcp-business-central-server

# 或者使用 Git 克隆仓库
git clone https://github.com/xxx/mcp-business-central-server.git
cd mcp-business-central-server
python setup.py install

使用 uv

uvicorn business_central.mcp_server:app --reload

✨ 主要特性

此服务器通过 Model Context Protocol (MCP) 提供对商业中央资源的简洁接口,并通过优化 HTTP 请求处理提高性能。

工具

该服务器实现了以下工具:

  • BC_Get_Schema:检索任何商业中央实体的架构,包括可用字段
  • BC_List_Items:获取实体列表,支持可选过滤和分页
  • BC_Get_Items_By_Field:根据特定字段值搜索实体
  • BC_Create_Item:在商业中央创建新的实体记录
  • BC_Update_Item:更新现有实体记录
  • BC_Delete_Item:从商业中央删除实体记录

📦 安装指南

创建凭证与配置信息

  1. 创建商业中央 API 凭证。
  2. 配置您的商业中央环境和公司信息。

设置环境变量

服务器需要以下环境变量:

  • BC_URL_SERVER:您的商业中央 API 服务器 URL(例如,“https://api.businesscentral.dynamics.com/v2.0/tenant/api/v2.0”)
  • BC_USER:您的商业中央 API 用户名
  • BC_PASS:您的商业中央 API 密码
  • BC_COMPANY:您的商业中央公司名称

📚 详细文档

与商业中央实体一起使用

此服务器可以处理商业中央中的任何实体。使用工具时,您必须提供与商业中央 API 显示相同的实体名称。例如:

  • Employees
  • Customers
  • Items
  • Vendors
  • SalesOrders
  • Payments

实体名称区分大小写,并且必须与商业中央暴露的名称完全匹配。

与 Claude Desktop 集成

标准集成

在您的 config.json 文件中添加以下内容:

{
  "business_central": {
    "host": "http://localhost:8000",
    "api_key": "your_api_key_here"
  }
}

使用 uvx

在您的 config.json 文件中添加以下内容:

{
  "uv": {
    "host": "http://localhost:8000",
    "token": "your_token_here"
  }
}

开发

要求

  • Python 3.8 或更高版本
  • requests 库
  • uvicorn(可选,用于调试)

本地开发

  1. 克隆仓库:
git clone https://github.com/xxx/mcp-business-central-server.git
cd mcp-business-central-server
  1. 安装依赖项:
pip install -r requirements.txt
  1. 启动服务器(可选调试模式):
uvicorn business_central.mcp_server:app --reload

调试

使用以下命令查看日志和错误信息:

python -m business_central.mcp_server

🔧 技术细节

该服务器以资源效率为设计理念:

  • 资源管理与工具实现之间的清晰分离
  • 简单且易于维护的代码库,减少重复代码
  • 直接使用 requests 库进行 HTTP 请求处理

📄 许可证

MIT License

Copyright (c) 2025 sofias tech

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client