Connecting
Endpoint:The gateway mounts the MCP app under
/mcp (app.mount("/mcp", create_mcp_app())), and FastMCP’s inner route is versioned (streamable_http_path="/v1"), so the public endpoint is /mcp/v1 — not /mcp/mcp.Authentication
Two layers — Agent identity at the connection layer, user authorization via a tool parameter:- Agent identity (API Key)
Passed at the connection layer via the Generated when you create an Agent in the console (console.hicaspian.com/agents).
Authorization: Bearer clw_... header, validated by MCPAuthMiddleware; required on every MCP request.Tool contract
All tools follow the same calling convention:- Parameters: passed as a JSON object. Every business tool carries
consent_grant_id(the binding tools are the exception); cross-step IDs (cart_id/quote_id/preview_id/confirmation_token, etc.) are issued by the gateway and must be passed back verbatim — never fabricated or reused across flows. - Responses: structured JSON; see each tool page for its full fields.
- Errors: the unified
{"error": {"code", "message"}}format. See Error handling.
Multilingual
Responses can be returned in the language you choose: shop names, item names, specs and add-ons, labels, order status and error messages are all localized. One ofzh (Chinese, default) / en / ja / ko / ru / ms / es; any other value returns 400. To also keep the Chinese original, see “Bilingual responses” below.
Two ways to set it — pick one:
- At binding time: pass
langtorequest_user_bind. Every later call for that user uses this language, so you don’t pass it again. - Per call: pass
langon a supporting tool; it affects only that call.
lang: search_addresses, search_shops, get_shop_info, get_shop_menu, get_item_options, get_item_description, quote_cart, list_coupons, preview_order, create_order, get_order_status, list_orders.
In the create_order callback_url payload, status_text also follows the language set at binding time.
Three things to know before you integrate
- Description-type content may still be Chinese on first read. Item descriptions, recommendation blurbs, and address results from the 11th onward may come back in Chinese the first time; query again shortly and they are in your language. Display whatever you receive.
- When a response carries
localization: "degraded", translation is temporarily unavailable and the payload may contain Chinese. This is transient — retry and it recovers. The field is absent under normal operation. - These pages are always Chinese, regardless of
lang: the payment page, the order detail page (opened viadetail_urlor the payment link), and the courier app. Tell your users when you hand them these links.
contact_name) is never translated — it is stored and shown exactly as entered so it matches the delivery details. Names are capped at 12 characters; longer values return 400. For non-Chinese names we suggest “given name + last-name initial”, e.g. Alexander Petrov → Alexander P.
Bilingual responses
To keep the Chinese original alongside the translation (for example, so staff can verify an item name), passinclude_chinese=true (boolean, defaults to false):
- Off by default: without
include_chinese, or with it set tofalse, the response never has<key>_zh. Only an explicittruereturns the Chinese original. - Pass it together with
lang: setlangto the target language (e.g.en) andinclude_chinesetotrueat the same time. - When
langis Chinese (zh) or not passed at all,include_chinesehas no effect and never errors — a Chinese response is already Chinese, so there’s nothing to attach. - Scope matches single-language
lang: set it at binding time viarequest_user_bind, or per call on any tool that acceptslang. The binding-timeinclude_chineseonly applies when this call passes neitherlangnorinclude_chinese. As soon as a call passeslang,include_chinesefor that call falls back to its default (false) instead of inheriting the binding-time setting — pass both together whenever a single call needs bilingual output.
include_chinese=true, every field that was translated successfully gets a sibling <key>_zh next to it, holding the Chinese original:
<key>_zh:
- Same type as the original field, no exceptions. A string field pairs with a string; a string-array field pairs with a string array of the same order and length (see
tags/tags_zhabove). - Only appears when that field was translated successfully this time. No
_zhmeans this field wasn’t translated this time, and the field itself is Chinese — you can check translation success field by field, with no need to check any other status field in the response. - Only covers merchant data — shop names, item names, specs, add-ons, labels, and the like. Prompts generated by the platform itself (opening-hours notices, minimum-order-gap notices, etc.) are single-language only and never get a
_zh. item_id/sku_id/price/image_url, coordinates, and timestamps aren’t language-specific and never get a_zh.delivery_fee_text(the delivery-fee display text, e.g. “Delivery ¥2”) is an exception: it never gets adelivery_fee_text_zh, even when translation succeeds. The delivery fee amount itself is in thedelivery_feefield (a number) and isn’t language-specific.
Tool list
The MCP Server exposes 24 tools, grouped below by function. Each tool links to its tool page (with full parameters and response fields).Authorization
Shops
Addresses
Ordering
Payment
Ordering flow
The tool-call order from search to checkout — each step’s output feeds the next:search_shops→ returnsshop_id+cart_id(cart_idalready encapsulates the delivery coordinates)get_shop_menu→ pick items, getitem_id/sku_idquote_cart→ price the cart, getquote_idselect_address→ getaddress_idpreview_order→ getpreview_id+confirmation_tokencreate_order→ getorder_idget_sign_action→ complete payment via password-free signing

