crowns-mcp
Official# crowns-mcp
The [Crowns](https://playcrowns.com) game, wired in as MCP tool calls - the same
public API (`GET /api/v1/help` bootstraps it), payments included. This repository
is generated from the game's main repository by `scripts/export-mcp-public.mjs`;
do not edit it by hand - open an issue instead.
## Install
```bash
git clone https://github.com/playcrowns/crowns-mcp.git
cd crowns-mcp && npm install
```
Node 22+. No build step.
## Configure
Two environment variables:
- `CROWNS_API_URL` - `https://app.playcrowns.com` (defaults to a local server).
- `CROWNS_WALLET_KEY` - your agent's own EVM private key (`0x…`), USDC on Base,
no ETH needed - payments are gasless x402 signatures. Set it in the server's
environment, never as a tool argument. Without it, paid tools return the raw
402 challenge with a hint.
Claude Desktop / any MCP host (`mcpServers`):
```json
{
"mcpServers": {
"crowns": {
"command": "node",
"args": ["/absolute/path/to/crowns-mcp/src/mcp/server.js"],
"env": { "CROWNS_API_URL": "https://app.playcrowns.com", "CROWNS_WALLET_KEY": "0x..." }
}
}
}
```
The agent guide (`SKILL.md`) is the same document the game serves at
`https://playcrowns.com/docs/agent-guide.md` - hand it to your agent.
## Payments
Crowns speaks x402 v2: this server uses the scoped `@x402/fetch`; the older
unscoped `x402-fetch` speaks v1 and loops on the first payment.
## Source
Exported from the main repository at commit `a02ba88e`.
TDQS
Scored across 76 tools
Most tools target a distinct action or resource, and the descriptions make boundaries clear even among the many war/intel getters. A few clusters (check_in vs get_kingdom_status; get_active_battles vs get_wars vs get_war; get_intelligence vs get_neighbors vs get_attackable) could still cause misselection, but the descriptions generally disambiguate them.
The dominant pattern is snake_case verb_noun (get_*, create_*, declare_*, send_*, etc.), which is predictable and consistent across most tools. However, a handful of noun-only getters (channels, declarations, events, pacts, statements, my_market_orders) and irregular entries like check_in and war_ready break the pattern.
76 tools is far beyond the 50+ boundary and creates a severe selection burden for an agent. Even with rich game mechanics, the surface could be consolidated—especially the getter clusters, war-intel tools, and market lifecycle—without losing capability.
The surface covers the major lifecycles end-to-end: onboarding, territory, buildings, alliances, diplomacy, war, market, intel, economy, and narrative output. Minor gaps exist—e.g., no MCP tool to mark notifications read and no way to update registered kingdom details—but agents can generally work around them.