@chrischall/warapp-mcp 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +22 -4
- package/dist/bundle.js +1111 -754
- package/dist/direct/egress.js +75 -0
- package/dist/direct/link.js +9 -5
- package/dist/direct/session.js +60 -6
- package/dist/direct/sign-in.js +308 -0
- package/dist/direct/transport.js +93 -38
- package/dist/hosted.js +6 -4
- package/dist/push/websocket.js +9 -2
- package/dist/tools/chat-read-mark.js +1 -1
- package/dist/tools/healthcheck.js +7 -1
- package/dist/tools/index.js +10 -4
- package/dist/tools/join-game.js +1 -1
- package/dist/tools/live-context.js +2 -0
- package/dist/tools/my-games.js +1 -1
- package/dist/tools/open-games.js +5 -2
- package/dist/tools/session.js +50 -18
- package/dist/tools/sign-in.js +56 -0
- package/dist/tools/team-brief.js +1 -1
- package/dist/tools/team.js +1 -1
- package/dist/tools/write-kit.js +10 -3
- package/dist/version.js +1 -1
- package/docs/examples/warapp-auth-flow.json +31 -0
- package/manifest.json +1 -1
- package/mint.yaml +30 -13
- package/package.json +3 -2
- package/server.json +2 -2
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"metadata": {
|
|
9
9
|
"description": "MCP server for war.app (Warzone) — your games, players, settings, map bonuses and chokepoints, board analysis and route planning through war.app's per-player GameFeed API, plus the live board, territory picks, cards, turn planning and submission, turn notifications and game chat through your signed-in war.app tab (joining, leaving or surrendering a game, accepting another player's surrender, Begin on a speed first turn, picks, turn orders, withdrawing them, chat sends, marking notifications and chat read, deleting notifications and linking a session are confirm-gated).",
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.3.1"
|
|
11
11
|
},
|
|
12
12
|
"plugins": [
|
|
13
13
|
{
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"displayName": "war.app (Warzone)",
|
|
16
16
|
"source": "./",
|
|
17
17
|
"description": "war.app (Warzone) game advisor for Claude — games, maps, bonuses, routes, live board, picks, turns, cards and chat",
|
|
18
|
-
"version": "0.
|
|
18
|
+
"version": "0.3.1",
|
|
19
19
|
"author": {
|
|
20
20
|
"name": "Chris Hall"
|
|
21
21
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "warapp-mcp",
|
|
3
3
|
"displayName": "war.app (Warzone)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"description": "war.app (Warzone) game advisor for Claude — games, maps, bonuses, routes, live board, picks, turns, cards and chat",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Chris Hall",
|
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ game chat.
|
|
|
44
44
|
| `WARAPP_WS_PORT` | no | The fetchproxy bridge port (default `37149`, shared by the whole fetchproxy fleet and ContextMint Bridge). Override it only for local testing, or when a host injects a per-registration port. |
|
|
45
45
|
| `WARAPP_TRANSPORT` | no | How the live-game tools reach war.app: `auto` (default — try the chrome-less direct transport when a session is linked, else the browser bridge), `direct` (only direct), or `fetchproxy` (only the browser bridge, today's behaviour). See [Direct transport](#direct-transport-no-browser). |
|
|
46
46
|
| `WARAPP_SESSION_FILE` | no | Where the linked direct-transport session is stored (default `<data dir>/session.json`). Local-only; a full-account credential, kept at file mode `0600`. Its directory is made `0700`, so name a file in a directory of its own. |
|
|
47
|
+
| `WARAPP_AUTH_TOKEN` | no | **Hosted only, set by mcp-host:** the war.app session cookie its sign-in captured (a full-account credential, held in memory, never stored or shown). Ignored on a local install. See [Direct transport](#direct-transport-no-browser). |
|
|
47
48
|
| `WARAPP_STATS` | no | `1` turns on `warapp_map_stats` on a **local** install (off by default; always off when hosted). It then fetches finished ladder games — at most `max_new_games` a call, one request a second — and caches them under `<data dir>/stats/`. |
|
|
48
49
|
| `WARAPP_PLAYER_PROFILE` | no | Opponent profiling (on by default, locally and hosted; `off` turns it off): what each opponent did on the turns your boards showed, as counts (gameplay only — no name, chat or time of play), kept per game under `<data dir>/profiles/games/` for `warapp_profile_opponents`, and folded when a game finishes into name-free cross-game counts (`profiles/players.json`, keyed by a salted hash shared with the player record; `profiles/population.json`, pooled by format and for AI seats) that fade per game. It also switches off the end-of-game pass (#312): once per finished game you played, its history read once and kept name-free at `<data dir>/finished/<hash>.json` (its boards included, owners by the same salted hash, no clock; at most 500), then folded into the profiles, into a per-map record (`<data dir>/maps-record/<mapId>.json`: outcomes, your start and income curve, the winner's start and pace after turns 4 and 8) and into the lessons (`<data dir>/lessons.json`: how each game was lost, when your income went flat, and the tracked estimates against the true incomes, aggregates only). |
|
|
49
50
|
| `WARAPP_DEBUG` | no | Truthy logs the bridge's role and lifecycle to stderr. |
|
|
@@ -105,9 +106,25 @@ active. `warapp_healthcheck` reports the same.
|
|
|
105
106
|
|
|
106
107
|
> **Security.** The stored session cookie is a **full-account credential** — anything your war.app
|
|
107
108
|
> account can do, it can do. It never leaves this machine (it is sent only to war.app), is never
|
|
108
|
-
> logged, and is never shown in a tool result.
|
|
109
|
-
>
|
|
110
|
-
|
|
109
|
+
> logged, and is never shown in a tool result. Use direct mode only on a machine you control;
|
|
110
|
+
> `rm` the session file (or let it expire) to unlink.
|
|
111
|
+
|
|
112
|
+
**Hosted (mcp-host).** A hosted server never stores a session file and never offers
|
|
113
|
+
`warapp_link_session`. It rides the direct transport only when mcp-host signed it in to war.app:
|
|
114
|
+
the host captures war.app's session cookie into the per-user secret `WARAPP_AUTH_TOKEN` (your
|
|
115
|
+
war.app password is asked once at sign-in and never stored), and the server holds it in memory,
|
|
116
|
+
falling back to the browser bridge if it stops working. `warapp_session_status` then reports
|
|
117
|
+
`linked: true` with `linkedBy: "host"` (no capture time or age), and a signed-out session says to use
|
|
118
|
+
**Sign in** on the connection, or to reconnect it; a paired war.app tab works meanwhile. Without that token the hosted
|
|
119
|
+
server uses the browser bridge, as before. (The war.app sign-in mcp-host runs is
|
|
120
|
+
`docs/examples/warapp-auth-flow.json`, one password page; its capture calls `warapp_sign_in`, a hosted-only tool that
|
|
121
|
+
signs in to war.app once and returns the session cookie to the host. `mint.yaml` declares it as `auth.flow`; a
|
|
122
|
+
registration that does not carry it uses the browser bridge.) **The trade-off:** once a registration carries the
|
|
123
|
+
flow, every new connection needs one successful war.app password sign-in. Any failed sign-in, not only a wrong
|
|
124
|
+
password (a captcha, a war.app outage, a network fault), ends the login with no connection, and may clear the fields
|
|
125
|
+
already entered; an account that signs in through Facebook, with no war.app password, cannot connect. The browser
|
|
126
|
+
bridge stays the fallback only for a connection made before the flow was added and for a session that expires later.
|
|
127
|
+
Locally `WARAPP_AUTH_TOKEN` is ignored.
|
|
111
128
|
|
|
112
129
|
## Tools
|
|
113
130
|
|
|
@@ -154,9 +171,10 @@ active. `warapp_healthcheck` reports the same.
|
|
|
154
171
|
| `warapp_wait_for_turn` | Wait until one of the given games (`game_ids`, 1–20; omitted, every game of yours being played or picked) is waiting on you, woken by war.app's push notifications through your war.app tab; returns at once if one already is, else at `timeout_seconds` (default 300, max 1800). A game whose push said chat arrived carries `chatActivity: true` (no text; unverified live). Also returns `surrender_pending` when another player's surrender waits on your acceptance (each game's `surrenderPending`, from the game details, unverified live; `surrenders` lists those games), unless `ignore_surrenders`; after one failed details read it stops asking for the rest of the wait (`surrenderUnread` says why). Reports progress; honours cancellation. |
|
|
155
172
|
| `warapp_recent_events` | The game-update pushes this server process has received (newest first), and whether the push socket is connected. |
|
|
156
173
|
| `warapp_session_status` | Whether a war.app session is linked for the [direct transport](#direct-transport-no-browser), when it was captured and how old it is, and which transport is active. Never shows the session cookie. |
|
|
174
|
+
| `warapp_sign_in` | **Hosted only, for mcp-host's sign-in flow.** Signs in to war.app once with your email and password and returns the session cookie to the host, which keeps it as this connection's secret. The password is never stored; a refusal is never retried. Not offered on a local install. |
|
|
157
175
|
| `warapp_link_session` | **Writes (locally).** Capture your signed-in war.app session cookie once and store it on this machine for the direct transport. Confirm-gated; stores a full-account credential locally (file mode `0600`) and never shows or sends it anywhere but war.app. |
|
|
158
176
|
|
|
159
|
-
Everything except `warapp_submit_picks`, `warapp_submit_turn`, `warapp_send_chat`, `warapp_join_game`, `warapp_leave_game`, `warapp_surrender`, `warapp_accept_surrender`, `warapp_begin_turn`, `warapp_uncommit_turn`, `warapp_dismiss_notification`, `warapp_delete_notification`, `warapp_mark_chat_read`, `warapp_link_session` and `warapp_record_agreement` (this machine's agreement ledger only, not confirm-gated) only reads. Player, game, map
|
|
177
|
+
Everything except `warapp_submit_picks`, `warapp_submit_turn`, `warapp_send_chat`, `warapp_join_game`, `warapp_leave_game`, `warapp_surrender`, `warapp_accept_surrender`, `warapp_begin_turn`, `warapp_uncommit_turn`, `warapp_dismiss_notification`, `warapp_delete_notification`, `warapp_mark_chat_read`, `warapp_link_session`, `warapp_sign_in` (hosted only: starts a war.app session for the host's sign-in flow, not confirm-gated) and `warapp_record_agreement` (this machine's agreement ledger only, not confirm-gated) only reads. Player, game, map
|
|
160
178
|
and chat text comes back marked as untrusted third-party content.
|
|
161
179
|
|
|
162
180
|
## Confirming writes
|