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.
README
Coffee MCP
The MCP platform that connects beverage brands to every AI assistant.
When a customer says "help me order a latte" to ChatGPT, Claude, Doubao, or any AI assistant — only brands connected via MCP get discovered. This platform is how you get connected.
The Problem
AI assistants are becoming the new storefront. Hundreds of millions of users already ask AI to help them shop, order food, and make decisions. But most brands have zero presence in this channel — no way to be discovered, recommended, or ordered from.
Traditional APIs don't solve this. AI assistants speak MCP (Model Context Protocol) — the open standard for connecting AI to external tools and data.
The Solution
Coffee MCP is an open-source, multi-brand MCP platform that lets any coffee, tea, juice, or bakery brand plug into the AI ecosystem — with a YAML config and a brand adapter.
Customer → AI Assistant → MCP Protocol → Coffee MCP → Your Brand's Backend API
What you get:
- 21 consumer-facing tools (browse menu, find stores, order, pay, track)
- 10 B2B enterprise tools (member query, coupons, loyalty, payments)
- 4-tier security model (L0-L3) with rate limiting and transaction safety
- Multi-brand support — one platform, unlimited brands
- Category presets for coffee, tea, juice, and bakery
- Brand onboarding in as little as 5 minutes (CLI) or 30 minutes (AI-assisted)
What it costs: Nothing. MIT licensed. Self-host or extend as you wish.
Who Is This For?
| Audience | Value |
|---|---|
| Brand CTOs / Digital Leaders | Ship AI ordering for your brand in 2-3 weeks, not 6 months |
| AI/MCP Developers | Production-grade reference for multi-tenant MCP server design |
| Retail Tech Teams | Battle-tested security model (L0-L3) for AI-to-commerce flows |
| Founders | Fork this to build your own vertical MCP platform |
Quick Start
# Install (requires uv + Python 3.13)
uv sync
# Run consumer ordering server (default brand)
uv run coffee-company-toc
# Run with a different brand
BRAND=tea_house uv run coffee-company-toc
# Run B2B enterprise server
uv run coffee-company-mcp
# Run all tests (122 passing)
uv run python tests/test_toc_mcp.py # 89 ToC tests
uv run python tests/test_mcp_real.py # 33 B2B tests
# Initialize a new brand (interactive)
uv run brand-init
Architecture
┌──────────────────────────────┐
│ AI Assistants (MCP Clients) │
│ ChatGPT / Claude / Doubao │
│ OpenClaw / Cursor / Custom │
└──────────────┬───────────────┘
│ MCP Protocol
┌──────────────▼───────────────┐
│ Gateway (Kong/CloudFlare) │
│ OAuth · Rate Limit · WAF │
└──────────────┬───────────────┘
│
┌────────────────────┼────────────────────┐
│ │
┌────────▼─────────┐ ┌────────────▼───────────┐
│ B2B Server │ │ ToC Server (factory) │
│ 10 read tools │ │ 21 tools · L0-L3 │
│ Kong HMAC auth │ │ Multi-brand YAML │
└──────────────────┘ └────────────┬───────────┘
│
┌────────────▼───────────┐
│ BrandAdapter (ABC) │
│ 21 abstract methods │
├────────────────────────┤
│ DemoAdapter (mock) │
│ YourBrandAdapter (HTTP)│
└────────────────────────┘
Brand Onboarding
Three paths, pick what fits your team:
1. CLI Init (5 min) — Zero-code, YAML-driven:
uv run brand-init
# → Select: coffee / tea / juice / bakery
# → Generates brands/<your_brand>/brand.yaml
# → Done. Run the server.
2. AI-Assisted (30 min) — Give your API docs to Claude:
/brand-onboard https://api.yourbrand.com/docs
# → Generates adapter.py + brand.yaml + integration tests
3. Full Custom (1-2 weeks) — Implement BrandAdapter with 21 methods:
class MyBrandAdapter(BrandAdapter):
def nearby_stores(self, city=None, keyword=None):
resp = httpx.get(f"{self.api}/stores", params={"city": city})
return resp.json()["stores"]
# ... 20 more methods
See Brand Integration Guide for the complete walkthrough.
Category Presets
| Preset | Sizes | Extras | Sweetness |
|---|---|---|---|
| Coffee | tall / grande / venti | espresso shots, syrups | 4 levels |
| Tea | regular / large | boba, pudding, taro | 5 levels |
| Juice | regular / large | chia seeds, nata | 3 levels |
| Bakery | single / combo | gift box | — |
Consumer Tools (ToC Server — 21 Tools)
The full ordering journey, from discovery to delivery:
| Group | Tools | Security |
|---|---|---|
| Utility | now_time_info |
L0 |
| Discovery | campaign_calendar · available_coupons · claim_all_coupons |
L1-L2 |
| Account | my_account · my_coupons · my_orders |
L1 |
| Menu | nearby_stores · store_detail · browse_menu · drink_detail · nutrition_info |
L0 |
| Points | stars_mall_products · stars_product_detail · stars_redeem |
L1-L3 |
| Order | delivery_addresses · create_address · store_coupons · calculate_price · create_order · order_status |
L1-L3 |
Security Model
Four tiers designed for AI-to-commerce, where the AI acts on behalf of the user:
- L0 (60/min) — Public data: menus, stores, nutrition
- L1 (30/min) — User data: account, coupons, orders
- L2 (5/hour) — Write ops: claim coupons, add address
- L3 (10/day) — Transactions: create order, redeem points
- Requires
confirmation_tokenfromcalculate_price - Requires
idempotency_keyto prevent duplicate operations
- Requires
Enterprise Tools (B2B Server — 10 Tools)
For partner integrations (delivery platforms, loyalty aggregators, payment providers):
| Tool | HTTP API | Description |
|---|---|---|
member_query |
POST /crmadapter/account/query | Query member by mobile/openId/memberId |
member_tier |
POST /crmadapter/account/memberTier | Tier details + stars balance |
member_benefits |
POST /crmadapter/customers/getBenefits | 8 benefit statuses |
member_benefit_list |
POST /crmadapter/asset/coupon/getBenefitList | Coupon list |
coupon_query |
POST /coupon/query | Order coupon status |
coupon_detail |
POST /coupon/detail | Coupon details |
equity_query |
POST /equity/query | Equity distribution status |
equity_detail |
POST /equity/detail | Equity details |
assets_list |
POST /assets/list | All customer assets |
cashier_pay_query |
POST /cashier/payQuery | Payment status |
Connect to AI Assistants
Claude Desktop / Cursor (stdio):
{
"mcpServers": {
"coffee-toc": {
"command": "uv",
"args": ["run", "--directory", "/path/to/coffee-mcp", "coffee-company-toc"],
"env": { "BRAND": "coffee_company" }
}
}
}
OpenClaw / Agent SDK (Streamable HTTP):
coffee = McpServer.http(
url="https://mcp.yourbrand.com/mcp",
headers={"Authorization": f"Bearer {token}"}
)
agent.add_mcp_server(coffee)
Project Structure
brands/ # Brand configs (zero-code onboarding)
├── coffee_company/brand.yaml # Default demo brand
└── tea_house/brand.yaml # Example: tea chain
src/coffee_mcp/
├── toc_server.py # ToC server factory (21 tools)
├── brand_config.py # YAML config loader
├── brand_adapter.py # BrandAdapter ABC (21 methods)
├── demo_adapter.py # Mock data adapter
├── brand_init.py # CLI brand initializer
├── presets/catalog.py # Category presets
├── server.py # B2B server (10 tools)
└── cli.py # CLI + REPL
docs/
├── BRAND_INTEGRATION_GUIDE.md # Step-by-step brand onboarding
├── TOC_MCP_PLATFORM_DESIGN.md # Platform design & competitive analysis
├── TOC_SECURITY.md # Security architecture (L0-L3)
└── MCP_API_DESIGN_GUIDE.md # MCP tool design principles
Docs
- Brand Integration Guide — Connect your brand step by step
- Platform Design — Architecture, competitive analysis, roadmap
- Security Model — L0-L3 threat model for AI-commerce
- API Design Guide — MCP tool design principles
Roadmap
- [ ] Hosted multi-tenant mode (brands self-register, zero-deploy)
- [ ] Payment provider integrations (Alipay, WeChat Pay, Stripe)
- [ ] Analytics dashboard (AI ordering funnel, conversion tracking)
- [ ] More verticals beyond beverage (fast food, convenience stores)
Contributing
PRs welcome. See the Brand Integration Guide if you want to add support for a new brand or category.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。