Frontline Copilot MCP Server
Frontline Copilot
面向零售门店经理的 AI 评价分诊工具。
一个常驻系统,从任何来源摄取客户评价,使用 Claude 按类别和严重程度对评价进行分类,并将需要处理的评价路由到门店经理的 Airtable 任务列表——同时针对关键问题(食品安全、员工行为、健康风险)发送实时 Slack 警报。
同时以 MCP 服务器 形式提供,门店经理可以通过 Claude Desktop 以对话方式查询和分诊评价。
灵感来自新兴的 AI 门店运营副驾(copilot)品类。
问题
多门店零售连锁的门店经理被客户评价的信息淹没。大多数是噪音(表扬或轻微抱怨)。少数是紧急的(食品安全、歧视、受伤风险)。大多数工具要求经理阅读所有内容才能找到少数重要的——在大规模场景下这是一场必败之战。
Frontline Copilot 扭转了这一点。Claude 阅读所有内容;经理只看到需要处理的内容。
Related MCP server: ServiceTitan MCP Server
工作原理
┌────────────┐ ┌──────────────┐ ┌────────────┐ ┌────────────┐
│ Reviews │──▶│ Classifier │──▶│ Airtable │──▶│ Slack │
│ (JSON / │ │ (Claude API, │ │ (task │ │ (critical │
│ Google) │ │ tool use) │ │ tracker) │ │ alerts) │
└────────────┘ └──────────────┘ └────────────┘ └────────────┘
│
▼
┌──────────────┐
│ MCP server │◀── Claude Desktop, Cursor, ...
│ (3 tools) │
└──────────────┘每条评价被分类为九个类别之一,严重程度从 1(正面)到 5(严重)。严重程度 ≥ 3 的评价成为 Airtable 任务;严重程度 ≥ 4 的评价还会触发 Slack 警报。
截图
端到端流水线运行
21 条评价在 ~60 秒内处理完成。创建了 7 个任务,4 条实时严重警报。

Airtable — 任务看板
任务按严重程度排序,按类别着色。这就是门店经理看到的内容。

Airtable — 看板视图
相同的数据,按类别分组。问题分布一目了然。

Slack — 实时严重警报
Block Kit 卡片,采用行动优先的布局,并直接链接到 Airtable 任务。

