内容
# Credit-AR MCP Server
客户信用与应收账款管理 MCP Server。适用于灵基(Lingee)、Claude Code、Dify、Coze 等支持 MCP 协议的 Agent 平台。
## 功能
提供 10 个 MCP 工具,覆盖信用评估、账龄分析、催收策略、订单信用检查等场景:
| 工具 | 说明 |
|------|------|
| `get_customer_credit` | 查询客户信用额度和使用情况 |
| `get_ar_aging` | 应收账款账龄分析 |
| `calculate_credit_score` | 信用评分计算 |
| `update_credit_limit` | 更新信用额度(需确认) |
| `list_overdue_customers` | 逾期客户列表 |
| `generate_collection_strategy` | 生成催收策略 |
| `check_order_credit` | 销售订单信用检查 |
| `create_collection_record` | 创建催收记录 |
| `get_collection_history` | 催收历史查询 |
| `batch_risk_report` | 批量风险报告 |
## 快速开始
```bash
npm install
npm run build
npm run init-db # 初始化示例数据
npm run start # STDIO 模式(Claude Code 等本地工具)
npm run http # HTTP 模式(灵基等远程平台)
npm run web # Web 演示面板 http://localhost:3721
```
## 架构
```
Agent 平台 (灵基/Claude Code/Coze)
│ MCP 协议
▼
┌──────────────────────┐
│ MCP Tools (10个) │
├──────────────────────┤
│ 规则引擎 │
│ (信用评分/催收/检查) │
├──────────────────────┤
│ 数据适配器 │
│ SQLite / Kingdee ERP │
└──────────────────────┘
```
数据适配器层解耦业务逻辑与数据源,生产环境替换为金蝶 ERP API 适配器即可。
## 灵基接入
在灵基 Build 模式添加 MCP 服务器:
- **名称**: 信用应收管理
- **URL**: `https://your-server:3721/mcp`
- **协议**: Streamable HTTP
- **认证**: Bearer Token
## License
MIT