MCP Hub
Back to servers

Coffee Company MCP Server

An MCP adapter that maps Coffee Company B2B HTTP APIs to MCP tools, allowing AI agents to query member information, benefits, coupons, and payment statuses. It enables seamless integration for AI assistants to manage coffee-related customer assets and loyalty details through natural language.

glama
Updated
Mar 7, 2026

Coffee Company MCP Server

Coffee Company B2B 开放平台 MCP Server —— 让 AI Agent 通过 MCP 协议调用Coffee Company现有 HTTP 开放平台能力。

所有 MCP Tool 严格 1:1 映射 openapi.coffeecompany.com 现有 HTTP 接口,不新增业务逻辑。 鉴权由 Kong 网关处理,MCP 层只做协议转换 + 语义化格式化。

Quick Start

# 安装依赖 (需要 uv + Python 3.13)
uv sync

# 运行完整 Demo(9 步流程演示)
uv run coffee demo

# 交互式模式
uv run coffee interactive

Architecture

B2B Agent (蔚来/千问/飞猪)
    │  MCP Protocol (SSE / Streamable HTTP)
    ▼
┌──────────── Kong ────────────┐
│  HMAC Auth ✓  ACL ✓  限流 ✓  │  ← 复用现有 B2B 客户凭证
│                              │
│  /sse, /mcp → MCP Adapter   │  ← 新增 2 条路由
│  /coupon/*  → 现有后端       │  ← 不动
└──────────────┬───────────────┘
               ▼
         MCP Adapter (本项目)
         ├── MCP 协议处理
         ├── Tool 权限过滤
         ├── 参数映射
         └── 语义化转换
               │  内网直连
               ▼
         openapi-platform 后端 (不动)

Phase 1 Tools(10 个只读,当前可用)

MCP ToolHTTP API功能
member_queryPOST /crmadapter/account/query查询会员信息
member_tierPOST /crmadapter/account/memberTier会员等级详情
member_benefitsPOST /crmadapter/customers/getBenefits8 项权益状态
member_benefit_listPOST /crmadapter/asset/coupon/getBenefitList券列表
coupon_queryPOST /coupon/query订单券码查询
coupon_detailPOST /coupon/detail券码详情
equity_queryPOST /equity/query权益发放查询
equity_detailPOST /equity/detail权益详情
assets_listPOST /assets/list客户全部资产
cashier_pay_queryPOST /cashier/payQuery支付状态查询

CLI 命令

uv run coffee member 138****1234          # 查会员(手机号)
uv run coffee member CC_M_100001       # 查会员(会员ID)
uv run coffee tier CC_M_100001         # 等级详情
uv run coffee benefits CC_M_100001     # 权益状态
uv run coffee assets CC_M_100001       # 全部资产
uv run coffee coupon CC20260301A001     # 券码详情
uv run coffee equity EQ_2026030100001    # 权益详情
uv run coffee pay PAY_TOKEN_001          # 支付状态

接入 Claude Code / Cursor

{
  "mcpServers": {
    "coffee-company": {
      "command": "uv",
      "args": ["--directory", "/path/to/coffee-company-mcp", "run", "coffee-company-mcp"]
    }
  }
}

B2B 场景示例

蔚来车机 Agent

车主: "帮我查一下我的Coffee Company会员等级和可用优惠券"

Agent 调用链:
  member_query(mobile="138****1234") → 确认金星会员
  member_tier(member_id="CC_M_100001") → 142 颗星,距钻星差 358 颗
  assets_list(member_id="CC_M_100001") → 3 张可用券

Docs

License

MIT

Reviews

No reviews yet

Sign in to write a review