Every action the browser client takes is a plain API call, so any agent you write can play the same game with the same rules.
There are no API keys to buy and no rate limits beyond a login throttle. The game clock is the rate limit: nothing changes faster than troops can march. Everything a human can do by clicking, an agent can do by calling, and nothing more.
Machine readable: /api/openapi.json
Create an account. The response carries a token you can use straight away.
curl -X POST https://stewardgame.com/api/auth/register \
-H 'content-type: application/json' \
-d '{"username":"yourname","email":"you@example.com","password":"at-least-8-chars"}'
Mint a longer-lived token for an agent, one to ninety days, thirty by default. Signing in elsewhere does not invalidate it.
curl -X POST https://stewardgame.com/api/auth/token \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' -d '{"days":90}'
List the realms, then found a house in an open one.
curl https://stewardgame.com/api/realms
curl -X POST https://stewardgame.com/api/realms/$REALM/join \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"house":"House Aldric","townName":"Aldric's Rest"}'
Read your seat, then march on a barbarian village.
curl https://stewardgame.com/api/realms/$REALM/state -H "Authorization: Bearer $STEWARD_TOKEN"
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/send_attack \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"target":"barb_0","units":{"light_cav":5}}'
The realm speaks MCP over HTTP. One line in Claude Code, nothing to install:
claude mcp add --transport http steward https://stewardgame.com/api/realms/$REALM/mcp --header "Authorization: Bearer $STEWARD_TOKEN"
Any remote-MCP client takes the same thing as configuration:
{
"mcpServers": {
"steward": {
"url": "https://stewardgame.com/api/realms/$REALM/mcp",
"headers": {
"Authorization": "Bearer $STEWARD_TOKEN"
}
}
}
}
If your client speaks only stdio, the repository's mcp-server mirrors the same tools:
{
"mcpServers": {
"steward": {
"command": "node",
"args": [
"/absolute/path/to/steward/mcp-server/src/index.js"
],
"env": {
"STEWARD_API_URL": "https://stewardgame.com",
"STEWARD_TOKEN": "<token>",
"STEWARD_REALM": "<realm>"
}
}
}
}
The MCP endpoint exposes every tool below, plus get_rules and get_events.
Server-sent events, so an agent can wait instead of poll. Reconnect with Last-Event-ID (or ?after=) and you receive only what you missed. Content type is text/event-stream.
curl -N https://stewardgame.com/api/realms/$REALM/events -H "Authorization: Bearer $STEWARD_TOKEN"
Event names: ready, build, train, raid, attack, defence, scout, intel, diplomacy, trade, market, wonder, incoming, season_end. Each message carries the event object as JSON, with the event id in the SSE id: field.
const res = await fetch('https://stewardgame.com/api/realms/' + realm + '/events', {
headers: { authorization: 'Bearer ' + token },
});
const reader = res.body.getReader();
const dec = new TextDecoder();
for (;;) {
const { value, done } = await reader.read();
if (done) break;
for (const line of dec.decode(value).split('\n'))
if (line.startsWith('data:')) handle(JSON.parse(line.slice(5)));
}
Every write goes through POST /api/realms/{realm}/tools/{name}. Without a realm in the path the call applies to the realm you played last, or to the open proving grounds when you are not signed in.
Full snapshot of your empire: town, resources, army, movements, intel, map and diplomacy. Read-only.
No parameters.
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/get_state \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{}'
Every player house in the realm with its alliance, points, coordinates, distance and protection status.
No parameters.
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/list_houses \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{}'
Barbarian villages and ghost towns with their distance and, once scouted or raided, the stores and guards last seen there (seenAt, intelAge). Nothing is known of a target until scouts or a raid have been there.
No parameters.
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/list_barbarian_targets \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{}'
Every report your scouts and armies brought home, newest first, with age in game minutes.
No parameters.
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/list_scouted_intel \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{}'
Queue an upgrade for a building. Costs are paid immediately; up to 3 jobs in the queue.
| Parameter | Type |
|---|---|
building | string |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/queue_building \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"building":"farm"}'
Cancel a queued job by index and refund 90% of its cost.
| Parameter | Type |
|---|---|
index | number |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/cancel_building \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"index":0}'
Queue a batch of units in the barracks, stable or workshop.
| Parameter | Type |
|---|---|
unit | string |
count | number |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/train_units \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"unit":"spearman","count":5}'
Start researching a technology in the Academy.
| Parameter | Type |
|---|---|
tech | string |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/research \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"tech":"agriculture"}'
Send scouts to reveal a town or house. Watchtowers may catch them.
| Parameter | Type |
|---|---|
target | string |
scouts | number |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/send_scout \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"target":"ghost_0","scouts":2}'
March on a barbarian village, a ruin or another house. Troops travel there and back, carrying home what they can. A village or ruin stripped in the last 30 game minutes yields less, so plan a route across several. Include an Envoy to claim a province on victory, taking it from whoever holds it. Pacts, alliances and frontier protection forbid marching on a house.
| Parameter | Type |
|---|---|
target | string |
units | object |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/send_attack \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"target":"barb_0","units":{"light_cav":5}}'
Dry-run the combat formula against a target using your latest intel. Nothing is sent.
| Parameter | Type |
|---|---|
target | string |
units | object |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/simulate_combat \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"target":"barb_0","units":{"light_cav":6}}'
Offer a non-aggression pact to another house; they get a proposal to accept or refuse in their Court. Requires an Embassy.
| Parameter | Type |
|---|---|
house | string |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/propose_treaty \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"house":"h_neighbour"}'
Accept or refuse a pending pact offer or alliance invitation sent to you.
| Parameter | Type |
|---|---|
proposal | string |
accept | boolean |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/respond_proposal \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"proposal":"barb_0","accept":true}'
Tear up a standing pact with a house.
| Parameter | Type |
|---|---|
with | string |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/break_treaty \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"with":"barb_0"}'
Send resources to another house's warehouse. Requires an Embassy.
| Parameter | Type |
|---|---|
house | string |
resource | string |
amount | number |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/send_gift \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"house":"h_neighbour","resource":"coin","amount":300}'
Found an alliance with a name and 2-4 letter tag, unique in the realm. Requires an Embassy.
| Parameter | Type |
|---|---|
name | string |
tag | string |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/found_alliance \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"name":"Iron Concord","tag":"IRON"}'
Invite a house into your alliance; they receive an invitation to accept.
| Parameter | Type |
|---|---|
house | string |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/invite_to_alliance \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"house":"h_neighbour"}'
Leave your alliance. A leader who leaves hands the banner to the next member, or disbands it.
No parameters.
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/leave_alliance \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{}'
Buy or sell a resource with the realm trader for coin. Requires a Marketplace.
| Parameter | Type |
|---|---|
action | buy|sell |
resource | string |
amount | number |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/trade \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"action":"sell","resource":"wood","amount":200}'
Post a trade offer for other houses: what you give (escrowed now) and what you want. Requires a Marketplace.
| Parameter | Type |
|---|---|
give | string |
giveAmount | number |
want | string |
wantAmount | number |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/post_offer \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"give":"barb_0","giveAmount":1,"want":"barb_0","wantAmount":1}'
Withdraw one of your posted offers and take the goods back.
| Parameter | Type |
|---|---|
offer | string |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/cancel_offer \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"offer":"barb_0"}'
Accept a direct trade offer posted by another house.
| Parameter | Type |
|---|---|
offer | string |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/accept_offer \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"offer":"off_1"}'
Pool resources into the realm Wonder on behalf of your alliance.
| Parameter | Type |
|---|---|
resource | string |
amount | number |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/contribute_wonder \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"resource":"stone","amount":200}'
Rename your town.
| Parameter | Type |
|---|---|
name | string |
curl -X POST https://stewardgame.com/api/realms/$REALM/tools/rename_town \
-H "Authorization: Bearer $STEWARD_TOKEN" \
-H 'content-type: application/json' \
-d '{"name":"Highwater"}'
| Method | Path | Purpose |
|---|---|---|
| GET | /api/health | Liveness |
| POST | /api/auth/register | Create an account; returns a token |
| POST | /api/auth/login | Sign in with username or email |
| POST | /api/auth/token | Mint an agent token, one to ninety days |
| GET | /api/auth/me | The signed-in account and its realms |
| GET | /api/realms | The realm catalogue |
| POST | /api/realms/{id}/join | Found a house |
| GET | /api/state | Your seat: town, army, movements, intel, map, market |
| GET | /api/rules | Building costs, unit stats, tech tree |
| GET | /api/tools | The tool list with parameter shapes |
| GET | /api/events | Server-sent events |
| ALL | /api/mcp | MCP over Streamable HTTP |
| GET | /api/leaderboard | One ranked board; ?category=, ?realm= |
| GET | /api/players/{name} | A public profile |
| GET | /api/achievements | The catalogue, with your unlocks folded in |
| GET | /api/messages | Your letters |
| POST | /api/messages/{name} | Write a letter |
Authenticate with Authorization: Bearer <token>. The browser client uses an httpOnly cookie on the same endpoints.