跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Microsoft Dynamics 365 Business Central,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 在 Business Central 中工作:查找客户、供应商和物料,读取销售报价、销售订单和销售发票、采购发票、总账、科目表和维度,并创建客户以及报价和订单草稿。通过标准 API v2.0 支持 Business Central online,使用你的 Microsoft 账户登录。
试试这样问
Microsoft Dynamics 365 Business Central 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Microsoft Dynamics 365 Business Central、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Dynamics 365 Business Central + Gemini
让你的 AI 在 Business Central 中工作:查找客户、供应商和物料,读取销售报价、销售订单和销售发票、采购发票、总账、科目表和维度,并创建客户以及报价和订单草稿。通过标准 API v2.0 支持 Business Central online,使用你的 Microsoft 账户登录。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
MICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRET, MICROSOFT_TENANT_ID, BC_ENVIRONMENT
步骤 1 — 获取凭证
- 打开 Microsoft Entra 管理中心(
https://entra.microsoft.com)→ Applications → App registrations → New registration,也可以复用你为 Outlook、OneDrive 或 SharePoint 连接器创建的应用。通常选择 Accounts in this organizational directory only。 - 添加平台为 Web 的重定向 URI:
https://cloud.anythingmcp.com/api/mcp-oauth/callback(如果你自行托管 AnythingMCP:<your AnythingMCP URL>/api/mcp-oauth/callback)。它必须完全一致,否则 Microsoft 会返回AADSTS50011。 - 在 API permissions → Add a permission → Dynamics 365 Business Central → Delegated permissions 下勾选
Financials.ReadWrite.All(以及user_impersonation)。如果你的组织不允许用户自行同意,请点击 Grant admin consent。 - 在 Certificates & secrets → New client secret 下复制密钥的 Value。它只显示一次;你需要的不是 Secret ID。
- 填写
MICROSOFT_CLIENT_ID(即 Application (client) ID)、MICROSOFT_CLIENT_SECRET、MICROSOFT_TENANT_ID和BC_ENVIRONMENT,然后安装连接器。 - 点击 Authorize with Provider,用一个 Business Central 用户登录。访问令牌会自动续期。
- 运行
bc_list_companies。其他所有工具都在某一个公司内工作,并需要该公司的 id。
租户和环境:MICROSOFT_TENANT_ID 是你的 Directory (tenant) ID,或 contoso.onmicrosoft.com 这样的域名。common 和 organizations 在这里不可用,因为租户是 Business Central 地址的一部分。BC_ENVIRONMENT 是环境名称,须与 Business Central 管理中心中显示的完全一致:大多数正式租户为 Production,测试环境为 Sandbox 或你自己起的名称。bc_list_environments 会列出这些名称。请先在沙盒中试用连接器:在生产环境中,它创建的客户和单据都是真实的。
与用户相同的权限:每次调用都以登录用户的身份运行,使用该用户的 Business Central 许可证和权限集。AI 能看到和修改的,正是该用户被允许的内容。
读取和写入的内容:客户、供应商、物料、销售报价、销售订单和销售发票、采购发票、总账分录、科目表、维度和员工,此外还可以通过 bc_query 访问标准 API v2.0 的任何其他资源,例如联系人、采购订单、贷项通知单、应收和应付账龄或试算平衡表。它可以创建客户以及带明细行的销售报价和销售订单,并更新客户。单据始终保持为未结草稿:不会下达、发货、开票或过账。创建单据前,AI 会先和你确认客户、物料、数量和价格。
安装时默认关闭:bc_delete_customer、bc_make_order_from_quote、bc_delete_sales_quote 和 bc_delete_sales_order。删除记录或把报价转为订单都无法撤销,因此只有在需要时才逐个打开这些工具。
限制:Business Central 允许每个用户每 5 分钟约 6,000 次 API 调用;超出后,它会要求连接器等待。
常见错误:401 表示授权已被撤销或客户端密钥已过期:如有需要填入新密钥,然后重新授权。403:用户缺少许可证或权限集,或缺少管理员同意。404 NoEnvironment:BC_ENVIRONMENT 或 MICROSOFT_TENANT_ID 有误。412:记录在读取后被他人修改过,因此 AI 会重新读取。
仅支持 Business Central online:不涵盖本地部署,较旧的 NAV 部署有专门的 Dynamics NAV 连接器。扩展发布的自定义 API 无法访问。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Gemini 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
Gemini CLI 从 ~/.gemini/settings.json(Windows 上为 %USERPROFILE%\.gemini\settings.json)读取 MCP 服务器。添加:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换
YOUR_MCP_API_KEY。 - 保存文件并重启
gemini。 - 在 Gemini CLI 中运行
/mcp(或在终端运行gemini mcp list),anythingmcp应显示为已连接。 - 开始输入提示,Gemini CLI 现在可以调用
Dynamics 365 Business Central的工具。
可用工具
| Tool | What it does |
|---|---|
bc_list_environments | List the Business Central environments of the tenant: name, type (Production or Sandbox), country and web client URL |
bc_list_companies | List the companies in the connected environment with their id, name and display name |
bc_list_customers | List or search customers: number, name, address, phone, email, balance, credit limit, currency, blocked state |
bc_get_customer | Read one customer with every field, including its @odata.etag for updates |
bc_create_customer | Create a customer |
bc_update_customer | Change fields of one customer; fields left out keep their values |
bc_delete_customer | Delete one customer |
bc_list_vendors | List or search vendors (suppliers): number, name, address, phone, email, balance, currency, blocked state |
bc_get_vendor | Read one vendor with every field: address, contact details, balance, payment terms and its @odata.etag |
bc_list_items | List or search items: number, name, type (Inventory, Service, Non-Inventory), category, inventory on hand, unit price, unit cost, base unit… |
bc_get_item | Read one item with every field: prices, cost, inventory, units of measure, GTIN, category |
bc_list_sales_quotes | List sales quotes: number, customer, dates, status (Draft, Sent, Accepted, Expired), amounts |
bc_get_sales_quote | Read one sales quote with every header field; expand=salesQuoteLines adds the lines |
bc_create_sales_quote | Create a sales quote for a customer, optionally with its lines in the same call |
bc_add_sales_quote_line | Add one line to an open sales quote: an item with quantity and optionally price and discount, a G/L account, a resource or a comment |
bc_make_order_from_quote | Turn a sales quote into a sales order (Business Central's Make Order) |
bc_delete_sales_quote | Delete one sales quote with its lines |
bc_list_sales_orders | List sales orders: number, customer, order and delivery dates, status (Draft, In Review, Open), fully shipped flag, amounts |
bc_get_sales_order | Read one sales order with every header field; expand=salesOrderLines adds the lines with shipped and invoiced quantities |
bc_create_sales_order | Create a sales order for a customer, optionally with its lines in the same call |
bc_add_sales_order_line | Add one line to an open sales order: an item with quantity and optionally price and discount, a G/L account, a resource or a comment |
bc_delete_sales_order | Delete one open sales order with its lines |
bc_list_sales_invoices | List sales invoices: number, customer, invoice and due dates, status (Draft, In Review, Open, Paid, Canceled, Corrective), total and… |
bc_get_sales_invoice | Read one sales invoice with every header field; expand=salesInvoiceLines adds the lines |
bc_list_purchase_invoices | List purchase invoices (vendor bills): number, vendor, vendor invoice number, invoice and due dates, status (Draft, In Review, Open, Paid… |
bc_get_purchase_invoice | Read one purchase invoice with every header field; expand=purchaseInvoiceLines adds the lines |
bc_list_general_ledger_entries | List posted general ledger entries: entry number, posting date, document type and number, G/L account, description, debit and credit amount |
bc_list_accounts | List the chart of accounts (G/L accounts): number, name, category (Assets, Liabilities, Equity, Income, Cost of Goods Sold, Expense)… |
bc_list_dimensions | List the dimensions (for example DEPARTMENT, PROJECT, AREA) with their codes. bc_list_dimension_values lists the values of one |
bc_list_dimension_values | List the values of one dimension, e.g. the departments of DEPARTMENT, with code and name |
bc_list_employees | List employees: number, name, job title, email, phone, status (Active, Inactive, Terminated), employment date |
bc_query | Read any other API v2.0 resource of a company that has no dedicated tool, e.g. contacts, purchaseOrders, salesCreditMemos, salesShipments… |
示例提示
- “哪些客户有逾期发票?每个客户的总额是多少?”
- “显示本月尚未全部发货的销售订单。”
- “为 Adatum Corporation 创建一份销售报价,包含 10 个物料 1896-S,保存前先给我看看。”
- “我们 9 月在收入科目上过账了什么?请按部门列出。”
FAQ
Gemini CLI 从哪里读取 MCP 服务器? 用户级配置位于 ~/.gemini/settings.json,项目级配置位于项目内的 .gemini/settings.json。gemini mcp list 会列出每个服务器及其连接状态。
下一步
这份指南对你有帮助吗?