Coffee Company MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
uv sync
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add coffee-company-mcp -- node "<FULL_PATH_TO_COFFEE_COMPANY_MCP>/dist/index.js"

Replace <FULL_PATH_TO_COFFEE_COMPANY_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

An MCP adapter that maps Coffee Company B2B HTTP APIs to MCP tools.

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 Tool HTTP API 功能
member_query POST /crmadapter/account/query 查询会员信息
member_tier POST /crmadapter/account/memberTier 会员等级详情
member_benefits POST /crmadapter/customers/getBenefits 8 项权益状态
member_benefit_list POST /crmadapter/asset/coupon/getBenefitList 券列表
coupon_query POST /coupon/query 订单券码查询
coupon_detail POST /coupon/detail 券码详情
equity_query POST /equity/query 权益发放查询
equity_detail POST /equity/detail 权益详情
assets_list POST /assets/list 客户全部资产
cashier_pay_query POST /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

Tools (10)

member_queryQuery member information
member_tierGet member tier details
member_benefitsGet 8 items of benefit status
member_benefit_listGet list of coupons
coupon_queryQuery order coupon code
coupon_detailGet coupon code details
equity_queryQuery equity issuance
equity_detailGet equity details
assets_listGet all customer assets
cashier_pay_queryQuery payment status

Configuration

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

Try it

Check my Coffee Company member tier and current star balance.
List all available coupons for member ID CC_M_100001.
Verify the payment status for transaction PAY_TOKEN_001.
Get a summary of all assets and benefits for the member with phone number 138****1234.

Frequently Asked Questions

What are the key features of Coffee Company MCP Server?

Maps Coffee Company B2B HTTP APIs to MCP tools. Supports querying member profiles, tiers, and benefits. Provides access to coupon and equity details. Enables payment status verification via API. Strict 1:1 mapping to openapi.coffeecompany.com endpoints.

What can I use Coffee Company MCP Server for?

Integrating coffee loyalty data into automotive AI assistants. Automating customer support queries for B2B coffee account management. Building AI-driven dashboards for tracking member assets and rewards.

How do I install Coffee Company MCP Server?

Install Coffee Company MCP Server by running: uv sync

What MCP clients work with Coffee Company MCP Server?

Coffee Company MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Coffee Company MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare