One URL for your agent.
It books and buys, paid in USDC.
Your AI agent books flights and hotels and buys from Shopify stores for its user, paid in USDC on Solana. The money waits in an on-chain escrow and is released only when the supplier confirms; anything else is refunded automatically.
https://mcp.espressocash.com/mcpConnect
Streamable HTTP with plain JSON answers (no SSE stream, no session). Any MCP client that takes a URL works.
| Client | How |
|---|---|
| Claude (claude.ai, desktop) | Settings โ Connectors โ Add custom connector โ paste the URL. |
| Claude Code | claude mcp add --transport http espresso https://mcp.espressocash.com/mcp |
| Codex CLI | In ~/.codex/config.toml: [mcp_servers.espresso] with url = "https://mcp.espressocash.com/mcp" |
| Cursor, Windsurf, others | {"mcpServers": {"espresso": {"url": "https://mcp.espressocash.com/mcp"}}} in their mcp.json |
| ChatGPT | Turn on developer mode in the connector settings, then add a connector with the URL. |
Check it answers:
curl -s https://mcp.espressocash.com/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
What your agent needs
- To search and quote: nothing. Just the URL.
- To buy: the buyer's Solana wallet address (it funds the escrow and gets refunds) and a way to sign an x402 payment in USDC from it: a wallet tool your agent can call, or a client that signs x402 payments. The agent never holds the money: it goes from the wallet straight into the purchase's escrow.
- The traveller's or recipient's details (names, birth date for flights, email, phone, delivery address). Ask for them; never invent them.
Quickstart: book a flight
Every purchase follows the same five steps. Pass every id
(offer_id, intent_id) back exactly as you
received it.
- search
- quote
- intent
- pay
- order
// 1. search (free). If status is "enriching", poll brij_get_flight_search_updates
brij_search_flights {"origin_iata": "LIS", "destination_iata": "JFK",
"depart_date": "2027-01-15", "adults": 1}
// โ offers[]: offer_id, total_amount (all-in, USD), slices, airline
// 2. lock one offer: creates its escrow
brij_create_flight_intent {"offer_id": "<offer_id>", "funding_wallet": "<buyer wallet>"}
// โ intent_id, expected_escrow_amount, customer_support_code (keep it!)
// 3. pay: the first call answers with the x402 payment requirements
brij_book_flight {"intent_id": "<intent_id>", "passengers": [{
"given_name": "Ana", "family_name": "Silva", "born_on": "1990-04-02",
"title": "ms", "gender": "f", "email": "[email protected]",
"phone_number": "+351912345678"}]}
// โ error with structuredContent = payment requirements. Sign them with the
// funding wallet, then call again with _meta["x402/payment"] (or x402_payment).
// 4. follow it (free)
brij_get_intent {"intent_id": "<intent_id>"}
// โ status โฆ booked; booking_reference = the PNR. Relay it to the traveller.
Flows
Flights
brij_search_flights โ (brij_get_flight_search_updates while status is enriching) โ (brij_get_flight_offer_details) โ brij_create_flight_intent โ brij_book_flight โ brij_get_intent
- Wait for the search to finish before choosing: slower sellers often add nonstops and cheaper fares.
brij_get_flight_offer_detailsgives the live price, bag prices and every fare of that flight, each with its ownoffer_id.- Passengers: exactly as many as the adults searched, lead first. The lead receives the emails.
- The PNR appears on
brij_get_intentasbooking_referenceonce the ticket is issued (usually minutes) and is emailed too. - An offer lives ~20โ30 min, an intent ~20 min: search again if it expires.
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
brij_search_hotels {"location": "Lisbon", "check_in_date": "2027-01-15",
"check_out_date": "2027-01-18", "adults": 2}
brij_get_hotel_rates {"hotel_id": "<hotel_id>"}
brij_quote_hotel {"rate_id": "<rate_id>"} // โ offer_id "hotel:โฆ"
brij_create_hotel_intent {"offer_id": "hotel:โฆ", "funding_wallet": "<buyer wallet>"}
brij_book_hotel {"intent_id": "โฆ", "guests": [{"given_name": "Ana", "family_name": "Silva"}],
"email": "[email protected]", "phone_number": "+351912345678"}
- Show the guest the total, what is due at the hotel (city tax) and the cancellation terms from the quote before locking it.
brij_cancel_hotelcancels and refunds what the cancellation terms allow at that moment.
Shop (Shopify stores)
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
brij_shop_search {"query": "trail running shoes", "ships_to": "PT"}
brij_shop_quote {"variant_id": "<variant id>", "quantity": 1, "ship_to": {
"first_name": "Ana", "last_name": "Silva", "street_address": "Rua Augusta 10",
"city": "Lisboa", "postal_code": "1100-053", "country": "PT",
"phone": "+351912345678"}} // โ offer_id "shopcom:โฆ", total
brij_create_shop_intent {"offer_id": "shopcom:โฆ", "funding_wallet": "<buyer wallet>"}
brij_shop_buy {"intent_id": "โฆ", "email": "[email protected]"}
- Search prices are all-in USDC per item; the quote opens a real checkout at the store and adds shipping and tax.
- Up to 10 items of one store in one quote (
items). For several stores, one quote per store. - The store is paid by card on the buyer's behalf; if it cannot be
paid, the escrow refunds in full. With
emailon the buy, the buyer gets the store's own confirmation email. brij_shop_storeslists stores that deliver to a country, home-country stores first.
Game play logs: a daily self-improvement loop
For a web game's creator and the coding agent that maintains it (Claude
Code or Codex in a GitHub Action, every day). Players' browsers send small
events; the agent reads them with brij_game_logs, finds where
players fail, quit or get stuck, and changes the game.
- Register the game's site on Espresso Connect. Its
host must be a verified site:
connect.espressocash.com/developers,
domain proven, status ACTIVE (lookup docs).
The site's payout wallet is the creator. Check it:
On GitHub Pages, registercurl 'https://api.espressocash.com/connect/v2/sites/lookup?origin=https://tennis.example.com' # โ 200 with "verified": true and your payout_wallethttps://<you>.github.io: the proof file goes in your<you>.github.iorepo (add an empty.nojekyll), and that one site covers all your games. - Add the script to the game's page, before the game's
own code:
<script src="https://mcp.espressocash.com/games/brij-log.js"></script> - Log what matters, at the moments that tell a story:
Nothing is sent until the game callsbrij.log("match_start", { level: 2, difficulty: "hard" }); brij.log("point", { won: false, shot: "lob", rally: 7, ms: 840 }); brij.log("quit", { screen: "settings", after_s: 95 });brij.log()once, so a game that asks its players first ("Share my playtest") sends nothing before they agree. After that the script also recordssession_start(screen size, language),hiddenandsession_endon its own, and sends a batch every 10 s and when the tab closes. - Buy the logs key, once. From the payout wallet:
brij_create_game_logs_key {"game": "tennis.example.com"}(x402, 0.01 USDC; the payment proves the wallet, any other payer is refused before being charged). It answers{"api_key": "brij_logs_โฆ", "host": "tennis.example.com", "espresso_site_id": "site_โฆ"}. The key is shown once, reads every game on that host, and buying a new one replaces it. Store it as a repository secret,GAME_LOGS_KEY. - Read them every day.
brij_game_logs {"game": "tennis.example.com", "game_logs_key": "โฆ"}gives a summary by event type, then the events page by page (cursor,since,exclude_playersto drop your own test runs: your player id isbrij.playerin the browser console). Or over HTTP:curl -s https://mcp.espressocash.com/games/logs/read \ -H "X-Game-Logs-Key: $GAME_LOGS_KEY" -H 'Content-Type: application/json' \ -d '{"game": "tennis.example.com", "since": "2026-11-26"}'
A GitHub Action for it, run each morning:
on:
schedule: [{ cron: "0 6 * * *" }]
jobs:
improve:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
curl -s https://mcp.espressocash.com/games/logs/read \
-H "X-Game-Logs-Key: ${{ secrets.GAME_LOGS_KEY }}" \
-H 'Content-Type: application/json' \
-d '{"game": "tennis.example.com"}' > playtest.json
# then your coding agent: read playtest.json, find where players
# struggle, change the game, open a pull request.
| Rule | |
|---|---|
| Game id | The page's host + folder: tennis.example.com, you.github.io/tennis. Override with data-game on the script tag. |
| Event type | 1โ40 characters of A-Z a-z 0-9 _ . : - |
| Event data | An object, at most 2 KB, strings โค 200 characters, keys โค 40, 3 levels deep |
| Players | An anonymous id per browser. Log no names, emails or anything personal. |
| Limits | 200 events per batch, 20,000 events and 5 MB per game per day, kept 90 days. Only the game's own page can send (its Origin is checked). |
For Espresso Connect: logs keys in the developer console
How the Espresso Connect developer console can offer "Game logs" on a site, with no new API on either side:
- On an ACTIVE, verified site, the console shows a Game logs
button. It calls
POST https://mcp.espressocash.com/games/keys {"game": "<the site's origin>"}and gets an x402402challenge: 0.01 USDC to BRIJ's fee wallet. - The console has the site owner approve that payment from the site's
payout wallet (passkey, in the app), then sends the same
request again with the signed payment in the
PAYMENT-SIGNATUREheader. - We check that the payer is the payout wallet your public lookup
returns for that origin (
verified: true, ACTIVE) before settling. Any other payer:403 not_game_owner, nothing charged. - The answer is
{"api_key": "brij_logs_โฆ", "host", "espresso_site_id", "espresso_site_name", "wallet"}. The console shows the key once ("copy it into your GitHub secrets asGAME_LOGS_KEY") or keeps it for the site's own tools. We store only its hash. - Rotating = calling it again: the new key replaces the old one. If
the site's payout wallet changes, old keys stop reading
(
not_game_owner) until the new wallet buys one.
Errors the console should show: game_not_registered (404,
the origin is not a verified site), not_game_owner (403, wrong
wallet), invalid_game (400).
Payment and refunds
- Intent.
brij_create_*_intenttakes the buyer'sfunding_wallet(and optionally arefund_wallet) and returns the escrow address, the amount and acustomer_support_code. Keep the code: it is never shown again, and orders and refunds need it. - Pay. The book/buy tool answers with x402 payment
requirements for that escrow (as the tool error's
structuredContent). Sign them with the funding wallet and call the same tool again with the payment in_meta["x402/payment"], or in thex402_paymentargument (the base64 PAYMENT-SIGNATURE value) if your client cannot set_meta. The settlement comes back in_meta["x402/payment-response"]. - Outcome. Confirmed โ captured. Anything else โ refunded in full to the refund wallet, which was fixed when the intent was created and cannot be changed.
Quote the buyer the escrow amount: it is all-in (fare or stay or items + the service fee). Flights: 10 USDC + 2 %, at most 15 % of the fare. Hotels: 5 USDC + 2 %, at most 30. Shop: 2 USDC + 3 %.
A promo code the user gives you goes in promo_code on the
intent. It is checked before anything is paid and waives the service fee
when it applies.
Manual refund requests (brij_request_flight_refund) need
the support code and the lead passenger's family name. They are reviewed by
a person; the money can only go back to the refund wallet.
Limits and errors
Instead of a fee per call, calls are rate-limited per client and globally, by cost:
| Kind of call | Per client |
|---|---|
| Reads, polls, order status | 120 at once, 1 back a second |
| Flight search and offer details | 10, 1 back every 3 min |
| Hotel search, rates, quote | 40, 1 back every 10 s |
| Shop search, product, quote | 20, 1 back every 30 s |
| Creating an intent | 2, 1 back every 30 min |
| Refund requests | 3 an hour |
The same call repeated within 15 minutes is free, so a pending search or quote can be polled. Paying (book/buy) is never rate-limited.
isError
and a code: mcp_rate_limited or
mcp_capacity_exhausted (429, with
retry_after_seconds), intent_already_exists (409,
with the existing intent_id), offer_not_found,
promo_invalidโฆ Nothing is ever charged for a refused call.All tools
Generated from the server's own tools/list, so this list is
always the live one. Each tool's full input schema is in
tools/list.
Flights
brij_search_flights | Search flights |
brij_get_flight_search_updates | Poll a flight search |
brij_get_flight_offer_details | Flight offer details |
brij_create_flight_intent | Lock a flight offer |
brij_book_flight | Pay and book a flight (pays) |
brij_get_intent | Read an intent |
brij_get_flight_order | Flight order status |
brij_request_flight_refund | Request a flight refund |
brij_list_airlines | Supported airlines |
Hotels
brij_find_hotel_places | Find a city for a hotel search |
brij_search_hotels | Search hotels |
brij_get_hotel_rates | Hotel rooms and rates |
brij_quote_hotel | Quote a hotel rate |
brij_create_hotel_intent | Lock a hotel quote |
brij_book_hotel | Pay and book a hotel (pays) |
brij_get_hotel_order | Hotel booking status |
brij_cancel_hotel | Cancel a hotel booking |
Shop (Shopify stores)
brij_shop_search | Search Shop's catalog |
brij_shop_product | Read one Shop product |
brij_shop_store | A Shopify store's page |
brij_shop_stores | Stores that deliver to a country |
brij_shop_quote | Quote a Shop purchase |
brij_create_shop_intent | Lock a Shop quote |
brij_shop_buy | Pay for a Shop order (pays) |
brij_get_shop_order | Shop order status |
Game logs
brij_create_game_logs_key | Buy your game's logs key (pays) |
brij_game_logs | Read your game's play logs |
FAQ
When is the buyer charged?
The USDC leaves the wallet into the purchase's own escrow when the agent pays. It leaves the escrow only when the supplier confirms (ticket issued, hotel booked, store order placed). Every other outcome refunds it in full, to the refund wallet.
What if the price changes after the quote?
The purchase is never made above what was paid into the escrow: it fails cleanly and refunds. Search or quote again.
Can it book for several people?
Flights: search with adults and send that many passengers,
lead first. Hotels: rooms, adults and child ages on the search, at least one
guest per room on the booking.
The agent lost the customer_support_code.
It cannot be read again. Keep it when the intent is created: order status and refund requests need it.
Is it the same as the HTTP API?
Yes: every tool is one route of the API, with the same checks. Over HTTP each call costs a small x402 fee; over MCP only the purchase is paid.
Partners and affiliates
Partner key. An app relaying many users' agents from
one server can get a key, sent as
Authorization: Bearer brij_mcp_โฆ. It gives each of its agents
5ร the rate limits (keyed by an X-BRIJ-Agent header) and its
own global pool. Ask us for one.
Affiliates. Pass referrer (your code) on
a flight intent and earn 20 % of the service fee on bookings that are
flown without refund. Get a code with POST
https://mcp.espressocash.com/affiliates {"wallet": โฆ} (free).

MCP
Quickstart
Tools
Connect docs