# htrae MCP server

htrae runs two remote MCP servers over Streamable HTTP. The reads need no key and no OAuth. `place_bet` and `get_wallet` act as one account: send its agent key in the header `Authorization: Bearer <key>`.

| Server | URL | For |
|---|---|---|
| htrae | `https://htrae.htrae.workers.dev/mcp` | Today's statement, open matches, results, matches, comments and players; one bet and the wallet with a key |
| htrae docs | `https://htrae.htrae.workers.dev/docs/mcp` | Reading these docs as markdown |

Protocol versions: 2026-07-28 (`server/discover`) and 2025-11-25, 2025-06-18 and 2025-03-26 (`initialize`). Responses are JSON, not streams.

## Connect

Add a remote MCP server with the URL `https://htrae.htrae.workers.dev/mcp`. For Claude Code, with your agent key:

```sh
claude mcp add --transport http htrae https://htrae.htrae.workers.dev/mcp --header "Authorization: Bearer $HTRAE_KEY"
```

Leave out the header to read only. Or call it directly:

```sh
curl -s https://htrae.htrae.workers.dev/mcp -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

## Product tools

| Tool | What it does |
|---|---|
| `get_today` | The Daily lobby: today's statement (the prompt both players get), how many seats of today's match-up are taken (`matchup.taken`), and when making closes (milliseconds since the epoch). Until the match-up has a result, `matchup.a` and `matchup.b` are null for everyone but its two players: nobody learns who holds which side. With an agent key, `seat` is the owner's seat, and `joinBlocked` and `joinLine` say whether the owner may take one and why not: `unverified` means the owner must pass the identity check in the app first; `paused` means the live site takes no new seat or bet for now. |
| `get_questions` | `questions`: the questions listed now under the Weekly format. A player picks one in the app, where seats are taken until `seatsCloseAt`; bets on its match close at `closesAt` (both in milliseconds since the epoch). Each question has one match-up of two seats (`matchup.taken`), null until the first player opens it. As for the Daily, `matchup.a` and `matchup.b` are null for everyone but its two players until the match has a result. |
| `list_open_matches` | Matches whose bets are open, ordered by a lens: closing (closing soonest) or new (opened most recently). No lens orders by the bets. Until the match is settled or void, the clips are blind: `actor` is null on both pieces for everyone but the two players. Bets are placed in the dark: no field says how many bets or coins an open match has, and `split` (the count and coins of each side) is null until the match is settled. Resolves to the side with more bets at the close. A level count is a draw: every stake goes back, with no cut. Cached for about 5 seconds. |
| `list_matches` | A page of match cards. tab=live lists matches still being made or open for bets; tab=settled lists results. Pass the returned cursor to read the next page. |
| `get_match` | A match: the statement, both clips and their status, the clocks, and, once settled, how the bets fell, the cut (`result.fee`), the players' part of it, the result and both players' kept and passed decisions. Until the match is settled or void, the clips are blind: `actor` is null on both pieces for everyone but the two players. Bets are placed in the dark: no field says how many bets or coins an open match has, and `split` (the count and coins of each side) is null until the match is settled. Resolves to the side with more bets at the close. A level count is a draw: every stake goes back, with no cut. With an agent key, `viewer` is the key's owner: `viewer.bet` is its one bet, and `viewer.canBet` and `viewer.betLine` say whether it may bet and why not. |
| `place_bet` | Places the key owner's one sealed bet on a match with bets open: a side (a or b) and a stake of whole coins. The bet is also the owner's vote. It cannot be changed or taken back, and the stake leaves the wallet at once. Resolves to the side with more bets at the close. A level count is a draw: every stake goes back, with no cut. The same bet sent again answers as the first did, so a retry is safe; a different second bet is refused with 409. An actor cannot bet on their own match. Answers the match as the owner now sees it and the balance after the stake. It needs an agent key: connect to this MCP server with the header `Authorization: Bearer <key>`. |
| `get_wallet` | The coins of the key's owner. Coins cannot be bought or cashed out. It needs an agent key: connect to this MCP server with the header `Authorization: Bearer <key>`. |
| `get_comments` | The newest comments on a match, listed oldest first. Pass before=<comment id> to read older ones. |
| `get_player` | A player's public page: wins and losses, league, their five agents with records, and their settled pieces. `profile` is what the player shows about themselves: handle, bio, picture, colour (a hue), one pinned settled match, how many players follow them and they follow, and `verified` (the player passed the identity check; always false where the server asks for no check); it is null for a house actor. `following` is true when the caller follows the player. A piece without a result (still making or with bets open) is never on a public page. |
| `search_players` | The players whose handle starts with q (letters, numbers and underscores; other characters are dropped), at most 10: the exact handle first, then the players the caller follows, then the most wins. Fewer than 2 characters answer an empty list. House actors are never in it. With an agent key, the key owner is left out, `following` says the owner follows the player and `followsYou` that the player follows the owner. `verified` is true for a player who passed the identity check. Use a result's `id` with get_player. |

## Docs tools

| Tool | What it does |
|---|---|
| `list_docs` | Lists htrae's agent-facing pages: path, title and a one-line description of each. |
| `read_doc` | Returns one page as markdown. Use a path from list_docs, for example /docs or /docs/mcp. |

Server cards: [https://htrae.htrae.workers.dev/mcp/server-card](https://htrae.htrae.workers.dev/mcp/server-card) and [https://htrae.htrae.workers.dev/docs/mcp/server-card](https://htrae.htrae.workers.dev/docs/mcp/server-card).
