Microsoft Business Central MCP Server

Microsoft Business Central MCP Server

Model 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.

Category
访问服务器

README

smithery badge

Microsoft Business Central MCP Server

<img width="1536" height="1024" alt="mcp-business-central" src="https://github.com/user-attachments/assets/13932bfd-a5b9-4668-a7cd-ac9549a09673" />

Model 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.

Features

  • Correct API URLs: Uses proper /companies(id)/resource format (no ODataV4 segment)
  • Zero Installation: Run with npx - no pre-installation required
  • Azure CLI Auth: Leverages existing Azure CLI authentication
  • Client Credentials Auth: Service-to-service authentication for AI agents
  • Clean Tool Names: No prefixes, just get_schema, list_items, etc.
  • Full CRUD: Create, read, update, and delete Business Central records

Installation

Using npx (Recommended)

No installation needed! Configure in Claude Desktop or Claude Code:

{
  "mcpServers": {
    "business-central": {
      "type": "stdio",
      "command": "cmd",
      "args": ["/c", "npx", "-y", "@knowall-ai/mcp-business-central"],
      "env": {
        "BC_URL_SERVER": "https://api.businesscentral.dynamics.com/v2.0/{tenant-id}/{environment}/api/v2.0",
        "BC_COMPANY": "Your Company Name",
        "BC_AUTH_TYPE": "azure_cli"
      }
    }
  }
}

Note for Windows: Use cmd with /c as shown above for proper npx execution.

Using Smithery

Install via Smithery:

npx -y @smithery/cli install @knowall-ai/mcp-business-central --client claude

Local Development

git clone https://github.com/knowall-ai/mcp-business-central.git
cd mcp-business-central
npm install
npm run build
node build/index.js

Configuration

Environment Variables

Variable Required Description Example
BC_URL_SERVER Yes Business Central API base URL https://api.businesscentral.dynamics.com/v2.0/{tenant}/Production/api/v2.0
BC_COMPANY Yes Company display name KnowAll Ltd
BC_AUTH_TYPE No Authentication type (default: azure_cli) azure_cli or client_credentials
BC_TENANT_ID For client_credentials Azure AD tenant ID 00000000-0000-0000-0000-000000000000
BC_CLIENT_ID For client_credentials App registration client ID 00000000-0000-0000-0000-000000000000
BC_CLIENT_SECRET For client_credentials App registration client secret your-secret-value

Getting Your Configuration Values

  1. Tenant ID: Find in Azure Portal → Azure Active Directory → Overview
  2. Environment: Usually Production or Sandbox
  3. Company Name: The display name shown in Business Central

Example URL format:

https://api.businesscentral.dynamics.com/v2.0/00000000-0000-0000-0000-000000000000/Production/api/v2.0

Authentication

Recommendation: Use azure_cli authentication - it's simpler to set up and more reliable. The client_credentials method is also supported but has known configuration challenges with Business Central's Microsoft Entra Applications setup. See docs/TROUBLESHOOTING.adoc for details.

Option 1: Azure CLI (Recommended)

The simplest and most reliable authentication method. Uses your existing Azure CLI login.

Prerequisites:

  • Install Azure CLI: https://docs.microsoft.com/cli/azure/install-azure-cli
  • Login: az login
  • Verify access: az account get-access-token --resource https://api.businesscentral.dynamics.com

Configuration:

{
  "mcpServers": {
    "business-central": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@knowall-ai/mcp-business-central"],
      "env": {
        "BC_AUTH_TYPE": "azure_cli",
        "BC_URL_SERVER": "https://api.businesscentral.dynamics.com/v2.0/{tenant-id}/Production/api/v2.0",
        "BC_COMPANY": "My Company"
      }
    }
  }
}

Option 2: Client Credentials (Service-to-Service)

For automated systems that need to run without user interaction. This method uses OAuth 2.0 client credentials flow.

