kingdee-mcp
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查看采购订单 20260806JX-01"
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
金蝶云星空(K3Cloud)MCP Server。通过 Model Context Protocol 让 AI 助手(Cursor、Claude Desktop、Claude Code、Cline、Cherry Studio 等)用自然语言查询和操作金蝶 ERP。已验证部署通过
AI 助手(Cursor / Claude / …)
│ MCP(stdio / SSE)
▼
kingdee-mcp
│ Kingdee Web API SDK
▼
金蝶云星空 K3Cloud功能特性
15 个 MCP 工具:查询、翻页/落盘/日期分片、查看详情、元数据;以及保存、提交、审核、反审核、删除、下推等
通用
form_id:同一套工具适配物料、客户、销售/采购订单、出入库等表单只读 / 读写模式:
readonly时写入工具会从工具列表中移除(并保留运行时守卫)自动会话恢复:会话超时后自动重新登录
多传输协议:
stdio(本地 IDE)、sse/streamable-http(远程)Docker 友好:默认监听
0.0.0.0:8181,可对接阿里云 CLB 等负载均衡
Related MCP server: Odoo MCP Server
环境要求
Python 3.10+
可访问的金蝶云星空环境
集成用户账号(建议专用账号,按最小权限授权)
快速开始
1. 安装
git clone https://github.com/YanSir1999/kingdee-mcp.git
cd kingdee-mcp
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
pip install -e .2. 配置环境变量
cp .env.example .env编辑 .env:
变量 | 必填 | 说明 |
| 是 | 金蝶地址,建议以 |
| 是 | 账套 ID |
| 是 | 集成用户账号 |
| 建议 | 密码( |
| 否 | SSE 监听地址;Docker/CLB 用 |
| 否 | SSE 端口,默认 |
| 否 |
|
| 否 | SSE/HTTP Bearer Token;不设则不鉴权 |
| 否 | 鉴权元数据对外 URL(启用 |
| 否 | SSE Host 白名单,逗号分隔;解决远程 |
3. 本地启动(stdio)
kingdee-mcp
# 或
kingdee-mcp --transport stdio --mode readonly客户端配置
Cursor(本地 stdio)
项目内 .cursor/mcp.json 示例:
{
"mcpServers": {
"kingdee-mcp": {
"command": "D:\\workspace\\kingdee-mcp\\.venv\\Scripts\\kingdee-mcp.exe",
"cwd": "D:\\workspace\\kingdee-mcp"
}
}
}凭证从项目根目录 .env 加载,无需写进 JSON。
Cursor(远程 SSE)
{
"mcpServers": {
"kingdee-mcp-remote": {
"url": "https://your-domain.example.com/sse"
}
}
}若启用了 MCP_API_KEY:
{
"mcpServers": {
"kingdee-mcp-remote": {
"url": "https://your-domain.example.com/sse",
"headers": {
"Authorization": "Bearer your-secret-api-key"
}
}
}
}Claude Desktop / 其他 MCP 客户端
{
"mcpServers": {
"kingdee-mcp": {
"command": "kingdee-mcp",
"args": ["--mode", "readonly"],
"env": {
"KD_SERVER_URL": "https://your-server/k3cloud/",
"KD_ACCT_ID": "your_acct_id",
"KD_USERNAME": "your_username",
"KD_PASSWORD": "your_password"
}
}
}
}Docker 部署
构建镜像
docker build -t kingdee-mcp:local .镜像默认:
传输:
sse模式:
readonly端口:
8181监听:
0.0.0.0
Compose
仓库已提供通用 docker-compose.yml(本地 build,无内网镜像地址):
docker compose up -d --build阿里云 CLB
典型拓扑:
客户端 https://your-domain/sse
→ CLB(443)
→ 后端 ECS/容器 :8181
→ kingdee-mcp(SSE)建议在 .env 中设置:
FASTMCP_HOST=0.0.0.0
FASTMCP_PORT=8181
MCP_ALLOWED_HOSTS=your-domain.example.com,localhost:*,127.0.0.1:*
MCP_ISSUER_URL=https://your-domain.example.com
MCP_MODE=readonly连通性自检:
curl -i -N -H "Accept: text/event-stream" https://your-domain.example.com/sse正常应返回 200 与 event: endpoint。
可用工具
查询工具(readonly / readwrite)
工具 | 说明 |
| 查询单据(二维数组) |
| 查询单据(JSON,字段名为 key) |
| 估算行数 |
| 自动翻页拉取 |
| 翻页流式落盘(ndjson/csv) |
| 按日期分片 + 翻页 |
| 单条详情 |
| 表单元数据 |
写入工具(仅 readwrite)
工具 | 说明 |
| 保存/新增 |
| 提交 |
| 审核 |
| 反审核 |
| 删除 |
| 自定义操作(禁用/反禁用等) |
| 下推 |
常用 form_id 示例:
FormId | 说明 |
| 物料 |
| 客户 |
| 供应商 |
| 销售订单 |
| 采购订单 |
| 生产订单 |
| 入/出库单 |
只读模式
默认 MCP_MODE=readonly(或 --mode readonly):
写入工具从 MCP 工具列表中移除
即使被直接调用,也会返回
只读模式:写入操作已禁用
kingdee-mcp --mode readonly # 仅查询
kingdee-mcp --mode readwrite # 开放写入自然语言示例
「查一下昨天的销售订单」
「查看采购订单 20260806JX-01」
「付款条件编码 023 是什么」
「统计本月销售订单数量」
调试
# MCP Inspector(远程 SSE)
npx @modelcontextprotocol/inspector https://your-domain.example.com/sse
# 单元测试
pip install -e ".[dev]"
pytest项目结构
kingdee-mcp/
├── src/kingdee_mcp/
│ ├── server.py # MCP Server 与工具实现
│ └── form_id_reference.py # 常用 FormId 参考
├── tests/
├── Dockerfile
├── docker-compose.yml
├── .env.example
├── LICENSE
├── NOTICE
├── SECURITY.md
├── pyproject.toml
├── README.md
└── README.en.md安全建议
不要将
.env提交到 Git(详见 SECURITY.md)生产环境优先
MCP_MODE=readonly远程 SSE 建议设置
MCP_API_KEY,并配置MCP_ALLOWED_HOSTS金蝶侧使用专用集成用户,按模块与数据范围最小化授权
致谢
核心能力与工具设计参考并受益于上游开源项目:
详见 NOTICE。
许可证
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 Servers
- Alicense-qualityAmaintenanceAn MCP server that enables AI assistants like Claude to interact with Odoo ERP systems through natural language, allowing users to search, create, update, and manage business data in their Odoo instance.Last updated357Mozilla Public 2.0
- AlicenseBqualityDmaintenanceAn MCP server that enables AI assistants to interact with Odoo ERP apps like Inventory, CRM, Sales, and Manufacturing. It allows users to read, create, and manage Odoo records and workflows using natural language commands.Last updated25291ISC
- 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-qualityCmaintenanceAn MCP server that enables AI assistants to interact with Odoo ERP, allowing natural language queries, record creation, updates, and deletions.Last updatedLGPL 3.0
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
Official Microsoft MCP Server to query Microsoft Entra data using natural language
GibsonAI MCP server: manage your databases with natural language
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/YanSir1999/kingdee-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server