@battlegrid/mcp-server 30.0.0 → 31.0.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/README.md CHANGED
@@ -7,68 +7,39 @@ MCP server for [BattleGrid](https://battlegrid.trade) — play crypto prediction
7
7
 
8
8
  It is a thin, authenticated **stdio proxy** to BattleGrid's remote MCP server (Stripe `@stripe/mcp` pattern — no business logic). It discovers tools, prompts, and resources live from the server and re-exposes them to local MCP clients (Claude Desktop, Claude Code, Cursor). Capabilities are always **discovered live** — this package never hardcodes the tool catalog.
9
9
 
10
- ## v30 — breaking cutover (v12 → v30)
10
+ ## v31 — the announced contract is read from the server, not declared here
11
11
 
12
- **v30 pairs with the BattleGrid server's MCP contract v30.x — currently v30.0.0.** The package version tracks the server's wire contract, because the proxy announces `battlegrid@<package version>` in its own stdio handshake — the number a client reads has to be the contract it will actually reach.
12
+ **The package version no longer tracks the server's contract, and no longer claims to.** Through v30 it did: the proxy announced `battlegrid@<package version>` downstream, so the published number was read as the contract a client would reach, and keeping the two in step was a manual release chore. It did not hold — the package sat at `11.0.0` against a deployed contract of `19.3.0` for ten days, `5.1.0` was declared here and never published at all, and four of the last five releases were version bumps carrying no code change.
13
13
 
14
- This release absorbs **eighteen** breaking contract majors at once. The published package went from `11.0.0` straight to `30.0.0`, so no `12.x` through `29.x` client exists to upgrade from — the breaks are grouped by **what you will observe**, with the contract version that introduced each.
14
+ From v31 the proxy reads the contract version out of the upstream handshake at connect time and relays it verbatim. What a local client reads is therefore what the connected server just announced — correct by construction, on every connection, with no release involved.
15
15
 
16
- **Why the gap happened, recorded so it does not repeat.** The pairing rule was documented and the publish gate enforced it, but nothing *noticed* when the server's contract advanced: `scripts/assert-deployed-contract.mjs` only runs when a publish is attempted, and none was between 2026-08-07 and this release. A stop sign cannot ring a doorbell. `.github/workflows/contract-drift.yml` now polls the deployed contract line daily and opens a bump PR when it diverges.
16
+ **Two versions, two meanings, and they are expected to differ:**
17
17
 
18
- **The proxy itself is unchanged.** It embeds no schemas, pins no contract version, and forwards `{ request }` verbatim. Every break below lands on whatever *authors* the payload or *reads* the result, never on the proxy.
19
-
20
- ### Changed meaning, unchanged shape — the one to read first
21
-
22
- - **Position-size presets are now a RISK BUDGET** (30.0.0, `split-stop-geometry-from-risk`). `smallPct` / `mediumPct` / `largePct` stop denoting a share of the ORDER (`notional = pct / 100 × headroom × leverage`) and start denoting the share of headroom placed **at risk** (`notional = headroom × riskPct / stopDistancePct`, capped at the margin headroom can post). Same keys, same types, same accepted range: **nothing in the payload tells you the meaning moved.** A client still sending `22.0` for MEDIUM is asking to risk 22% of its budget on one trade rather than roughly 2%. Typical risk budgets are `0.5`–`3`; the platform defaults moved to `1 / 2 / 3`. Leverage stops multiplying order size and becomes a constraint only.
23
-
24
- ### Rejected input — something you author is no longer accepted
25
-
26
- - **The stop-loss ceiling changed unit** (30.0.0). `maxStopLossPct` (a percent of entry) becomes `maxStopLossAtrMultiple` (a multiple of ATR), and the accepted range narrows from `(0, 100]` to `(0, 3]`. It is a rename **and** a re-denomination — mapping the old value onto the new key sends a number one to two orders of magnitude too large. The objects are `.strict()`, so a 29.x client sending `maxStopLossPct` is rejected with an unknown-key error. A new cross-field rule comes with it: `minStopLossAtrMultiple < maxStopLossAtrMultiple` is now a real comparison and is enforced.
27
- - **The grid-confidence and trade-conviction bars left the agent** (28.0.0, `remove-agent-rule-defaults`). `tradingConfig.gridMinConfidence` and `minTradeConviction` are removed from the shared `.strict()` config; a bar is declared on the arena slot or radar slot that fires.
28
- - **Both entry-lifecycle guards left the agent** (26.0.0, `move-entry-guards-to-platform`). `tradingConfig.signalTimeoutMinutes` and `maxEntryDeviationAtrMultiple` are removed with no replacement key — both are platform values now.
29
- - **The arena stopped granting trade authority** (25.0.0, `remove-arena-trade-permissions`). `upsert_deployment_policy` and `preview_deployment_resolution` stop accepting `tradingEnabled`, `minConviction` and `coinRules[]` on a slot.
30
- - **Post-entry exit policy moved to the strategy** (24.0.0, `move-position-management-to-strategy`). The nested `positionManagement` object is removed from the agent config; the twelve dials are authored on the strategy.
31
- - **The agent-level trading mode is retired** (23.0.0, `remove-agent-trading-mode`). `tradingConfig.tradingMode` is removed — trading on/off is scoped per deployment.
32
- - **Trailing gained a required threshold** (22.0.0, `add-trailing-trigger-r`). `positionManagement` gains `trailingTriggerR` as REQUIRED (`0`–`2.0`, `0.01` precision, `0` = trail from entry); the object is `.strict()` all-required, so sending `positionManagement` without it is rejected.
33
- - **The strategy regime timeframe became derived** (19.0.0, `remove-strategy-regime-override`). It stops being an authored axis anywhere on the contract and is served read-only.
34
- - **Conditions gained a required `required`** (16.0.0, `add-condition-enforcement-gate`). A condition entry omitting the boolean is REJECTED rather than defaulted.
35
- - **The trade-level policy moved to the strategy** (15.0.0, `move-trade-level-policy-to-strategy`). It leaves the agent authoring surface and joins the setup gates on the strategy.
36
- - **The agent's ATR timeframe axis is gone** (14.0.0, `remove-agent-atr-timeframe-axis`). ATR is sampled on the strategy timeframe, always.
37
- - **Radar's wall-clock condition changed shape** (12.0.0, `unify-deployment-hours-as-sets`).
38
-
39
- ### Moved or reshaped output — a field you read is somewhere else
40
-
41
- - **`get_radar_activity` gained an `EDGE_REARM` variant** (29.0.0, `add-radar-anchor-rearm`), and every member gained five `rearm*` margin keys plus a `rearmReasons` discriminator. Breaking on both counts if you parse the union strictly.
42
- - **The trade-defaults catalog dropped four seeds** (27.0.0, `retire-orphaned-trade-config-columns`) for fields no surface can author. Read the stop-loss band, ATR floor and risk-reward minimum from the bound STRATEGY.
43
- - **`get_radar_activity` gained `blockReasonCode` on every member** (21.0.0, `fix-block-reason-attribution`) — non-null only on `BLOCKED_BEFORE_EVALUATION` rows written after 2026-08-17.
44
- - **`signal_pipeline`'s decision became a discriminated union** (20.0.0, `add-decision-skip-attribution`). `ENTER`/`GATED` carry the seven level fields as REQUIRED; `SKIP` omits them entirely rather than sending nulls, so reading `entryPrice` without narrowing the verdict finds the key absent.
45
- - **`get_radar_activity` gained an `EVALUATION_OUTCOME` member** (18.0.0, `add-radar-fire-outcome-journal`), and every existing member gained `evaluationOutcome` + `screenReason`.
46
- - **Scalar families became placeable modules** (13.0.0, `add-scalar-family-modules`); six opt-in scalar headers moved off the shared `session-field` section key.
47
-
48
- ### Widened enum — new members your own copy rejects
49
-
50
- - `TradeEvaluationAttemptReasonCode` gains `OPEN_POSITION_CHECK_UNAVAILABLE` (19.4.0), splitting a code that previously reported a platform fault as a fact about your account.
51
- - `QualificationGateCode` gains `REQUIRED_CONDITION_FALSE` (19.3.0), from the SCAN-stage gate that now evaluates required conditions before a fire edge is spent.
52
- - `TradingPipelineGateStage` gains `EVALUATION` and `TradeEvaluationAttemptReasonCode` gains `EVALUATION_FAULTED` (18.2.0).
53
-
54
- ### What you do NOT need to do
18
+ | | What it describes | Where to read it |
19
+ |---|---|---|
20
+ | Package version | This proxy's own code — a fix here, a dependency bump, a docs correction | `npm view @battlegrid/mcp-server version` |
21
+ | Contract version | The server's wire contract, live | The stdio handshake (`battlegrid@<contract>`), or `GET /mcp/version` |
55
22
 
56
- Nothing in the proxy changes. No configuration, no environment variable, no call-shape change on this package's own surface. If your client discovers tools live and reads results generically, `npm i @battlegrid/mcp-server@30` is the whole upgrade.
23
+ Seeing package `31.0.0` alongside handshake `battlegrid@30.0.0` is the system working. Both are printed to stderr at startup, labelled.
57
24
 
58
- ### Additive in the same span
25
+ **What this changes for you:** nothing about how you call anything. Upgrading the package no longer waits on a server deploy, and a server deploy no longer strands you on a package that names the wrong contract — reconnect and the announcement follows. **Contract breaking-change notes are no longer keyed to package versions**, since a contract move is no longer a release here; the v11-and-earlier notes below are kept as history, and the live vocabulary is always discovery.
59
26
 
60
- `27.1.0` exit-policy authoring input on `compile_strategy_plan` · `19.2.0` `get_account_state` account identity · `19.1.0` Standing Orders marker authoring · `18.4.0` `list_gate_blocks` summary groups · `18.3.0` radar maintenance pause · `18.1.0` protection geometry · `17.2.0` break-even/trailing status · `17.1.0` `get_signal_log` condition evaluation · `13.1.0` four owner-scoped read tools · `12.1.0` cross-venue spot price metrics · `11.1.0` discoverable rate limit.
27
+ ## Contract history — v12 → v31
61
28
 
62
- ## v11 — breaking cutover (v6 → v11)
29
+ These are the server contract breaks between contract 12 and contract 31. Most of the span shipped while the package sat at `11.0.0`; contract 31 landed after this package reached `31.0.0`, and the two numbers matching is coincidence — since v31 the announced contract is relayed from the server, so a package version says nothing about a contract version. They are **contract** history, not package releases: from v31 the announced contract is relayed live and a contract move is no longer a release here. Grouped by what a client observes, with the contract version that introduced each.
63
30
 
64
- **v11 pairs with the BattleGrid server's MCP contract v11.x — currently v11.0.0.** The package version tracks the server's wire contract, because the proxy announces `battlegrid@<package version>` in its own stdio handshake — the number a client reads has to be the contract it will actually reach. Upgrade the package and the server together: the major carries the breaking cutover described below, and the minor tracks additive contract moves that leave every existing call working.
31
+ **The proxy itself is unchanged.** It embeds no schemas, pins no contract version, and forwards `{ request }` verbatim. Every break below lands on whatever *authors* the payload or *reads* the result, never on the proxy.
65
32
 
66
- This release absorbs **six** breaking contract majors at once. The published package went from `5.0.0` straight to `11.0.0`, so no `6.x` through `10.x` client exists to upgrade from — the breaks are therefore grouped by **what you will observe**, with the contract version that introduced each, so a client hitting a specific rejection can find it here.
33
+ ### Changed meaning, unchanged shape — the one to read first
67
34
 
68
- **The proxy itself is unchanged.** It embeds no schemas, pins no contract version, and forwards `{ request }` verbatim. Every break below lands on whatever *authors* the payload or *reads* the result, never on the proxy.
35
+ - **Position-size presets are now a RISK BUDGET** (30.0.0, `split-stop-geometry-from-risk`). `smallPct` / `mediumPct` / `largePct` stop denoting a share of the ORDER (`notional = pct / 100 × headroom × leverage`) and start denoting the share of headroom placed **at risk** (`notional = headroom × riskPct / stopDistancePct`, capped at the margin headroom can post). Same keys, same types, same accepted range: **nothing in the payload tells you the meaning moved.** A client still sending `22.0` for MEDIUM is asking to risk 22% of its budget on one trade rather than roughly 2%. Typical risk budgets are `0.5`–`3`; the platform defaults moved to `1 / 2 / 3`. Leverage stops multiplying order size and becomes a constraint only.
69
36
 
70
37
  ### Rejected input — something you author is no longer accepted
71
38
 
39
+ - **`apply_strategy_plan` now publishes the same bounds as `compile_strategy_plan`** (31.0.0, resolving #4495). Eleven position-management dials were declared three times server-side and two copies had drifted, so apply advertised `trailingGivebackPct` as a bare number where compile advertised 25–55, and dropped `trailingTriggerR`'s `multipleOf 0.01` — the constraint pinning storage precision so a sub-precision value is rejected rather than rounded onto the trail-from-entry sentinel `0`. Nothing bad could ever commit (the digest would not match), but the refusal you got was a binding mismatch, which arrived as a bare `INTERNAL_ERROR`. Apply's published bounds only **narrow** to compile's; a client that copies values from `approvedPlan.postState`, as it should, is unaffected. Separately the trio `minStopLossAtrMultiple` / `maxStopLossAtrMultiple` / `minRiskRewardRatio` is published as a bare declaration by both tools, its real bounds being runtime-tunable and inexpressible in JSON Schema.
40
+
41
+ - **The stop-loss ceiling changed unit** (30.0.0). `maxStopLossPct` (a percent of entry) becomes `maxStopLossAtrMultiple` (a multiple of ATR), and the accepted range narrows from `(0, 100]` to `(0, 3]`. It is a rename **and** a re-denomination — mapping the old value onto the new key sends a number one to two orders of magnitude too large. The objects are `.strict()`, so a 29.x client sending `maxStopLossPct` is rejected with an unknown-key error. A new cross-field rule comes with it: `minStopLossAtrMultiple < maxStopLossAtrMultiple` is now a real comparison and is enforced.
42
+ - **The grid-confidence and trade-conviction bars left the agent** (28.0.0, `remove-agent-rule-defaults`). `tradingConfig.gridMinConfidence` and `minTradeConviction` are removed from the shared `.strict()` config; a bar is declared on the arena slot or radar slot that fires.
72
43
  - **The agent no longer carries either entry guard** (26.0.0). `create_agent` and `update_agent` stop
73
44
  accepting `tradingConfig.signalTimeoutMinutes` and `tradingConfig.maxEntryDeviationAtrMultiple`.
74
45
  The schema is `.strict()`, so a client still sending either is **rejected**, not silently ignored.
@@ -77,6 +48,7 @@ This release absorbs **six** breaking contract majors at once. The published pac
77
48
  drift budget for every decision, read at evaluation time; one governs how long an entry may stay
78
49
  unfilled, snapshotted onto the position at creation. **Remove both keys and send nothing in their
79
50
  place.**
51
+ - **The arena stopped granting trade authority** (25.0.0, `remove-arena-trade-permissions`). `upsert_deployment_policy` and `preview_deployment_resolution` stop accepting `tradingEnabled`, `minConviction` and `coinRules[]` on a slot.
80
52
  - **The agent no longer carries an exit policy** (24.0.0). `create_agent` and `update_agent` stop
81
53
  accepting `tradingConfig.positionManagement`. The schema is `.strict()`, so a client still sending
82
54
  it is **rejected**, not silently ignored. The twelve dials that decide how a stop MOVES after entry
@@ -98,29 +70,30 @@ This release absorbs **six** breaking contract majors at once. The published pac
98
70
  both is removed rather than renamed. To stop an agent trading, turn its deployment off (or halt
99
71
  the agent); to make one trade autonomously, arm a radar coin or switch trading on for an arena
100
72
  slot. **A newly authored arena slot now starts with trading off.**
101
- - **Challenge participation is no longer a field you set** (10.0.0). `create_agent` and `update_agent` stop accepting `arenaChallengeEnabled`, and a deployment policy's slot rules and per-coin rules stop accepting `challengeEnabled`. All four schemas are `.strict()`, so a client still sending any of them is **rejected**, not silently ignored. Challenge participation is now *identical* to effective trade permission, resolved per coin: to stop an agent taking challenges at a venue, turn that venue's trading off — at the slot, or per coin for finer grain — using fields you already have.
102
- - **`VOLUME_RATIO` is retired and replaced by `RVOL`** (6.0.0). `MetricKeySchema` auto-derives from the server's metric catalog, so the published enum simply stops accepting the old key: a column authored with `metric: 'VOLUME_RATIO'` is rejected against the enum. **No alias exists** — deliberately. The catalog audit adjudicated the old name as a name-level lie (the value is current volume ÷ its 20-period average, a *multiple*), and the correction was made at the root rather than grandfathered. If you hit an enum rejection naming `VOLUME_RATIO`, this note is the match.
103
- - **`BB_WIDTH` can no longer be ranked** (8.0.0). `{ metric: 'BB_WIDTH', transformId: 'rank' }` is now rejected. `BBwidth` is a price-unit spread (`upper − lower`) that had falsely declared `percent`, and that declaration was the only thing admitting it to exchange-wide ranking — the ordinal it produced sorted by token denomination rather than by compression. It re-declares `signedPrice` and leaves the ranked contract. **Rank `BB_WIDTH_PCT` (`bbWidthPct`) instead**, which ships in the same release: the capability moved, it was not removed.
104
-
105
- ### Silently non-matching — a generated header you match on moved
106
-
107
- This is the failure mode with no error attached to it. Nothing is rejected; your matcher simply stops finding the column.
108
-
109
- - **`vol` → `RVOL`** (6.0.0), and with it **`vol_trend` → `RVOL_trend`** and **`vol_rank_hi` → `RVOL_rank_hi`**. The header code moves with the metric key, because every generated header over that metric derives from the code alone.
110
- - **`BBwidth_rank_lo` no longer exists** (8.0.0) — it was the header of the ranked pairing retired above.
73
+ - **Trailing gained a required threshold** (22.0.0, `add-trailing-trigger-r`). `positionManagement` gains `trailingTriggerR` as REQUIRED (`0`–`2.0`, `0.01` precision, `0` = trail from entry); the object is `.strict()` all-required, so sending `positionManagement` without it is rejected.
74
+ - **The strategy regime timeframe became derived** (19.0.0, `remove-strategy-regime-override`). It stops being an authored axis anywhere on the contract and is served read-only.
75
+ - **Conditions gained a required `required`** (16.0.0, `add-condition-enforcement-gate`). A condition entry omitting the boolean is REJECTED rather than defaulted.
76
+ - **The trade-level policy moved to the strategy** (15.0.0, `move-trade-level-policy-to-strategy`). It leaves the agent authoring surface and joins the setup gates on the strategy.
77
+ - **The agent's ATR timeframe axis is gone** (14.0.0, `remove-agent-atr-timeframe-axis`). ATR is sampled on the strategy timeframe, always.
78
+ - **Radar's wall-clock condition changed shape** (12.0.0, `unify-deployment-hours-as-sets`).
111
79
 
112
80
  ### Moved or reshaped output — a field you read is somewhere else
113
81
 
114
- - **`estimatedTokenCount` is gone** (7.0.0). `preview_strategy_report` and `compile_strategy_plan` no longer carry it; the same number now sits one level deeper as **`budgetUsage.estimatedTokens.used`**, paired with the `cap` that governs it — so a client reading the count changes one path and gains the ceiling it was never told. `tokenCountModel` is unchanged. Discovery grows to match: `list_strategy_vocabulary` and the report catalog add `budgets.estimatedTokens` and a `previewExecutionLimits` object carrying the serialized-result byte cap and the preview deadline. Those two are published **cap-only** and deliberately have no `used` companion.
115
- - **`approvedPlan.mismatches` changed on both axes** (9.0.0). Both report-coverage codes are renamed off "module", because the module is no longer the unit of coverage:
82
+ - **`approvedPlan` is one object, not an operation union** (31.0.0, resolving #4495). It was published as a discriminated union whose discriminator does not survive JSON-Schema conversion, so what actually shipped was a bare `anyOf`: validating a failing compile response gave you every arm's errors with empty instance paths, and the top one typically complained that an UPDATE was missing `creationSeed` — a CREATE-only key — while the field that really failed went unnamed. It is now one object with a literal `operation` discriminator, and `creationSeed`, `expectedRevision` and `bindingImpact` are **required and nullable on every operation**: a CREATE plan carries a seed and `expectedRevision: null`, an UPDATE/RESTORE plan the reverse. **If you narrowed on the union arms, read `operation` instead and expect explicit `null`s rather than absent keys.** If you read those fields without narrowing, nothing changes except that they may now be null.
116
83
 
117
- | Was | Is now |
118
- |---|---|
119
- | `ACTIVE_SIGNAL_MODULE_NOT_IN_REPORT` | `ACTIVE_SIGNAL_DATA_NOT_IN_REPORT` |
120
- | `REPORT_MODULE_SIGNAL_OFF` | `REPORT_DATA_SIGNAL_OFF` |
121
-
122
- Each mismatch also carries a **required** `data: CoverageDatum[]` — the `(metric, rung)` pairs the mismatch is about: every MISSING datum for the not-in-report code, the PRESENT data for the signal-off code, empty for `REQUIRED_SIGNAL_UNAVAILABLE`. A client switching exhaustively on the old code strings stops matching. Behaviourally, coverage is now decided by whether the report renders a signal's declared metrics at the **rung** that signal reads, not by whether its module appears anywhere — so expect warnings you never saw before, and the disappearance of warnings no composition could clear. Mismatches remain advisory and non-blocking; nothing about apply gates on them.
123
- - **`IntelligenceAgentDTO` drops `arenaChallengeEnabled`** (10.0.0) — the read side of the input removal above. `ResolvedSlotRulesDTO.challengeEnabled` **stays and keeps its shape**; it is now derived server-side, carrying the same value and provenance as `tradingEnabled`, so a client reading the resolved bundle needs no change.
84
+ - **`get_radar_activity` gained an `EDGE_REARM` variant** (29.0.0, `add-radar-anchor-rearm`), and every member gained five `rearm*` margin keys plus a `rearmReasons` discriminator. Breaking on both counts if you parse the union strictly.
85
+ - **`get_trading_config_catalog` drops four trade-default seeds** (27.0.0) — `defaultMinAtrPct`,
86
+ `defaultMinStopLossPct`, `defaultMaxStopLossPct` and `defaultMinRiskRewardRatio` leave `defaults`.
87
+ Each seeded a per-agent field that is now **strategy-owned**: the shared `.strict()`
88
+ `TradingConfigSchema` already rejected all four as unknown keys, so the catalog was advertising
89
+ defaults no request could apply. A client that wants the stop-loss band, the ATR floor or the
90
+ risk-reward minimum reads them from the bound **strategy**, which owns and materializes them.
91
+ Nothing is added in their place. `defaultMaxEntryDeviationAtrMultiple` and `defaultTtlMinutes` are
92
+ untouched — those are not seeds but the platform values that govern.
93
+ - **`get_radar_activity` gained `blockReasonCode` on every member** (21.0.0, `fix-block-reason-attribution`) — non-null only on `BLOCKED_BEFORE_EVALUATION` rows written after 2026-08-17.
94
+ - **`signal_pipeline`'s decision became a discriminated union** (20.0.0, `add-decision-skip-attribution`). `ENTER`/`GATED` carry the seven level fields as REQUIRED; `SKIP` omits them entirely rather than sending nulls, so reading `entryPrice` without narrowing the verdict finds the key absent.
95
+ - **`get_radar_activity` gained an `EVALUATION_OUTCOME` member** (18.0.0, `add-radar-fire-outcome-journal`), and every existing member gained `evaluationOutcome` + `screenReason`.
96
+ - **Scalar families became placeable modules** (13.0.0, `add-scalar-family-modules`); six opt-in scalar headers moved off the shared `session-field` section key.
124
97
  - **Both entry guards leave every agent-returning shape** (26.0.0) — the read side of the input
125
98
  removal above. `AgentTradingConfigDTO` drops `signalTimeoutMinutes` and
126
99
  `maxEntryDeviationAtrMultiple` on every tool that serves an agent, and the explorer trading spec
@@ -149,6 +122,58 @@ This is the failure mode with no error attached to it. Nothing is rejected; your
149
122
  - **`DeploymentResolvedResolutionDTO` drops `agentTradingMode`** (23.0.0) — the field 10.0.0 added,
150
123
  now unnecessary: with no account layer to overlay, the resolved `tradingEnabled` is the whole
151
124
  answer about whether the previewed deployment trades.
125
+
126
+ ### Widened enum — new members your own copy rejects
127
+
128
+ - **Seven plan-token failures became their own error codes** (31.0.0, resolving #4495). `TOKEN_EXPIRED`, `TOKEN_BINDING_MISMATCH`, `INVALID_TOKEN_SIGNATURE`, `INVALID_TOKEN_FORMAT`, `INVALID_TOKEN_CLAIMS`, `INVALID_DIGEST_MATERIAL` and `INVALID_MATERIALIZATION_FENCE` all used to arrive as a bare `INTERNAL_ERROR` — the server wrote the true reason to its own audit log and discarded it at the boundary, so a refused apply told you nothing. They now arrive as themselves, over MCP and HTTP alike, with 409-class status for the two state-conflict codes and 400-class for the five malformed-material codes. A client switching exhaustively on error codes must add the branches; one rendering unknown codes generically is unaffected. Two are worth handling by name: `TOKEN_EXPIRED` means recompile (the token lives five minutes), and `INVALID_TOKEN_SIGNATURE` usually means the token was not forwarded verbatim — it is opaque, so copy it byte-for-byte and never retype or reconstruct it.
129
+
130
+ - `TradeEvaluationAttemptReasonCode` gains `OPEN_POSITION_CHECK_UNAVAILABLE` (19.4.0), splitting a code that previously reported a platform fault as a fact about your account.
131
+ - `QualificationGateCode` gains `REQUIRED_CONDITION_FALSE` (19.3.0), from the SCAN-stage gate that now evaluates required conditions before a fire edge is spent.
132
+ - `TradingPipelineGateStage` gains `EVALUATION` and `TradeEvaluationAttemptReasonCode` gains `EVALUATION_FAULTED` (18.2.0).
133
+
134
+ ### What you do NOT need to do
135
+
136
+ Nothing in the proxy changes. No configuration, no environment variable, no call-shape change on this package's own surface. If your client discovers tools live and reads results generically, `npm i @battlegrid/mcp-server@30` is the whole upgrade.
137
+
138
+ ### Additive in the same span
139
+
140
+ `27.1.0` exit-policy authoring input on `compile_strategy_plan` · `19.2.0` `get_account_state` account identity · `19.1.0` Standing Orders marker authoring · `18.4.0` `list_gate_blocks` summary groups · `18.3.0` radar maintenance pause · `18.1.0` protection geometry · `17.2.0` break-even/trailing status · `17.1.0` `get_signal_log` condition evaluation · `13.1.0` four owner-scoped read tools · `12.1.0` cross-venue spot price metrics · `11.1.0` discoverable rate limit.
141
+
142
+ ## v11 and earlier — contract history (v6 → v11)
143
+
144
+ > **Historical.** These notes are keyed to the package versions that once paired with contract versions. That pairing ended at v31 (above); the breaks themselves are still real, and still describe the server's contract as it moved from 6.0.0 to 11.0.0.
145
+
146
+ **v11 paired with the BattleGrid server's MCP contract v11.x.** Under the pairing rule then in force, the package version tracked the server's wire contract because the proxy announced `battlegrid@<package version>` in its own stdio handshake.
147
+
148
+ This release absorbs **six** breaking contract majors at once. The published package went from `5.0.0` straight to `11.0.0`, so no `6.x` through `10.x` client exists to upgrade from — the breaks are therefore grouped by **what you will observe**, with the contract version that introduced each, so a client hitting a specific rejection can find it here.
149
+
150
+ **The proxy itself is unchanged.** It embeds no schemas, pins no contract version, and forwards `{ request }` verbatim. Every break below lands on whatever *authors* the payload or *reads* the result, never on the proxy.
151
+
152
+ ### Rejected input — something you author is no longer accepted
153
+
154
+ - **Challenge participation is no longer a field you set** (10.0.0). `create_agent` and `update_agent` stop accepting `arenaChallengeEnabled`, and a deployment policy's slot rules and per-coin rules stop accepting `challengeEnabled`. All four schemas are `.strict()`, so a client still sending any of them is **rejected**, not silently ignored. Challenge participation is now *identical* to effective trade permission, resolved per coin: to stop an agent taking challenges at a venue, turn that venue's trading off — at the slot, or per coin for finer grain — using fields you already have.
155
+ - **`VOLUME_RATIO` is retired and replaced by `RVOL`** (6.0.0). `MetricKeySchema` auto-derives from the server's metric catalog, so the published enum simply stops accepting the old key: a column authored with `metric: 'VOLUME_RATIO'` is rejected against the enum. **No alias exists** — deliberately. The catalog audit adjudicated the old name as a name-level lie (the value is current volume ÷ its 20-period average, a *multiple*), and the correction was made at the root rather than grandfathered. If you hit an enum rejection naming `VOLUME_RATIO`, this note is the match.
156
+ - **`BB_WIDTH` can no longer be ranked** (8.0.0). `{ metric: 'BB_WIDTH', transformId: 'rank' }` is now rejected. `BBwidth` is a price-unit spread (`upper − lower`) that had falsely declared `percent`, and that declaration was the only thing admitting it to exchange-wide ranking — the ordinal it produced sorted by token denomination rather than by compression. It re-declares `signedPrice` and leaves the ranked contract. **Rank `BB_WIDTH_PCT` (`bbWidthPct`) instead**, which ships in the same release: the capability moved, it was not removed.
157
+
158
+ ### Silently non-matching — a generated header you match on moved
159
+
160
+ This is the failure mode with no error attached to it. Nothing is rejected; your matcher simply stops finding the column.
161
+
162
+ - **`vol` → `RVOL`** (6.0.0), and with it **`vol_trend` → `RVOL_trend`** and **`vol_rank_hi` → `RVOL_rank_hi`**. The header code moves with the metric key, because every generated header over that metric derives from the code alone.
163
+ - **`BBwidth_rank_lo` no longer exists** (8.0.0) — it was the header of the ranked pairing retired above.
164
+
165
+ ### Moved or reshaped output — a field you read is somewhere else
166
+
167
+ - **`estimatedTokenCount` is gone** (7.0.0). `preview_strategy_report` and `compile_strategy_plan` no longer carry it; the same number now sits one level deeper as **`budgetUsage.estimatedTokens.used`**, paired with the `cap` that governs it — so a client reading the count changes one path and gains the ceiling it was never told. `tokenCountModel` is unchanged. Discovery grows to match: `list_strategy_vocabulary` and the report catalog add `budgets.estimatedTokens` and a `previewExecutionLimits` object carrying the serialized-result byte cap and the preview deadline. Those two are published **cap-only** and deliberately have no `used` companion.
168
+ - **`approvedPlan.mismatches` changed on both axes** (9.0.0). Both report-coverage codes are renamed off "module", because the module is no longer the unit of coverage:
169
+
170
+ | Was | Is now |
171
+ |---|---|
172
+ | `ACTIVE_SIGNAL_MODULE_NOT_IN_REPORT` | `ACTIVE_SIGNAL_DATA_NOT_IN_REPORT` |
173
+ | `REPORT_MODULE_SIGNAL_OFF` | `REPORT_DATA_SIGNAL_OFF` |
174
+
175
+ Each mismatch also carries a **required** `data: CoverageDatum[]` — the `(metric, rung)` pairs the mismatch is about: every MISSING datum for the not-in-report code, the PRESENT data for the signal-off code, empty for `REQUIRED_SIGNAL_UNAVAILABLE`. A client switching exhaustively on the old code strings stops matching. Behaviourally, coverage is now decided by whether the report renders a signal's declared metrics at the **rung** that signal reads, not by whether its module appears anywhere — so expect warnings you never saw before, and the disappearance of warnings no composition could clear. Mismatches remain advisory and non-blocking; nothing about apply gates on them.
176
+ - **`IntelligenceAgentDTO` drops `arenaChallengeEnabled`** (10.0.0) — the read side of the input removal above. `ResolvedSlotRulesDTO.challengeEnabled` **stays and keeps its shape**; it is now derived server-side, carrying the same value and provenance as `tradingEnabled`, so a client reading the resolved bundle needs no change.
152
177
  - **`range` is no longer a tuple** (11.0.0). The closed positional pair `[min, max]` becomes the half-open object **`{ min: number; max?: number }`**. It travels through `ScalarSchema`, so this lands on `list_strategy_vocabulary`, `query_report_catalog`, and `get_metric_construction_hints` alike.
153
178
 
154
179
  **This one fails silently.** A client reading `range[0]` / `range[1]` gets `undefined` with no error raised — read `range.min` / `range.max` instead, and treat a missing `max` as unbounded above. The tuple could not state the truth about the volume/trade-count family, which is non-negative and unbounded above, and `Infinity` serializes to `null` on the wire. Those six metrics now declare `{ min: 0 }`, and as a consequence their **`far`/`near` rank orderings are no longer offered** — on a non-negative value that pair is a synonym pair under the magnitude gate's documented semantics.
@@ -168,7 +193,7 @@ Nothing here is a break, but a client that enumerates these vocabularies will wa
168
193
  - **Four metric keys** join the catalog — `SPOT_CVD`, `PERP_SPOT_FLOW`, `PERP_SPOT_STRENGTH`, `PERP_SPOT_CONFIRMS` — and `includePerpSpotFlow` joins the context-source key set as its 23rd member, opt-in (5.2.0).
169
194
  - **Two prompt-section `kind`s** join the union: `perp-spot-flow` (5.2.0) and `session-field` (5.1.0). Only a client that switches exhaustively on `kind` needs a default branch; one that renders `content` generically needs nothing.
170
195
  - **The transform vocabulary grows 15 → 17** (11.0.0) — `efficiency` and `maxShare` join, and both join the chain-outer enum that `chainSuccessors` is served as. Only a client that switches exhaustively on `transformId` needs new branches; one that renders the served labels generically needs nothing.
171
- - ~~**The deployment-policy resolution DTO gains `agentTradingMode`**~~ (10.0.0, **removed again in 23.0.0**) — it existed to tell "this rule permits the trade" from "this account can trade at all". The account-level trading mode is gone, so the second question no longer exists and the field was dropped; read the resolved `tradingEnabled` alone.
196
+ - **The deployment-policy resolution DTO gains `agentTradingMode`** (10.0.0) — the preview previously reported trade rules for an agent whose *account-level* trading was off, and the account gate is not part of rule resolution. Read it to tell "this rule permits the trade" from "this account can trade at all".
172
197
  - **`PlatformSectionDTO` gains `columns`** (6.1.0) — a platform section's composition in the same wire shape a custom section's columns already travel in, empty for a registry-declared special. **Not a copy source**, which is where it differs from the identically-shaped `CustomSectionTemplateDTO.columns`: six platform columns pair a metric with `classifyState`, a deliberate composability exclusion that authoring rejects at construction. A client that round-trips these into a custom section will be refused, and that refusal is correct.
173
198
 
174
199
  ## v5 — breaking major (conditions/verdicts fusion)
@@ -416,7 +441,8 @@ Tools, prompts, and resources are **discovered live** from the connected server
416
441
 
417
442
  ## Rediscovery & versioning
418
443
 
419
- - **Package/server contract-line pairing.** This package's `MAJOR.MINOR` pairs with the BattleGrid server's published MCP contract version (`MCP_CONTRACT_VERSION`). The pairing is not decorative: the proxy re-announces itself as `battlegrid@<package version>` to the local client, under the same server name the remote handshake uses, so a package left behind tells clients a contract number that no longer exists — and a package *ahead* tells them one that does not exist yet. **The line, not just the major:** the contract ships additive changes as minors (`5.1.0`, `5.2.0`, `6.1.0`), so matching majors alone would let the package advertise a minor the server does not serve. Only the PATCH is the package's own space. The publish workflow enforces this against the deployed endpoint; it is not left to memory.
444
+ - **The announced contract is relayed, not declared.** The proxy reads the upstream server's identity from the handshake it just completed and re-announces it verbatim to the local client. A local client therefore always reads the contract it will actually reach, and the package version is free to mean only what it should: this proxy's own code. **There is no pairing rule to keep, and no publish-time deploy gate** — a released package makes no claim about the server, so there is no ordering between a release here and a deploy there. This replaces the `MAJOR.MINOR` pairing that held through v11; see [v12](#v12--the-announced-contract-is-read-from-the-server-not-declared-here).
445
+ - **Fails closed, never falls back.** If a connected server announced no `serverInfo` — a protocol violation, since it is required in a successful `initialize` result — the proxy refuses to start rather than substituting its own version. There is no honest number to announce in that case, and announcing a dishonest one silently is the failure this design removes.
420
446
  - **Rediscover after a server cutover.** Package publication does not refresh a running proxy's cached startup snapshot. Restart/reconnect the proxy and re-run `tools/list`, `prompts/list`, and `resources/list` after the server deploys.
421
447
  - **Restart after key rotation.** API keys are read once at process startup; rotate a key, then restart the proxy.
422
448
 
@@ -436,8 +462,7 @@ Tools, prompts, and resources are **discovered live** from the connected server
436
462
  | 8.0.0 | Server contract v8.0.0, **breaking**, on two axes. `BB_WIDTH × rank` is no longer authorable: `BBwidth` is a price-unit spread that falsely declared `percent`, which was the only thing admitting it to exchange-wide ranking, so it re-declares `signedPrice` and leaves the ranked contract — `{metric: 'BB_WIDTH', transformId: 'rank'}` is rejected and `BBwidth_rank_lo` stops matching, with `BB_WIDTH_PCT` (`bbWidthPct`) shipping as the comparable replacement. Separately the published `unit` enum **widens** with `ratio` and `fraction`, and `RVOL`, `BUY_PRESSURE`, `BB_PCT_B` emit them instead of `percent` — a break for a client holding its own closed copy of that enum, which is the opposite direction from an input narrowing. Values are not rescaled: `buyPres` and `pctB` stay 0–1. Never published as a package version |
437
463
  | **9.0.0** | Server contract v9.0.0, **breaking**: `compile_strategy_plan`'s `approvedPlan.mismatches` changes on both axes. Both report-coverage codes are renamed off "module" (`ACTIVE_SIGNAL_MODULE_NOT_IN_REPORT` → `ACTIVE_SIGNAL_DATA_NOT_IN_REPORT`, `REPORT_MODULE_SIGNAL_OFF` → `REPORT_DATA_SIGNAL_OFF`), and each mismatch carries a required `data: CoverageDatum[]` — the `(metric, rung)` pairs it is about. A client switching exhaustively on the old code strings stops matching. Coverage is now decided by whether the report renders a signal's declared metrics at the rung that signal reads, so expect warnings never seen before and the disappearance of warnings no composition could clear; mismatches stay advisory and non-blocking. Never published as a package version |
438
464
  | 10.0.0 | Server contract v10.0.0, **breaking**: challenge participation stops being a declared setting anywhere and becomes identical to effective trade permission, resolved per coin. `create_agent`/`update_agent` stop accepting `arenaChallengeEnabled`, and a deployment policy's slot and per-coin rule shapes stop accepting `challengeEnabled` — all four are `.strict()`, so a client still sending them is rejected rather than ignored, the same input-acceptance narrowing that made v4, v5, v6 and v8 majors. `IntelligenceAgentDTO` drops `arenaChallengeEnabled`; `ResolvedSlotRulesDTO.challengeEnabled` stays and keeps its shape, now derived server-side with the same value and provenance as `tradingEnabled`. The resolution DTO also gains `agentTradingMode` — the preview previously reported trade rules for an agent whose account-level trading was off. Never published as a package version |
439
- | **11.0.0** | Server contract v11.0.0, **breaking**: a catalogued numeric output's `range` changes shape — the closed positional tuple `[min, max]` becomes the half-open object `{ min: number; max?: number }`, travelling through `ScalarSchema` into `list_strategy_vocabulary`, `query_report_catalog` and `get_metric_construction_hints`. A client reading `range[0]`/`range[1]` gets `undefined` **with no error**, which is the silent failure mode a version exists to prevent. The driver: the tuple could not state the truth about the volume/trade-count family — non-negative and unbounded above — and `Infinity` serializes to `null` on the wire; those six metrics now declare `{ min: 0 }` and no longer offer `far`/`near` rank orderings, which on a non-negative value are a synonym pair. Additive alongside it: the transform vocabulary grows 15 → 17 (`efficiency`, `maxShare`), both joining the chain-outer enum served as `chainSuccessors`. **This is the package version paired to the current server contract.** No proxy code change — the version is the client-facing signal, and the proxy's handshake carries it |
440
- | 11.1.0 | Server contract v11.1.0, **additive**: the per-user request budget becomes discoverable rather than only enforceable |
465
+ | **11.0.0** | Server contract v11.0.0, **breaking**: a catalogued numeric output's `range` changes shape — the closed positional tuple `[min, max]` becomes the half-open object `{ min: number; max?: number }`, travelling through `ScalarSchema` into `list_strategy_vocabulary`, `query_report_catalog` and `get_metric_construction_hints`. A client reading `range[0]`/`range[1]` gets `undefined` **with no error**, which is the silent failure mode a version exists to prevent. The driver: the tuple could not state the truth about the volume/trade-count family — non-negative and unbounded above — and `Infinity` serializes to `null` on the wire; those six metrics now declare `{ min: 0 }` and no longer offer `far`/`near` rank orderings, which on a non-negative value are a synonym pair. Additive alongside it: the transform vocabulary grows 15 → 17 (`efficiency`, `maxShare`), both joining the chain-outer enum served as `chainSuccessors`. **The last version published under the pairing rule.** No proxy code change — the version was the client-facing signal, and the proxy's handshake carried it |
441
466
  | 12.0.0 | Server contract v12.0.0, **breaking**: radar's wall-clock condition changes shape (`unify-deployment-hours-as-sets`) |
442
467
  | 12.1.0 | Server contract v12.1.0, **additive**: `SPOT_CLOSE_CB` / `SPOT_CLOSE_BN` join the metric catalog |
443
468
  | 13.0.0 | Server contract v13.0.0, **breaking**: scalar families become placeable modules; six scalar headers leave the `session-field` key |
@@ -472,12 +497,7 @@ Tools, prompts, and resources are **discovered live** from the connected server
472
497
  | 23.0.0 | Server contract v23.0.0, **breaking**: the agent-level trading mode is retired. `create_agent`/`update_agent` stop accepting `tradingConfig.tradingMode` on the shared `.strict()` `TradingConfigSchema`, so a client still sending it is rejected rather than ignored — the same input-acceptance narrowing that made v4, v5, v6, v8 and v10 majors. On the read side `AgentTradingConfigDTO` drops `tradingMode` on every agent-returning tool, and so do the agents-hub permission envelope, the explorer entry and both public-profile shapes; `DeploymentResolvedResolutionDTO` drops `agentTradingMode`, the field v10.0.0 added, because with no account layer to overlay the resolved `tradingEnabled` is the whole answer. Trading on/off is now scoped per deployment (radar policy `enabled`, arena slot `tradingEnabled`, per-coin `tradeEnabled`) and a newly authored arena slot starts with trading **off**; approval-before-execution is the conversational surface's own contract, so `accept_entry_decision` / `cancel_entry_decision` / `list_pending_approvals` are unchanged on the wire but now carry conversational proposals exclusively — a deployed agent never queues for approval. Never published as a package version |
473
498
  | 24.0.0 | Server contract v24.0.0, **breaking**: the post-entry exit policy moves from the agent to the strategy. `create_agent`/`update_agent` stop accepting `tradingConfig.positionManagement` on the shared `.strict()` `TradingConfigSchema`, so a client still sending it is rejected rather than ignored — the same input-acceptance narrowing that made v4, v5, v6, v8, v10 and v23 majors. On the read side `AgentTradingConfigDTO` drops the nested block on every agent-returning tool and the explorer trading spec drops it too; `get_trading_config_catalog` drops `positionManagementPresets` and the `defaultPositionMgmt*` trading defaults. The pistol-preset ladder (COLT / WEBLEY / BERETTA / LUGER / WALTHER) is **retired, not renamed** — once the values live on the strategy, the strategy is the named bundle. Additive on the authoring surface in the same bump: `compile_strategy_plan`/`apply_strategy_plan` post-state gains the twelve authored keys beside the trade-level trio, and the plan diff gains a `positionManagement` axis. Behaviourally the umbrella `enabled` flag is **deleted** rather than moved: each mechanism toggle is the whole truth for that mechanism, so a client can no longer express "trailing on, management off". Never published as a package version |
474
499
  | 26.0.0 | Server contract v26.0.0, **breaking**: both entry-lifecycle guards stop being agent configuration. `create_agent`/`update_agent` stop accepting `tradingConfig.signalTimeoutMinutes` and `tradingConfig.maxEntryDeviationAtrMultiple` on the shared `.strict()` `TradingConfigSchema`, so a client still sending either is rejected rather than ignored — the same input-acceptance narrowing that made v4, v5, v6, v8, v10, v23 and v24 majors. Neither has a replacement key: one `platform_config` value governs the entry-price drift budget for every decision (read at evaluation time, so an admin edit applies to the next evaluation), and one governs how long an entry may stay unfilled (snapshotted onto the position at creation, so an edit can never cancel an order already resting on the book). On the read side `AgentTradingConfigDTO` drops both fields on every agent-returning tool, and so do the explorer trading spec and the agent-review payload; `get_trading_config_catalog` drops `defaultSignalTimeoutMinutes` and the `minimum_`/`maximum_maxEntryDeviationAtrMultiple` bound pair, while `defaultMaxEntryDeviationAtrMultiple` and `defaultTtlMinutes` stay and become the values that actually govern. Behaviourally a conversational entry and an autonomous entry on the same setup now receive the **identical** unfilled lifetime — the mode-selecting fallback that chose between a per-agent timeout and a hardcoded 15-minute resting window is gone, and the three-way timeout enum with it. Never published as a package version |
475
-
476
- > **Gap: contract 25.0.0 is not recorded in this table.** It shipped server-side as
477
- > `remove-arena-trade-permissions` (the arena stops granting trade authority; `upsert_deployment_policy`
478
- > and `preview_deployment_resolution` stop accepting `tradingEnabled` / `minConviction` / `coinRules[]`
479
- > on a slot, and `DeploymentSlotDTO` reshapes). Its row belongs to that change and is left for it to
480
- > write rather than reconstructed here.
500
+ | **31.0.0** | **Proxy change, and the end of the pairing rule.** The version announced downstream is now read from the upstream handshake at connect time and relayed verbatim, instead of being a constant compiled into this package. A local client reads the contract it will actually reach, on every connection, with no release involved. Breaking because the package number now means something different — this proxy's own code, not the server's contract — so `npm view` and the handshake legitimately differ, and code keyed to them being equal is wrong. Retired with it: the publish-time deploy gate (`scripts/assert-deployed-contract.mjs`) and the `MAJOR.MINOR` pairing rule, both of which existed only because the two numbers could disagree. Fails closed if a connected server announces no `serverInfo` rather than substituting its own version. Contract moves no longer produce a release here |
481
501
 
482
502
  ## Maintainer release procedure
483
503
 
@@ -485,7 +505,9 @@ Tools, prompts, and resources are **discovered live** from the connected server
485
505
 
486
506
  Publishing runs only in GitHub-hosted Actions. Never run `npm publish` from the BattleGrid application VM or a maintainer workstation.
487
507
 
488
- **A version change on `main` is the release.** Merge a pull request that changes `package.json`'s version and the workflow does the rest: it confirms that version is not already on the registry, verifies every value expressing it agrees, asserts the deployed server serves that contract major, tests, builds, packs, publishes with npm provenance, and tags what shipped. There is no manual tag step — the tag is an output of a successful publish, not its prerequisite.
508
+ **A version change on `main` is the release.** Merge a pull request that changes `package.json`'s version and the workflow does the rest: it confirms that version is not already on the registry, verifies every value expressing it agrees, tests, builds, packs, publishes with npm provenance, and tags what shipped. There is no manual tag step — the tag is an output of a successful publish, not its prerequisite.
509
+
510
+ **Release whenever this package's code is ready.** Since v12 the package makes no claim about the server's contract, so there is no deploy to sequence against and no gate asserting one. Publishing before, during, or after a server deploy is equally correct.
489
511
 
490
512
  That inversion is deliberate. Publication used to be triggered by a tag, which meant a version bump with no tag published nothing **and reported nothing** — how `5.1.0` came to be declared in this repository and absent from the registry, caught by no check at all.
491
513
 
@@ -498,34 +520,24 @@ That inversion is deliberate. Publication used to be triggered by a tag, which m
498
520
  | Check, build, publish, and tag | GitHub-hosted `ubuntu-latest`, Node 24 |
499
521
  | Verify registry publication | Any shell |
500
522
 
501
- **The deploy check needs no credential.** `scripts/assert-deployed-contract.mjs` reads `GET /mcp/version`, which the server serves **unauthenticated by design** — the contract version is announced to every connected client and committed to the app repo's `docs/architecture/mcp-manifest.json`, so it is not a secret. Requiring auth would have meant this workflow holding a BattleGrid API key, and every such key carries `mcp:wager` (there is no read-only variant), i.e. authority to submit wagers and close live positions in order to read a version number. The check fails closed on a mismatch, an unreachable endpoint, a non-200, or an unreadable body — but there is no secret to provision, scope, rotate, or leak.
523
+ **The workflow needs no BattleGrid credential.** It never contacts the BattleGrid server at all. The deploy gate that used to (reading `GET /mcp/version`, unauthenticated by design) was retired in v12 along with the pairing rule that motivated it. Its no-credential property is worth keeping in mind if a future check ever needs the contract version: every BattleGrid MCP API key carries `mcp:wager` and there is no read-only variant, so a credentialed check would mean this workflow holding authority to submit wagers and close live positions in order to read a version number. `GET /mcp/version` exists precisely so that trade never has to be made.
502
524
 
503
525
  Also confirm npm's Trusted Publisher for `@battlegrid/mcp-server` is GitHub Actions with organization `playbattlegrid`, repository `battlegrid-mcp`, workflow filename `publish.yml`, no environment name, and `npm publish` allowed. The workflow uses short-lived OIDC credentials; do not add a long-lived `NPM_TOKEN`.
504
526
 
505
527
  ### Preparing the version change
506
528
 
507
- - **Read the target version from the generated manifest, never from prose.** The number this package pairs to is `server.contractVersion` in `battlegrid-app`'s `docs/architecture/mcp-manifest.json` — generated by `buildMcpManifest` and CI-verified, on a freshly fetched `origin/main` (a stale ref reports a superseded contract silently). **A contract version quoted in an issue, a pull request, or any other hand-written text is not the target.** During active contract development that number changes on merge, so prose carries a value that was true when written and is unverifiable when read. Every pairing before v9 was sourced from prose, and the v9 pairing was filed against a contract three majors stale.
508
- - **Move all four values together** — `package.json`, both `package-lock.json` version fields (the root `version` and the self-referencing `packages[""].version`), and the exported `VERSION` in `src/index.ts`. The workflow compares all four against each other and fails closed on any disagreement.
509
- - **Merge the version change only after the server is deployed.** The deploy assertion is a safety net, not a routine step: with the ordering right it never fires, and a red workflow on `main` means something is genuinely wrong rather than that you are waiting. Merging early blocks the publish until the deploy lands, then re-run the job — nothing was published and no tag exists to move.
510
-
511
- ### What tells you a pairing is owed
512
-
513
- [`.github/workflows/contract-drift.yml`](.github/workflows/contract-drift.yml) runs daily, reads the same unauthenticated `GET /mcp/version` the deploy assertion reads, compares the same `MAJOR.MINOR` contract line, and **opens a bump PR when they diverge**. Merge it and the release follows, because a version change on `main` IS the release.
514
-
515
- It exists because the deploy assertion could not do this job. `scripts/assert-deployed-contract.mjs` runs only when a publish is ATTEMPTED, so it can refuse a release someone started and cannot say one is owed. Between 2026-08-07 and 2026-08-23 no publish was attempted while the server advanced from contract `11.0` to `30.0`, and this package spent sixteen days announcing `battlegrid@11.0.0` to every client — the exact failure the pairing section above describes. It was also unpublishable for that whole period, since its own gate would have refused `11.0` against `30.0`.
516
-
517
- Reading the DEPLOYED endpoint rather than the app repo's merged manifest is deliberate: it makes the watch fire only once the deploy has landed, which is the ordering *Preparing the version change* already requires.
518
-
519
- The PR it opens moves all four version values, and its body says what a human still owes — the README release section describing what changed for clients. The bump is mechanical; the changelog is judgement, which is why this opens a PR instead of merging one.
529
+ - **Version this package's own code, and nothing else.** Since v12 the number describes this proxy's build — a fix here, a dependency bump, a documentation correction — and makes no statement about the server. **Do not move it because the server's contract moved**; that used to be the whole job and is now a category error. Ordinary semver against the proxy's own surface: MAJOR for a break in how the proxy behaves or what its number means, MINOR for proxy features, PATCH for fixes and docs.
530
+ - **Move all three values together** — `package.json`, both `package-lock.json` version fields (the root `version` and the self-referencing `packages[""].version`), and `PACKAGE_VERSION` in `src/index.ts`. The workflow compares all of them and fails closed on any disagreement.
531
+ - **No deploy to wait for.** A release here is independent of the server's deploy schedule in both directions.
520
532
 
521
- ### Which releases need a server deploy
533
+ ### What a server contract move needs from this package
522
534
 
523
- The deploy assertion compares the **contract line** — `MAJOR.MINOR` — not the full version and not the major alone.
535
+ **Nothing.** That is the point of v12. When the server's contract moves, connected proxies announce the new version on their next connection, with no publish, no version bump, and no coordination.
524
536
 
525
- - **A contract pairing** — the server's contract moved, so the package follows. This needs the deploy to land first. Note this includes **minor** moves: the contract ships additive changes as minors (`5.1.0`, `5.2.0` and `6.1.0` were all additive), and the proxy announces the full version it publishes, so a package minor ahead of the server would advertise additive features the deployed endpoint does not serve.
526
- - **A proxy-only release** — a fix in this package's own code, a dependency bump, a documentation correction. Move the **PATCH**, which is the package's own space: the contract has never carried a non-zero patch, so a patch bump makes no claim about the server and needs no deploy. This is the historical norm, not an edge case — `1.0.1`, `1.0.2`, `1.1.2`, `1.1.4` and `3.0.1` were all proxy-only, and `3.0.1` is recorded in the version table above as *"Docs only — … No proxy behavior change"*.
537
+ Two things do still need doing, neither of them a release:
527
538
 
528
- Comparing full versions would reject every one of those patch releases; comparing majors alone would let the package advertise a contract minor the server does not serve. The contract line is the boundary that is actually true.
539
+ - **Reconnect** to pick up the new contract — the announcement and the capability snapshot are both read once at startup (see [Rediscovery & versioning](#rediscovery--versioning)).
540
+ - **Document the break** where the contract is documented, in `battlegrid-app`. Contract breaking-change notes are no longer keyed to package versions in this README, because a contract move is no longer a release here.
529
541
 
530
542
  ### Verify publication
531
543
 
@@ -548,11 +560,11 @@ Require the exact version, `latest` pointing at that version, and a provenance a
548
560
 
549
561
  There is no separate registry-reconciliation step to remember. "Is this version already published?" is the workflow's own first question — it decides whether the run publishes at all — so a bump can no longer sit in the repository unpublished and unreported the way `5.1.0` did.
550
562
 
551
- **The server-side release canary is not evidence about this package.** `battlegrid-app`'s `server/scripts/release-canary-mcp.ts` connects to the deployed endpoint and compares `client.getServerVersion()` against the server's own imported `MCP_CONTRACT_VERSION` — **both sides are server-side, and it never queries npm.** It passes with this package at any version, including one that was never published. Package-side evidence is exactly three things: the workflow's version-integrity gate, the registry checks above (plus `gitHead` matching the release commit and the handshake constant in the published `dist/index.js`), and a **reconnect** showing `battlegrid@<version>` in the stdio handshake.
563
+ **The server-side release canary is not evidence about this package.** `battlegrid-app`'s `server/scripts/release-canary-mcp.ts` connects to the deployed endpoint and compares `client.getServerVersion()` against the server's own imported `MCP_CONTRACT_VERSION` — **both sides are server-side, and it never queries npm.** It passes with this package at any version, including one that was never published. Package-side evidence is exactly two things: the workflow's version-integrity gate, and the registry checks above with `gitHead` matching the release commit.
552
564
 
553
- Note the deploy assertion in the workflow is a *different* check from that canary and does not share its limitation: it reads the deployed handshake and compares it against **this package's** version, so both sides are not server-side.
565
+ **A reconnect no longer proves which package version is running**, and this is the one verification v12 took away rather than improved. The stdio handshake now shows `battlegrid@<contract>` — the *server's* number — so it is identical whether the local proxy is 12.0.0 or a stale 11.0.0 from a cached `npx`. Read `PACKAGE_VERSION` from the installed `dist/index.js`, or the trailing `proxy <version>` field in the startup stderr line, to confirm which build is running.
554
566
 
555
- If a run fails, inspect it before taking action. An `ENEEDAUTH` failure means the npm Trusted Publisher fields do not match the workflow — fix the publisher configuration and re-run the job. A failed deploy assertion means the server has not deployed that contract major yet; deploy, then re-run. In both cases nothing was published and no tag was created, so there is nothing to move or reuse. Never mutate a published release with `npm audit fix`; dependency remediation goes through a new reviewed commit and version.
567
+ If a run fails, inspect it before taking action. An `ENEEDAUTH` failure means the npm Trusted Publisher fields do not match the workflow — fix the publisher configuration and re-run the job; nothing was published and no tag was created, so there is nothing to move or reuse. Never mutate a published release with `npm audit fix`; dependency remediation goes through a new reviewed commit and version.
556
568
 
557
569
  ## Skills
558
570
 
package/dist/index.d.ts CHANGED
@@ -19,6 +19,11 @@
19
19
  * the nested request — the server owns every required field, bound, union
20
20
  * discriminator, and `additionalProperties:false` constraint.
21
21
  *
22
+ * Versions (two of them, describing two different things):
23
+ * - PACKAGE_VERSION — this proxy's own code. Sent UPSTREAM as the client identity.
24
+ * - the announced contract — read from the upstream handshake at connect time and relayed
25
+ * DOWNSTREAM verbatim. Never a constant compiled into this package. See `announcedIdentityOf`.
26
+ *
22
27
  * Architecture: Matches Stripe's @stripe/mcp pattern — thin authenticated proxy.
23
28
  *
24
29
  * Usage:
@@ -32,7 +37,19 @@
32
37
  */
33
38
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
34
39
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
35
- export declare const VERSION = "30.0.0";
40
+ import { type Implementation } from '@modelcontextprotocol/sdk/types.js';
41
+ /**
42
+ * This package's own version — the proxy's code, and nothing else.
43
+ *
44
+ * It deliberately does NOT describe the server's wire contract. That number is read from the
45
+ * upstream handshake on every connection and relayed downstream (`announcedIdentityOf`), so the two
46
+ * cannot drift: there is no second place to update and no release needed when the contract moves.
47
+ *
48
+ * Sent upstream as the CLIENT identity, where "which proxy build is calling" is exactly the question
49
+ * being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
50
+ * correction. Never move it to track the server.
51
+ */
52
+ export declare const PACKAGE_VERSION = "31.0.1";
36
53
  export declare const DEFAULT_URL = "https://mcp.battlegrid.trade/mcp";
37
54
  export interface EnvConfig {
38
55
  apiKeys: string[];
@@ -65,13 +82,34 @@ export interface ToolDefinition {
65
82
  * required fields, bounds) are preserved by reference, never rewritten.
66
83
  */
67
84
  export declare function injectAccountParam(tools: ToolDefinition[], accountNames: string[]): ToolDefinition[];
85
+ /**
86
+ * The identity the local stdio server announces downstream: the upstream server's own, relayed
87
+ * verbatim from the handshake that just completed.
88
+ *
89
+ * WHY RELAY RATHER THAN DECLARE. A local client reads this handshake as a statement about the
90
+ * contract it is about to call. Announcing a constant compiled into this package makes that
91
+ * statement on the server's behalf and then depends on a human keeping the two in step — which is
92
+ * how the package sat at `11.0.0` against a deployed contract of `19.3.0` for ten days, how `5.1.0`
93
+ * came to be declared in this repository and absent from the registry, and why four of the last five
94
+ * releases were version bumps carrying no code change at all. Reading the number off the connection
95
+ * that will actually serve the calls makes the pairing true by construction, on every connection,
96
+ * with no release involved.
97
+ *
98
+ * VERBATIM, NOT RECONSTRUCTED. `Implementation` also carries optional display metadata (`title`,
99
+ * `websiteUrl`, `icons`, …). Passing the object through means a field the server adds later reaches
100
+ * local clients without an edit here — the same reason the tool catalog is never enumerated.
101
+ *
102
+ * FAILS CLOSED. `serverInfo` is required in a successful MCP `initialize` result, so a connected
103
+ * client holding none is a protocol violation rather than a case to design around. Falling back to
104
+ * PACKAGE_VERSION here would reintroduce the exact fiction this function exists to remove, and would
105
+ * do it silently, at the one moment the truth was unavailable.
106
+ */
107
+ export declare function announcedIdentityOf(serverInfo: Implementation | undefined): Implementation;
68
108
  export interface CreateProxyServerOptions {
69
109
  /** Discovered account identities (index 0 is the primary key used for capability discovery). */
70
110
  identities: AccountIdentity[];
71
111
  /** Connect (or reuse) a remote MCP client for a given API key. Called once per key, lazily. */
72
112
  connect: (apiKey: string) => Promise<Client>;
73
- /** Advertised server version; defaults to VERSION. */
74
- version?: string;
75
113
  }
76
114
  export interface ProxyServer {
77
115
  server: Server;
@@ -80,6 +118,8 @@ export interface ProxyServer {
80
118
  resourceCount: number;
81
119
  isMultiAccount: boolean;
82
120
  accountNames: string[];
121
+ /** The upstream identity relayed downstream — the contract a local client will actually reach. */
122
+ announced: Implementation;
83
123
  }
84
124
  /**
85
125
  * Build the local stdio-facing MCP server that proxies to the remote BattleGrid
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAWnE,eAAO,MAAM,OAAO,WAAW,CAAC;AAChC,eAAO,MAAM,WAAW,qCAAqC,CAAC;AAM9D,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAID,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CA+B9E;AAID,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EAAE,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,eAAe,EAAE,CAAC,CA6C5B;AA6DD,MAAM,WAAW,cAAc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F;IAC/F,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,kGAAkG;IAClG,SAAS,EAAE,cAAc,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,WAAW,CAAC,CAmI/F"}
package/dist/index.js CHANGED
@@ -19,6 +19,11 @@
19
19
  * the nested request — the server owns every required field, bound, union
20
20
  * discriminator, and `additionalProperties:false` constraint.
21
21
  *
22
+ * Versions (two of them, describing two different things):
23
+ * - PACKAGE_VERSION — this proxy's own code. Sent UPSTREAM as the client identity.
24
+ * - the announced contract — read from the upstream handshake at connect time and relayed
25
+ * DOWNSTREAM verbatim. Never a constant compiled into this package. See `announcedIdentityOf`.
26
+ *
22
27
  * Architecture: Matches Stripe's @stripe/mcp pattern — thin authenticated proxy.
23
28
  *
24
29
  * Usage:
@@ -36,7 +41,18 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
36
41
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
37
42
  import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
38
43
  import { ListToolsRequestSchema, CallToolRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
39
- export const VERSION = '30.0.0';
44
+ /**
45
+ * This package's own version — the proxy's code, and nothing else.
46
+ *
47
+ * It deliberately does NOT describe the server's wire contract. That number is read from the
48
+ * upstream handshake on every connection and relayed downstream (`announcedIdentityOf`), so the two
49
+ * cannot drift: there is no second place to update and no release needed when the contract moves.
50
+ *
51
+ * Sent upstream as the CLIENT identity, where "which proxy build is calling" is exactly the question
52
+ * being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
53
+ * correction. Never move it to track the server.
54
+ */
55
+ export const PACKAGE_VERSION = '31.0.1';
40
56
  export const DEFAULT_URL = 'https://mcp.battlegrid.trade/mcp';
41
57
  const MAX_RETRIES = 3;
42
58
  const RETRY_DELAYS_MS = [2000, 4000, 8000];
@@ -174,6 +190,37 @@ export function injectAccountParam(tools, accountNames) {
174
190
  },
175
191
  }));
176
192
  }
193
+ // --- Announced identity (exported for testing) ---
194
+ /**
195
+ * The identity the local stdio server announces downstream: the upstream server's own, relayed
196
+ * verbatim from the handshake that just completed.
197
+ *
198
+ * WHY RELAY RATHER THAN DECLARE. A local client reads this handshake as a statement about the
199
+ * contract it is about to call. Announcing a constant compiled into this package makes that
200
+ * statement on the server's behalf and then depends on a human keeping the two in step — which is
201
+ * how the package sat at `11.0.0` against a deployed contract of `19.3.0` for ten days, how `5.1.0`
202
+ * came to be declared in this repository and absent from the registry, and why four of the last five
203
+ * releases were version bumps carrying no code change at all. Reading the number off the connection
204
+ * that will actually serve the calls makes the pairing true by construction, on every connection,
205
+ * with no release involved.
206
+ *
207
+ * VERBATIM, NOT RECONSTRUCTED. `Implementation` also carries optional display metadata (`title`,
208
+ * `websiteUrl`, `icons`, …). Passing the object through means a field the server adds later reaches
209
+ * local clients without an edit here — the same reason the tool catalog is never enumerated.
210
+ *
211
+ * FAILS CLOSED. `serverInfo` is required in a successful MCP `initialize` result, so a connected
212
+ * client holding none is a protocol violation rather than a case to design around. Falling back to
213
+ * PACKAGE_VERSION here would reintroduce the exact fiction this function exists to remove, and would
214
+ * do it silently, at the one moment the truth was unavailable.
215
+ */
216
+ export function announcedIdentityOf(serverInfo) {
217
+ if (serverInfo === undefined) {
218
+ throw new Error('Upstream MCP server completed initialize without announcing serverInfo, so there is no ' +
219
+ 'contract version to relay to local clients. This is a protocol violation by the server — ' +
220
+ 'not a configuration problem, and not something this proxy will substitute a guess for.');
221
+ }
222
+ return serverInfo;
223
+ }
177
224
  /**
178
225
  * Build the local stdio-facing MCP server that proxies to the remote BattleGrid
179
226
  * server. Discovers remote capabilities through the primary client, augments
@@ -182,7 +229,6 @@ export function injectAccountParam(tools, accountNames) {
182
229
  */
183
230
  export async function createProxyServer(options) {
184
231
  const { identities, connect } = options;
185
- const version = options.version ?? VERSION;
186
232
  const isMultiAccount = identities.length > 1;
187
233
  const accountNames = identities.map(id => id.username);
188
234
  // Build lookup: username → apiKey
@@ -193,6 +239,9 @@ export async function createProxyServer(options) {
193
239
  // Primary client (first key) is used for capability discovery and non-tool proxying.
194
240
  const primaryKey = identities[0].apiKey;
195
241
  const primaryClient = await connect(primaryKey);
242
+ // What this proxy announces downstream is what the upstream just announced to it — read here,
243
+ // from the completed handshake, so it can never be a stale constant.
244
+ const announced = announcedIdentityOf(primaryClient.getServerVersion());
196
245
  // Discover remote capabilities
197
246
  const [toolsResult, promptsResult, resourcesResult] = await Promise.all([
198
247
  primaryClient.listTools(),
@@ -203,8 +252,8 @@ export async function createProxyServer(options) {
203
252
  const exposedTools = isMultiAccount
204
253
  ? injectAccountParam(toolsResult.tools, accountNames)
205
254
  : toolsResult.tools;
206
- // Create local stdio server
207
- const localServer = new Server({ name: 'battlegrid', version }, {
255
+ // Create local stdio server, announcing the upstream's identity rather than one of our own.
256
+ const localServer = new Server(announced, {
208
257
  capabilities: {
209
258
  tools: {},
210
259
  prompts: {},
@@ -284,6 +333,7 @@ export async function createProxyServer(options) {
284
333
  resourceCount: resourcesResult.resources.length,
285
334
  isMultiAccount,
286
335
  accountNames,
336
+ announced,
287
337
  };
288
338
  }
289
339
  // --- Main ---
@@ -315,7 +365,8 @@ async function main() {
315
365
  // Lazily connect a remote MCP client per API key, with retry + auth diagnostics.
316
366
  const connect = async (apiKey) => {
317
367
  const transport = new StreamableHTTPClientTransport(new URL(config.apiUrl), { requestInit: { headers: { Authorization: `Bearer ${apiKey}` } } });
318
- const client = new Client({ name: 'battlegrid-proxy', version: VERSION }, { capabilities: {} });
368
+ // Upstream is told which proxy build is calling — the one question PACKAGE_VERSION answers.
369
+ const client = new Client({ name: 'battlegrid-proxy', version: PACKAGE_VERSION }, { capabilities: {} });
319
370
  await connectWithRetry(client, transport, config.apiUrl);
320
371
  return client;
321
372
  };
@@ -327,6 +378,11 @@ async function main() {
327
378
  process.stderr.write(`Error: ${error instanceof Error ? error.message : String(error)}\n`);
328
379
  process.exit(1);
329
380
  }
381
+ // Both numbers, labelled. They describe different things and are EXPECTED to differ — printing
382
+ // only one leaves an operator to guess which, and printing neither is how the last drift went
383
+ // unnoticed for ten days.
384
+ process.stderr.write(`BattleGrid MCP: announcing ${proxy.announced.name}@${proxy.announced.version} ` +
385
+ `(server contract, read from the upstream handshake) — proxy ${PACKAGE_VERSION}\n`);
330
386
  process.stderr.write(`BattleGrid MCP: ${proxy.toolCount} tools, ${proxy.promptCount} prompts, ${proxy.resourceCount} resources\n`);
331
387
  // --- Start stdio transport ---
332
388
  const stdioTransport = new StdioServerTransport();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,oCAA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AI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,KAAK,IAAI,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@battlegrid/mcp-server",
3
- "version": "30.0.0",
3
+ "version": "31.0.1",
4
4
  "description": "BattleGrid MCP server — play crypto prediction games from AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",