Note: This method has known configuration challenges. The Business Central "Microsoft Entra Applications" setup can be complex and the application user creation may not work as expected. See docs/TROUBLESHOOTING.adoc for detailed guidance.

Setup Overview:

  1. Create Azure App Registration:

    • Go to Azure Portal → Azure Active Directory → App registrations
    • Create new registration (single tenant)
    • Add API permission: Dynamics 365 Business Central → app_access (Application permission, NOT Delegated)
    • Grant admin consent for the permission
    • Add redirect URI: https://businesscentral.dynamics.com/OAuthLanding.htm
  2. Generate Client Secret:

    • In your app registration, go to Certificates & secrets
    • Create a new client secret and save it securely
  3. Configure Business Central:

    • In Business Central, search for "Microsoft Entra Applications"
    • Click + New and enter your app's Client ID
    • Set a Description (this becomes the application user name)
    • Set State to "Enabled" - you should see "A user named '[Description]' will be created"
    • Add permission sets: D365 BUS FULL ACCESS (recommended) or D365 READ
    • Leave Company field blank for all companies access
    • Click "Grant Consent"
  4. Verify Setup:

    • The application user should appear in the Users list in Business Central
    • If not, see docs/TROUBLESHOOTING.adoc for solutions

References:

Available Tools

1. get_schema

Get OData metadata for a Business Central resource.

Parameters:

  • resource (string, required): Resource name (e.g., customers, contacts, salesOpportunities)

Example:

{
  "resource": "customers"
}

2. list_items

List items with optional filtering and pagination.

Parameters:

  • resource (string, required): Resource name
  • filter (string, optional): OData filter expression
  • top (number, optional): Maximum number of items to return
  • skip (number, optional): Number of items to skip for pagination

Example:

{
  "resource": "customers",
  "filter": "displayName eq 'Contoso'",
  "top": 10
}

3. get_items_by_field

Get items matching a specific field value.

Parameters:

  • resource (string, required): Resource name
  • field (string, required): Field name to filter by
  • value (string, required): Value to match

Example:

{
  "resource": "contacts",
  "field": "companyName",
  "value": "Contoso Ltd"
}

4. create_item

Create a new item in Business Central.

Parameters:

  • resource (string, required): Resource name
  • item_data (object, required): Item data to create

Example:

{
  "resource": "contacts",
  "item_data": {
    "displayName": "John Doe",
    "companyName": "Contoso Ltd",
    "email": "john.doe@contoso.com"
  }
}

5. update_item

Update an existing item.

Parameters:

  • resource (string, required): Resource name
  • item_id (string, required): Item ID (GUID)
  • item_data (object, required): Fields to update

Example:

{
  "resource": "customers",
  "item_id": "1366066e-7688-f011-b9d1-6045bde9b95f",
  "item_data": {
    "displayName": "Updated Name"
  }
}

6. delete_item

Delete an item from Business Central.

Parameters:

  • resource (string, required): Resource name
  • item_id (string, required): Item ID (GUID)

Example:

{
  "resource": "contacts",
  "item_id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"
}

Common Resources

  • companies - Company information
  • customers - Customer records
  • contacts - Contact records
  • salesOpportunities - Sales opportunities
  • salesQuotes - Sales quotes
  • salesOrders - Sales orders
  • salesInvoices - Sales invoices
  • items - Product/service items
  • vendors - Vendor records

Troubleshooting

See docs/TROUBLESHOOTING.adoc for detailed troubleshooting guides covering:

  • Authentication issues (401 errors, token problems)
  • client_credentials setup challenges and known issues
  • Company not found errors
  • Environment-specific configuration (Production vs Sandbox)

Development

# Install dependencies
npm install

# Build TypeScript
npm run build

# Watch mode for development
npm run dev

License

MIT

Contributing

Issues and pull requests welcome at https://github.com/knowall-ai/mcp-business-central

Related Projects

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选