Kingdee MCP Server
The Kingdee MCP Server enables AI assistants to directly interact with and operate Kingdee Cloud Star (金蝶云星空) ERP through natural language, covering procurement, sales, inventory, production, finance, and system administration across 60+ tools.
Query Data
Purchase orders, sales orders, stock movements, inventory, production orders, MRP results, cost centers, fixed assets, and more.
Create & Modify Documents
Save/update purchase orders, sales orders, production orders, cost adjustments, fixed assets, and any bill type.
Submit, Audit, Unaudit & Delete
Manage document workflow states across all supported forms.
Push/Convert Documents
Generate downstream documents (e.g., sales order → delivery note, purchase order → stock-in, production order → pick material order).
Convenience Tools
One-step create-and-audit (
kingdee_create_and_audit) and push-and-audit (kingdee_push_and_audit) to streamline workflows.
Workflow & Approvals
Query pending approvals, check workflow status, approve/reject bills, and view approval flow records.
Master Data
Query materials, customers/suppliers, users, roles, permissions, sequence rules, and system configuration.
Metadata & Form Discovery
List available forms (
kingdee_list_forms), retrieve field definitions with business rules (kingdee_get_fields), and discover form-to-table mappings.
Audit & Compliance
Query audit logs, operation logs, change/modification records, approval flows, and data backups.
Cost & Production Management
Query material costs, cost trends, instant cost comparisons, production plans, quality inspections, and product standard costs.
SQL Server Database Exploration (optional, requires SQL Server config)
Search tables/columns, describe table structures, and discover metadata candidates by form ID.
Usage Monitoring
View usage reports and statistics.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Kingdee MCP Server查询本月已审核的采购订单"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Kingdee MCP Server —— 让 AI 直接操作金蝶云星空 ERP
Kingdee MCP Server 是金蝶云星空(Kingdee Cloud Star)ERP 的 MCP(Model Context Protocol) 服务端,让 Claude、Cursor、Windsurf、Cline 等 AI 助手能够通过自然语言直接操作金蝶 ERP 系统。
官方网站:https://wahailong.github.io/KingdeeMCP/
为什么需要金蝶 MCP?
传统 ERP 操作繁琐,需要在多个界面间切换。有了 金蝶 MCP Server,你可以:
直接对 AI 说:"查询本月已审核的采购订单"
直接对 AI 说:"帮我新建一张销售订单"
直接对 AI 说:"审核这几张入库单"
在微信、WhatsApp、Telegram 中通过 OpenClaw 操作金蝶
AI 会自动调用金蝶 API 完成操作,无需手动登录 ERP 界面。
Related MCP server: MCP Server for Odoo
对实施与开发的价值
实施阶段
快速验证配置:用自然语言直接查数据,无需登录 ERP 界面逐层点菜单
数据核查:批量查询单据状态、库存数量,快速定位问题
客户演示:现场说"查一下你们的采购订单",AI 实时返回结果,演示效果直观
日常使用
业务人员自助查询,减少依赖实施人员的频率
批量提交、审核单据,替代重复的手工操作
通过微信 / WhatsApp 直接操作金蝶,无需打开 ERP 客户端
开发阶段
用
kingdee_list_forms、kingdee_get_fields快速探索表单结构,替代翻文档自然语言调试接口,比手写 API 请求效率更高
可作为内部工具基础进行二次开发,快速扩展自定义工具
支持的 AI 客户端
客户端 | 支持方式 |
原生 MCP | |
原生 MCP | |
原生 MCP | |
原生 MCP | |
原生 MCP | |
原生 MCP | |
微信/WhatsApp/Telegram 中使用;将本页地址发给 OpenClaw,它会自动完成安装并引导填写金蝶配置 | |
其他 MCP 兼容客户端 | 原生 MCP |
功能特性
86 个工具:覆盖生产、成本、资产、审计、采购、销售、库存等 13 大业务域
元数据动态查询:
get_bill_template/validate_bill/refresh_metadata,元数据本地缓存4 个 SQL Server 探查工具:搜索表、搜索字段、查看表结构、金蝶元数据候选发现
自然语言操作:用中文直接描述需求,AI 自动转换为 API 调用
异步高性能:基于 async/await,支持并发请求
自动重试:Session 过期自动重登,连接失败自动重试
安全认证:采用金蝶官方 WebAPI 认证,账号密码(ValidateUser)登录,兼容公有云和私有云,无第三方应用授权
类型安全:基于 Pydantic 数据验证,参数自动补全
易于扩展:基于 FastMCP 框架,轻松添加自定义工具
使用示例:提供 9 个常见业务场景示例,覆盖查询、新建、审核、下推等操作
快速安装
pip install kingdee-mcp或使用 uvx 直接运行(推荐,无需手动安装):
uvx kingdee-mcp配置教程
第一步:金蝶云星空后台授权
准备一个金蝶云星空账号(建议专用集成账号,不要用 Administrator)
本服务采用**账号密码(ValidateUser)**登录,无需创建第三方应用、也无需 AppID / AppSecret
为该账号分配所需模块的操作权限
第二步:配置 MCP 客户端
在你的 MCP 客户端配置文件中添加以下内容:
{
"mcpServers": {
"kingdee": {
"command": "uvx",
"args": ["kingdee-mcp"],
"env": {
"KINGDEE_SERVER_URL": "http://your-server/k3cloud/",
"KINGDEE_ACCT_ID": "你的账套ID",
"KINGDEE_USERNAME": "金蝶账号",
"KINGDEE_PASSWORD": "金蝶账号密码"
}
}
}
}配置文件位置:
客户端 | 配置文件路径 |
Claude Desktop (Windows) |
|
Claude Desktop (macOS) |
|
Cursor | Settings → MCP → Add Server |
Claude Code CLI |
|
OpenClaw | 使用 |
第三步:重启客户端
配置完成后重启你的 MCP 客户端即可开始使用。
OpenClaw 用户:使用
openclaw mcp set配置后会自动热加载,无需重启网关。
环境变量说明
变量 | 说明 | 示例 |
| 金蝶服务器地址(需包含 /k3cloud/) |
|
| 账套ID |
|
| 金蝶账号 |
|
| 金蝶账号密码(ValidateUser 登录,必填) |
|
| SQL Server 主机(可选,用于数据库探查) |
|
| SQL Server 端口(默认 1433) |
|
| 数据库名 |
|
| SQL Server 用户(建议只读账号) |
|
| SQL Server 密码 |
|
⚠️ 从 0.1.0 升级的破坏性变更(重要)
0.2.0 起,登录方式从「第三方应用授权(AppID + AppSecret)」改为「账号密码(ValidateUser)」,旧版的 KINGDEE_APP_ID / KINGDEE_APP_SEC 环境变量已失效。
如果你之前的 MCP 客户端配置里用的是 AppID / AppSecret,升级后会出现登录失败。请按以下方式迁移:
在金蝶云星空创建一个专用集成账号(不要用 Administrator);
把 MCP 配置里的环境变量改为:删除
KINGDEE_APP_ID、KINGDEE_APP_SEC,新增KINGDEE_PASSWORD= 该集成账号的密码;重启 MCP 客户端。
之所以改用账号密码,是为了避开第三方应用授权的 APP 白名单限制,公有云 / 私有云都通用。
可用工具列表
共 86 个工具,按业务域分组(每组列出代表性工具,完整清单见 src/kingdee_mcp/server.py):
业务域 | 数量 | 代表性工具 |
通用单据 | 10 |
|
生产制造 | 12 |
|
成本核算 | 12 |
|
固定资产 | 6 |
|
库存 | 9 |
|
审计合规 | 7 |
|
采购 | 4 |
|
销售 | 2 |
|
工作流/审批 | 4 |
|
基础资料/权限 | 4 |
|
元数据/探查 | 8 |
|
系统/查询 | 4 |
|
统计 | 2 |
|
元数据探查含 4 个 SQL Server 工具(
kingdee_discover_tables/kingdee_discover_columns/kingdee_describe_table/kingdee_discover_metadata_candidates),需配置MCP_SQLSERVER_*环境变量。
元数据查询
工具名称 | 功能说明 |
| 搜索可用表单(不知道 form_id 时使用) |
| 获取表单字段列表 |
数据查询(只读操作)
工具名称 | 功能说明 |
| 通用单据查询,支持任意 form_id |
| 查看单据完整详情 |
| 查询采购订单 |
| 查询销售订单 |
| 查询销售报价单(SAL_Quotation) |
| 查询出入库单据 |
| 查询即时库存 |
| 查询物料档案 |
| 查询客户/供应商档案 |
单据操作(写操作)
工具名称 | 功能说明 |
| 新建或修改单据 |
| 提交单据 |
| 审核单据 |
| 反审核单据 |
| 删除单据 |
使用示例
配置完成后,在 Claude 或其他 AI 客户端中直接用自然语言操作:
# 查询类
查询最近 20 条已审核的采购订单
查一下物料编码 MAT001 的即时库存
查询客户编码 C001 的所有销售订单
显示本月所有未提交的销售订单
# 操作类
帮我新建一张采购订单,供应商 S001,物料 MAT001,数量 100,单价 10.5
审核这几张采购入库单:12345, 12346, 12347
反审核销售订单 SO2024001SQL Server 探查工具(可选)
配置 MCP_SQLSERVER_* 环境变量后可用,帮助理解金蝶数据库结构:
工具名称 | 功能说明 |
| 按关键字搜索数据库表名 |
| 按关键字搜索字段名(含所在表) |
| 查看表完整结构(字段、类型、主键、外键) |
| 根据 form_id 发现对应的数据库表名 |
典型用法:先问 AI "采购订单在数据库里对应哪张表",再用 kingdee_describe_table 看字段结构。
支持的单据类型(form_id)
form_id | 说明 |
| 采购订单 |
| 销售订单 |
| 采购入库单 |
| 销售出库单 |
| 其他出库单 |
| 其他入库单 |
| 直接调拨单 |
| 物料档案 |
| 客户档案 |
| 供应商档案 |
| 即时库存 |
常见问题
Q: 提示认证失败怎么办? 检查金蝶账号与密码(KINGDEE_PASSWORD)是否正确,该账号是否有对应模块的操作权限。
Q: 连接超时怎么解决?
检查 KINGDEE_SERVER_URL 是否正确(需包含 /k3cloud/ 后缀),确保服务器可访问。
Q: 支持金蝶云星空公有云吗? 支持。公有云和私有云使用相同的账号密码(ValidateUser)认证方式,配置方式完全一致。
Q: 用 uvx kingdee-mcp 启动时报 No module named 'mcp.server.fastmcp'?
这是 uvx 的临时环境偶尔没把依赖(mcp)装全导致的,不是包本身的问题(PyPI 元数据已正确声明 mcp[cli]>=1.0.0)。两种解决方式:
清理 uv 缓存后重试:
uv cache clean,再重新启动uvx kingdee-mcp;或改用 pip 安装 + 模块方式启动(更稳,推荐用于生产):
pip install kingdee-mcpMCP 客户端配置改为:
{ "mcpServers": { "kingdee": { "command": "python", "args": ["-m", "kingdee_mcp.server"], "env": { "KINGDEE_SERVER_URL": "...", "KINGDEE_ACCT_ID": "...", "KINGDEE_USERNAME": "...", "KINGDEE_PASSWORD": "..." } } } }
配合 mcp-sqlserver-introspect 使用
kingdee-mcp 提供两层能力:
第一层:ERP 操作层(kingdee-mcp 内置) 直接操作金蝶单据:查询、新建、提交、审核、下推等。
第二层:数据库理解层(mcp-sqlserver-introspect) 探查 SQL Server 表结构:找表、找字段、理解关联关系。
典型使用场景:
# 场景一:接口映射
问:"帮我找采购订单相关的表"
→ mcp-sqlserver-introspect 返回 T_PUR_PurchaseOrder 等表
→ 确认 Kingdee API 字段和数据库字段的对应关系
# 场景二:字段溯源
问:"帮我查 FTotalAmount 这个字段在哪些表里"
→ mcp-sqlserver-introspect 返回包含该字段的表列表
# 场景三:数据核查
先用 mcp-sqlserver-introspect 探索表结构
再用 kingdee-mcp 操作 ERP 数据
两者配合,AI 既能理解数据库,又能操作 ERPmcp-sqlserver-introspect 项目地址:https://gitee.com/lzhrick123/mcp-sqlserver-introspect1
kingdee-mcp 已内置 SQL Server 探查工具(配置
MCP_SQLSERVER_*环境变量即可使用),无需额外安装 mcp-sqlserver-introspect。
Q: 如何添加自定义工具?
基于 FastMCP 框架,在 server.py 中添加 @mcp.tool() 装饰器方法即可扩展。
相关链接
License
MIT © WaHaiLong
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 Servers
- -license-quality-maintenanceEnables AI assistants to interact with Odoo ERP systems through natural language to search records, create entries, update data, and manage business operations. Supports secure authentication and configurable access controls for production environments.Last updated
- Alicense-qualityBmaintenanceEnables AI assistants to interact with Odoo ERP systems through natural language, allowing users to search, create, update, and manage business records like customers, products, and invoices across any Odoo instance.Last updated1Mozilla Public 2.0
- AlicenseAqualityAmaintenanceMCP server for Kingdee K3Cloud ERP that enables AI assistants to query and operate ERP data via natural language through the Model Context Protocol.Last updated1545Apache 2.0
- Alicense-qualityDmaintenanceEnables AI assistants to interact with ECOUNT ERP through natural language, providing tools for products, inventory, sales, purchases, and more.Last updated392MIT
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
Connect AI assistants to Stellary projects, boards, documents, and governed agent workflows.
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/WaHaiLong/KingdeeMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server