Metadata-Version: 2.4
Name: erp-call-qc-mcp
Version: 1.0.0
Summary: 鼎尖 ERP 通话录音质检 MCP：脱敏查询、违规预检，配合 Skill 做 SABCD 作业评级
License: Proprietary
Project-URL: Homepage, https://open.workbuddy.cn/docs/connector
Project-URL: Documentation, https://open.workbuddy.cn/docs/connector
Keywords: mcp,dingjian,erp,call,qc,checkrecord,stdio,uvx,workbuddy
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.2.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0
Requires-Dist: pydantic-settings>=2.0
Requires-Dist: python-dotenv>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.24; extra == "dev"

# erp-call-qc-mcp

鼎尖 ERP **通话录音质检** MCP：第三方 SHA1 签名鉴权，查询通话记录并对 **主叫/被叫号码脱敏**，提供违规规则预检；配合 Skill 做盘点电话 **SABCD** 评级与敏感信息质检。

## 接口

| Tool | ERP API | 说明 |
| --- | --- | --- |
| `search_call_records` | `basedata/phoneManager/getCheckRecordListData` | 列表查询，号码脱敏；`include_transcript=true` 带回全文 |
| `scan_call_violations` | 同上（多页扫描） | 违规规则预检线索 |

返回字段使用 `callerMasked` / `calleeMasked`，工具层不输出明文号码。

## 环境变量

与 `erp-integral-mcp` 相同：

```bash
ERP_BASE_URL=https://your-host/dingjian/
ERP_SECRET=...
ERP_CU_ID=...
ERP_USER_ID=...
ERP_DC=...
```

## 本地运行

```bash
cd mcp/erp-call-qc-mcp
cp .env.example .env   # 填入凭证
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest
erp-call-qc-mcp        # stdio MCP
```

## uvx / Cursor

模板见 `mcp.install.json`、`mcp.cursor.json`：

```json
{
  "mcpServers": {
    "erp_call_qc": {
      "command": "uvx",
      "args": ["erp-call-qc-mcp@1.0.0"],
      "env": {
        "ERP_BASE_URL": "https://p.dingjianyun.com/dingjian/",
        "ERP_SECRET": "...",
        "ERP_CU_ID": "...",
        "ERP_USER_ID": "...",
        "ERP_DC": "..."
      }
    }
  }
}
```

本地开发也可：

```json
{
  "mcpServers": {
    "erp_call_qc": {
      "command": "/path/to/erp-call-qc-mcp/.venv/bin/erp-call-qc-mcp",
      "env": { "...": "..." }
    }
  }
}
```

连接器打包：

```bash
./scripts/pack-connector.sh
```

## Skill

管理层 SOP 见 `skills/erp-call-qc/SKILL.md`（仓库同步副本：`mcp/skills/erp-call-qc/SKILL.md`）。

- **场景 A**：盘点电话 SABCD 作业评级  
- **场景 B**：违规质检（询问电话/微信/钥匙密码等）
