Skip to main content
Glama
digoo2008

ai-crm-engine

by digoo2008
README.md
# AI 商机引擎 (MCP CRM)

> 专为 AI Agent 设计的 MCP 原生 CRM 后端 — 零 UI、Agent 优先、轻量可嵌入。

## 快速开始

```bash
# 安装
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

# 启动
.venv/bin/python src/server.py
# → 🚀 AI商机引擎 MCP Server 启动: http://127.0.0.1:8100
```

## MCP 工具清单(15 个)

### 客户管理 `customer.*`
| 工具 | 说明 |
|------|------|
| `customer_create` | 创建客户(含名称重复检测) |
| `customer_get` | 按 ID 获取客户 |
| `customer_search` | 多条件模糊搜索(名称/行业/地区/负责人) |
| `customer_list` | 分页列表 |

### 商机管理 `opportunity.*`
| 工具 | 说明 |
|------|------|
| `opportunity_create` | 创建商机(关联客户) |
| `opportunity_get` | 获取商机(含关联客户信息) |
| `opportunity_search` | 多条件搜索(阶段/负责人/金额区间) |
| `opportunity_update` | 更新字段(不含 stage) |
| `opportunity_list` | 分页列表 |
| `opportunity_stage_transition` | 阶段转换 + 审计日志 |

### 沟通纪要 `note.*`
| 工具 | 说明 |
|------|------|
| `note_create` | 创建沟通纪要 |
| `note_get` | 获取单条纪要 |
| `note_list_by_opportunity` | 按商机查纪要(时间倒序) |

### 跟进提醒 `followup.*`
| 工具 | 说明 |
|------|------|
| `followup_create` | 创建跟进提醒 |
| `followup_list_due` | 查询到期和即将到期提醒 |

### 管道健康 `stats.*`
| 工具 | 说明 |
|------|------|
| `stats_pipeline_health` | 阶段超时检测 |

## 技术栈

- Python 3.10+
- FastMCP 3.4+
- SQLite (WAL 模式)
- MCP 协议 HTTP JSON-RPC

## 验收状态

全部 22 项 AC 通过 ✅