# Espresso Cash MCP (llms.txt) # One MCP server for AI agents: flights, hotels and Shopify stores paid in USDC on Solana through a per-purchase # on-chain escrow (captured only when the supplier confirms, refunded otherwise), and a game's play logs for its # creator. Human docs: https://mcp.espressocash.com/ # Building a site or game that charges its users? That is Espresso Connect: https://docs.espressocash.com ## Connect Server: https://mcp.espressocash.com/mcp — MCP Streamable HTTP, plain JSON answers, no SSE stream, no session. Claude Code: claude mcp add --transport http espresso https://mcp.espressocash.com/mcp mcp.json: {"mcpServers": {"espresso": {"url": "https://mcp.espressocash.com/mcp"}}} ## Cost Free up to the purchase: every search, quote and read costs nothing over MCP (rate-limited instead). The only payment is the purchase itself, into its own escrow. ## What the agent needs To search and quote: nothing. To buy: the buyer's Solana wallet (funding_wallet: funds the escrow, gets refunds) and a way to sign an x402 USDC payment from it. The traveller's / recipient's real details: ask, never invent. ## Quickstart (flight) brij_search_flights {"origin_iata":"LIS","destination_iata":"JFK","depart_date":"2027-01-15","adults":1} -> offers[].offer_id; poll brij_get_flight_search_updates {search_id} while status = enriching brij_create_flight_intent {"offer_id":"","funding_wallet":""} -> intent_id, customer_support_code (keep) brij_book_flight {"intent_id":"","passengers":[{"given_name":"Ana","family_name":"Silva","born_on":"1990-04-02", "title":"ms","gender":"f","email":"ana@example.com","phone_number":"+351912345678"}]} -> payment requirements; sign, call again with _meta["x402/payment"] (or x402_payment) brij_get_intent {"intent_id":""} -> booked + booking_reference (the PNR) ## Flows (pass every id back exactly as received) Flights: brij_search_flights -> brij_get_flight_search_updates (until complete; slower sellers add nonstops and cheaper fares) -> (brij_get_flight_offer_details) -> brij_create_flight_intent -> brij_book_flight -> brij_get_intent (booking_reference = the PNR once ticketed; relay it to the traveller). Hotels: (brij_find_hotel_places) -> brij_search_hotels -> brij_get_hotel_rates -> brij_quote_hotel -> brij_create_hotel_intent -> brij_book_hotel -> brij_get_hotel_order. Cancel: brij_cancel_hotel. Shop: brij_shop_search -> (brij_shop_product, brij_shop_store, brij_shop_stores) -> brij_shop_quote -> brij_create_shop_intent -> brij_shop_buy -> brij_get_shop_order. Up to 10 items of one store per quote. Game logs: brij_create_game_logs_key (once) -> brij_game_logs {game, game_logs_key} (see "Game play logs" below). ## Game play logs: enable them in a web game (for the creator's coding agent) 1. The game's host must be a verified Espresso Connect site (https://connect.espressocash.com/developers, domain proven, ACTIVE). Check: GET https://api.espressocash.com/connect/v2/sites/lookup?origin=https:// -> 200, "verified": true. Its payout_wallet is the creator (reads the logs). GitHub Pages: register https://.github.io (proof file in the .github.io repo + an empty .nojekyll); one site covers all your games. 2. In the game's page, before the game's code: 3. Call brij.log(type, data) at telling moments: brij.log("point", {won: false, shot: "lob", rally: 7}); brij.log("quit", {screen: "settings", after_s: 95}). Nothing is sent before the first brij.log() call (ask players first if you want consent). Then session_start / hidden / session_end are added automatically; batches every 10 s. type: 1-40 chars of A-Z a-z 0-9 _ . : -; data: an object <= 2 KB, strings <= 200, keys <= 40, 3 levels deep. No personal data (players are an anonymous browser id, window.brij.player). 4. Game id = page host + folder (tennis.example.com, you.github.io/tennis); override with data-game on the script tag. 5. Once, from the payout wallet: brij_create_game_logs_key {game} (x402, 0.01 USDC; the payment proves the wallet, any other payer is refused before being charged) -> {api_key: "brij_logs_…", host, espresso_site_id}. Shown once; one key per host (all its games); a new one replaces it. Store it as a CI secret (GAME_LOGS_KEY). 6. Daily (e.g. a GitHub Action): brij_game_logs {game, game_logs_key, since?, cursor?, exclude_players?}, or POST https://mcp.espressocash.com/games/logs/read with header X-Game-Logs-Key -> summary by type + events (1000 per page). Limits: 200 events/batch, 20,000 events and 5 MB per game per day, kept 90 days. ## For Espresso Connect: logs keys in the developer console On an ACTIVE verified site, a "Game logs" button: POST https://mcp.espressocash.com/games/keys {"game": ""} -> 402 (x402, 0.01 USDC to BRIJ). The owner approves it from the site's payout wallet; resend with PAYMENT-SIGNATURE. We check the payer = the payout_wallet of your public lookup for that origin before settling (else 403 not_game_owner, not charged). -> {api_key: "brij_logs_…", host, espresso_site_id, espresso_site_name, wallet}: show it once (GitHub secret GAME_LOGS_KEY) or keep it for the site's tools; we keep only its hash. Calling again rotates it. Errors: 404 game_not_registered, 403 not_game_owner, 400 invalid_game. ## Payment 1. brij_create_*_intent {offer_id, funding_wallet, refund_wallet?, promo_code?} -> escrow address, amount, customer_support_code. SAVE customer_support_code: it is never returned again; orders and refunds need it. 2. The book/buy tool answers with x402 payment requirements for that escrow (structuredContent of the tool error). Sign them with the funding wallet and call the same tool again with the payment in _meta["x402/payment"] (or the x402_payment argument: the base64 PAYMENT-SIGNATURE value). Settlement: _meta["x402/payment-response"]. 3. Confirmed -> captured. Anything else -> refunded in full to the refund wallet fixed at intent creation. Escrow amounts are all-in. Service fee: flights 10 USDC + 2 % (max 15 % of the fare), hotels 5 + 2 % (max 30), Shop 2 + 3 %. ## Limits Per client, by cost: reads 120 (1/s back), flight search 10 (1 per 3 min), hotel calls 40 (1 per 10 s), Shop calls 20 (1 per 30 s), intents 2 (1 per 30 min), refund requests 3/hour. The same call within 15 min is free (poll freely). Refused: tool error 429 mcp_rate_limited / mcp_capacity_exhausted with retry_after_seconds. A refused call is never charged. Partner key: Authorization: Bearer brij_mcp_… (5x limits per X-BRIJ-Agent, own pool). Ask for one. ## Tools (live list) Flights: - brij_search_flights: Search flights. Prices are all-in (fees included). If the answer says the search is still enriching, call brij_get_flight_search_updates with its search_id. - brij_get_flight_search_updates: Poll a flight search. Poll a progressive search for offers still arriving (free). - brij_get_flight_offer_details: Flight offer details. Drill into one offer: every fare, bag prices, live price. - brij_create_flight_intent: Lock a flight offer. Creates the escrow for one offer. KEEP customer_support_code from the answer: it cannot be read again, and orders and refunds need it. Next: brij_book_flight. If the user gave you a discount code, send it as promo_code (checked before any payment; fee waived when it applies). - brij_book_flight: Pay and book a flight (pays). Pays the ticket into the intent's escrow with x402 (USDC on Solana). Call it once without payment to get the payment requirements, sign them with your wallet, and call again with the payment in _meta["x402/payment"] or in x402_payment (the base64 PAYMENT-SIGNATURE value). - brij_get_intent: Read an intent. Works for flight, hotel and shopping intents. - brij_get_flight_order: Flight order status. Fetch airline order status. - brij_request_flight_refund: Request a flight refund. Request a manual refund after the intent has been booked. - brij_list_airlines: Supported airlines. Supported airlines (free). Hotels: - brij_find_hotel_places: Find a city for a hotel search. Cities (city_id) and, from 3 characters, hotels by name (accommodation_id) for brij_search_hotels. Optional: brij_search_hotels also takes a city name as location. - brij_search_hotels: Search hotels. Prices are for the whole stay; total_from is all-in (fees included), due_at_hotel_from is paid at the hotel on top. Next: brij_get_hotel_rates with a hotel_id. - brij_get_hotel_rates: Hotel rooms and rates. Next: brij_quote_hotel with the rate_id the guest chose. - brij_quote_hotel: Quote a hotel rate. Show the guest the total, what is due at the hotel and the cancellation terms. Then ask, explicitly and by name (not "contact details"): the full name of each guest as on their ID (lead first, one per room), the lead guest's email address, and their phone number with country code (e.g. +44 7400 123456). Next: brij_create_hotel_intent with offer_id. - brij_create_hotel_intent: Lock a hotel quote. offer_id is the quote's offer_id. KEEP customer_support_code from the answer: orders and cancellation need it. Next: brij_book_hotel. If the user gave you a discount code, send it as promo_code (checked before any payment; fee waived when it applies). - brij_book_hotel: Pay and book a hotel (pays). Needs guests (lead first), email and phone_number in E.164 (+ country code, digits only, e.g. +447400123456): ask the guest for each by name if you do not have it. Pays the stay into the intent's escrow with x402, like brij_book_flight. A wallet that cannot sign x402 may instead send expected_escrow_amount USDC straight to the intent's vault_address (the escrow's own USDC account) and then call… - brij_get_hotel_order: Hotel booking status. Get a hotel booking's status and reference - brij_cancel_hotel: Cancel a hotel booking. Cancels at the hotel immediately and files the refund the cancellation terms allow. Confirm with the guest first: it cannot be undone. Shop (Shopify stores): - brij_shop_search: Search Shop's catalog. Shop's own catalog, millions of Shopify stores. Each variant has an id and a seller (seller.url = the store's domain). Several sellers often carry the same item: keep them as alternatives. Next: brij_shop_quote with shop + variant_id and the recipient's address. - brij_shop_product: Read one Shop product. Every variant (size, colour…) with its id and price. Pick the exact variant the buyer wants before quoting. - brij_shop_store: A Shopify store's page. Give a seller.id from a search: the store's categories with counts, ready-made tabs and its own best sellers. Open a tab with brij_shop_search {seller_ids: [seller.id], categories: [tab.id]}. The first call of the day for a store may answer "still in progress": call again with the same arguments after ~15 s (free); it is then cached a day. - brij_shop_stores: Stores that deliver to a country. One call for a country's store list: every Shopify store BRIJ knows that lists that country among its delivery countries, local stores first, with seller.id, name, city, logo, products_count and shipping_estimate when measured. Page with cursor = next_cursor. Open one with brij_shop_store {seller_id: seller.id, ships_to: country}. A store's zones are not a promise per product: the quote decides. - brij_shop_quote: Quote a Shop purchase. Ask the buyer for the recipient's full name, full address and phone with country code. Opens a real checkout at the store, for one variant or a store cart (items: up to 10 variants of the same shop, one payment, one delivery; one cart per store): total_usdc is all-in (item, shipping, tax, fee). not_agent_ready = that store's checkout cannot be completed for an agent: try the same item at another… - brij_create_shop_intent: Lock a Shop quote. offer_id is the quote's offer_id. KEEP customer_support_code from the answer. Next: brij_shop_buy. - brij_shop_buy: Pay for a Shop order (pays). Pays the escrow with x402, like brij_book_flight (or send expected_escrow_amount USDC to vault_address, then call this). BRIJ then buys at the store with its own card; not bought = refunded in full. Poll brij_get_shop_order until ordered. - brij_get_shop_order: Shop order status. Shop order status Game logs: - brij_create_game_logs_key: Buy your game's logs key (pays). For a game's creator: pay 0.01 USDC from the payout wallet of the game's verified Espresso Connect site (any other payer is refused before being charged). Returns api_key (brij_logs_…), shown once: store it as a secret (e.g. GAME_LOGS_KEY in the game repo's GitHub Actions). A new key replaces the old one. - brij_game_logs: Read your game's play logs. For a game's creator or their CI: game_logs_key is the brij_logs_… key from brij_create_game_logs_key. Read the summary first, then page the events to report where players fail, quit or get stuck, and what to change.