技术栈
Python 3.10+ — 数据类、
str | None联合类型、pathlibAnthropic Claude API — 通过工具调用进行分类(
claude-haiku-4-5)Airtable REST API — 任务跟踪器,直接使用
requests调用Slack Incoming Webhooks — 使用 Block Kit 生成丰富的警报卡片
MCP(模型上下文协议) — 通过 FastMCP 提供对话式界面
评价源的适配器模式(内置 Mock;Google Places 为桩实现)
只有三个第三方依赖:anthropic、requests、mcp。其余全部是标准库。
快速开始
# 1. Clone and install
git clone https://github.com/miguelpomarm/frontline-copilot
cd frontline-copilot
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 2. Configure secrets
cp .env.example .env
# ... edit .env with your keys (see setup section below)
# 3. Run the pipeline
python triage.py
# 4. Launch as an MCP server (optional)
python mcp_server.py设置(一次性,~10 分钟)
1. Anthropic API 密钥
在 https://console.anthropic.com/ 获取。免费额度足以进行演示运行——21 条评价约花费 ~$0.03。
2. Airtable base
创建一个新的 base,其中包含一个名为 Tasks 的表,以及以下字段(名称必须完全一致):
字段 | 类型 |
Review ID | 单行文本(主字段) |
Store | 单行文本 |
Category | 单选——填入 9 个分类值 |
Severity | 数字(整数) |
Summary | 长文本 |
Review Text | 长文本 |
Author | 单行文本 |
Date | 日期 |
Status | 单选—— |
然后在 https://airtable.com/create/tokens 生成一个个人访问令牌,并在你的 base 上授予 data.records:read 和 data.records:write 权限范围。复制令牌和 base ID(以 app... 开头,可在 base 的 URL 中找到)。
3. Slack Incoming Webhook
在 https://api.slack.com/apps 创建一个 Slack 应用。启用 Incoming Webhooks,添加一个新的 webhook,指向应接收严重警报的频道,然后复制 webhook URL。
4. 填写 .env
ANTHROPIC_API_KEY=sk-ant-...
AIRTABLE_API_KEY=pat...
AIRTABLE_BASE_ID=app...
AIRTABLE_TABLE_NAME=Tasks
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/...5. 首次运行
python triage.py --limit 3 --dry-run # sanity check, no side effects
python triage.py --limit 3 # small live run
python triage.py # full 21 reviewsMCP 集成(Claude Desktop)
将此配置添加到 ~/Library/Application Support/Claude/claude_desktop_config.json(macOS)并重启 Claude Desktop:
{
"mcpServers": {
"frontline-copilot": {
"command": "python",
"args": ["/absolute/path/to/frontline-copilot/mcp_server.py"]
}
}
}然后,在 Claude Desktop 中:
"Aurora Times Square 现在怎么样?"
Claude 将调用 get_store_health("times_square"),访问 Airtable,并返回当前快照——待处理任务、严重数量、最高频类别。
设计决策
值得向评审者指出的刻意选择:
封闭式分类法 + Other 兜底
类别是固定的枚举,而不是自由格式。这保证了路由和指标的一致性。Other 是逃生舱——定期审查,根据真实数据扩展分类法,而不是事先猜测。
使用工具调用而非提示工程 Claude 通过带枚举约束的工具模式返回结构化输出。这消除了解析错误,并防止 LLM 幻觉出分类法之外的类别。
默认使用 Haiku 4.5 对于范围明确的分类任务,Haiku 速度快(亚秒级)、成本低(每条评价约 ~$0.001),且足够准确。在生产环境中,仅这一项决策在中等规模下每月就能节省数千美元。
评价源的适配器模式
ReviewSource 是一个抽象接口。随附 MockSource 和一个有文档说明的 GooglePlacesSource 桩实现。切换到 Yelp、TrustPilot 或专有数据源只需新增一个子类——流水线的其余部分无需改动。
按评价 ID 实现幂等性 重新处理相同的评价不会创建重复任务。每次创建前都会检查 Airtable。
严重程度阈值作为可调常量
ACTION_THRESHOLD 和 ALERT_THRESHOLD 是模块级常量。不同容忍度的客户只需修改两个数字,无需修改代码。
MVP 采用同步而非异步
顺序处理 21 条评价约需 ~40 秒。异步版本只需 ~15 行即可替换(AsyncAnthropic + 带信号量控制速率限制的 asyncio.gather)。对于这种规模,可读性胜过速度。
文本优先于星级 提示词明确告诉 Claude 以评价文本而非星级评分为准。一条提到食品安全的 4 星评价严重程度为 5,而不是 2。
路线图(未实现)
FastAPI webhook 端点(
POST /webhook/review),用于实时摄取而非批量运行。GooglePlacesSource— 适配器接口已完成,实际实现约需 1 小时的 API 集成 + 重试逻辑。感知速率限制的异步批处理,用于高吞吐量生产环境。
端到端测试(Playwright / pytest,记录 API 交互),验证 Airtable/Slack 副作用。
通过
config.yaml实现按客户配置阈值。
许可证
MIT — 参见 LICENSE。
由 Miguel Pomar Martínez 构建,作为技术作品集项目。
This server cannot be deployed
Maintenance
Related MCP Connectors
Build and manage AI-native customer support agents from Claude or any MCP client.
Connect your team's living knowledge base — docs, data, issues, CRM — to Claude and ChatGPT.
- platform7nOAuthtech.p7n
Connect Claude to your Platform7n workspaces — chat, links, and tasks. One-click OAuth.
- RoomtoneOAuthio.roomtone
Ask Claude about your meetings: summaries, action items and transcripts from Roomtone
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables Claude Desktop to interact with Salesforce for order management, including checking order status, creating returns, managing cases, and sending Slack notifications for customer service operations.6MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude Desktop to query ServiceTitan data about technician jobs and business performance via natural language, while protecting customer personal information.-
- FlicenseNot gradedqualityDmaintenanceEnables conversational triage of ServiceNow incidents via Claude Desktop, automatically classifying and routing them based on company knowledge.-
- AlicenseAqualityCmaintenanceConnects Claude Desktop to Notion and YouTube transcripts with one-click installation, enabling natural language queries about your pages and video content.52MIT