@battlegrid/mcp-server 31.1.5 → 31.2.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
@@ -24,7 +24,7 @@ Seeing package `31.x` alongside handshake `battlegrid@33.x` — the package **be
24
24
 
25
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.
26
26
 
27
- ## Contract history — v37 → v48.1
27
+ ## Contract history — v37 → v49.3
28
28
 
29
29
  Eleven majors reached authors while this section stopped at v36. That gap is the mechanism, not an
30
30
  oversight: since v31 a contract move needs no release here, so nothing forced a note to be written —
@@ -32,6 +32,27 @@ and the documentation ships inside the tarball, so a note written but unpublishe
32
32
  Both halves are now closed by a rule keyed to the *served* contract rather than to a release of this
33
33
  package.
34
34
 
35
+ ### Accepted again — input that was rejected now compiles
36
+
37
+ Nothing to migrate. This is the one direction that cannot break a client: a body the server used to
38
+ refuse is now stored. Listed because a client that special-cased the refusal can delete that branch.
39
+
40
+ - **An arming trigger no longer constrains its required conditions' clock** (49.2.0,
41
+ `restore-arming-trigger-authoring`). `compile_strategy_plan`, `apply_strategy_plan` and
42
+ `fork_strategy` accept a strategy whose entry trigger is `ON_CANDLE_CLOSE`, `STOP_THROUGH_LEVEL`
43
+ or `ON_RETEST` **while a required condition reads the `LIVE` clock**. v48.1 announced that pairing
44
+ as rejected, naming the offending condition key on `VALIDATION_ERROR`; that refusal is gone.
45
+
46
+ Why it was withdrawn, since the reasoning matters more than the rule: it ran against the whole
47
+ assembled strategy, so it refused *every* edit to a strategy in that shape — a rename, one report
48
+ column, one signal weight — plus restore and fork. For a strategy whose required conditions read
49
+ columns that can never carry a `CLOSE` clock (zone distances, perp/spot flow), there was no legal
50
+ shape to move to at all. And its premise — that the pairing can never fire — was measured before
51
+ the arming lifecycle was corrected, and no longer holds.
52
+
53
+ The underlying question, *should an entry that waits for a close be decided on a forming bar*, is
54
+ now settled where the decision is made rather than by refusing the author's declaration.
55
+
35
56
  ### Changed meaning, unchanged shape
36
57
 
37
58
  - **Three tools serve different values for identical input** (47.3.0, `derive-scan-fetch-from-report`).
@@ -158,6 +179,23 @@ package.
158
179
 
159
180
  ### Reshaped output — the same call returns a different shape
160
181
 
182
+ - **An entry void now names the gate that refused it** (49.3.0,
183
+ `fix-arming-trigger-clock-authority`), on `get_radar_activity_summary`. In the cause rollup, the
184
+ `ENTRY_VOID` group's `gateCode` widens from always-`null` to `QualificationGateCode | null`: a
185
+ conditions-side void carries the gate that blocked — `AGGREGATE_BELOW_MIN`,
186
+ `REQUIRED_COUNT_BELOW_MIN`, `REQUIRED_CONDITION_FALSE` — while a band void stays `null`, because
187
+ that void happens on a reading that qualified and has no failing gate to name.
188
+
189
+ A client that renders the field through the same enum the response already uses on four other
190
+ cause arms needs no change. One that treated it as a literal `null` — a strict decoder pinning the
191
+ type, or a branch keyed to its absence — sees a value it did not expect. That is the whole
192
+ migration.
193
+
194
+ Why it moved: the group previously collapsed every conditions-side void under one label. The
195
+ first 26 in production carried that label while two different gates had produced them, and none of
196
+ them was a required condition being false. The rollup ships counts rather than rows, so the gate
197
+ could not be recovered client-side.
198
+
161
199
  - **The normalized report section loses `timeframe`** (48.0.0, `remove-section-anchor-override`), on
162
200
  every tool that publishes a strategy: `get_strategy`, `fork_strategy`, `archive_strategy`,
163
201
  `restore_strategy`, `update_strategy_signal_rule`, `apply_strategy_plan`, and
@@ -705,7 +743,7 @@ Tools, prompts, and resources are **discovered live** from the connected server
705
743
 
706
744
  - **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).
707
745
  - **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.
708
- - **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.
746
+ - **Rediscover after a server cutover.** The proxy resolves its catalog on first use and then caches it for the life of the process; a resolution that *failed* is retried on the next request, but a server deploy is never noticed. Package publication does not refresh it either. Restart/reconnect the proxy and re-run `tools/list`, `prompts/list`, and `resources/list` after the server deploys.
709
747
  - **Restart after key rotation.** API keys are read once at process startup; rotate a key, then restart the proxy.
710
748
 
711
749
  | Version | Changes |
@@ -798,7 +836,7 @@ Also confirm npm's Trusted Publisher for `@battlegrid/mcp-server` is GitHub Acti
798
836
 
799
837
  Two things do still need doing, neither of them a release:
800
838
 
801
- - **Reconnect** to pick up the new contract — the announcement and the capability snapshot are both read once at startup (see [Rediscovery & versioning](#rediscovery--versioning)).
839
+ - **Reconnect** to pick up the new contract — the announcement is read once from the handshake at startup, and the capability snapshot is resolved on first use and cached thereafter (see [Rediscovery & versioning](#rediscovery--versioning)).
802
840
  - **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.
803
841
 
804
842
  ### Verify publication
package/dist/index.d.ts CHANGED
@@ -37,7 +37,7 @@
37
37
  */
38
38
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
39
39
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
40
- import { type Implementation } from '@modelcontextprotocol/sdk/types.js';
40
+ import { type Implementation, type Prompt, type Resource } from '@modelcontextprotocol/sdk/types.js';
41
41
  /**
42
42
  * This package's own version — the proxy's code, and nothing else.
43
43
  *
@@ -49,7 +49,7 @@ import { type Implementation } from '@modelcontextprotocol/sdk/types.js';
49
49
  * being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
50
50
  * correction. Never move it to track the server.
51
51
  */
52
- export declare const PACKAGE_VERSION = "31.1.5";
52
+ export declare const PACKAGE_VERSION = "31.2.1";
53
53
  export declare const DEFAULT_URL = "https://mcp.battlegrid.trade/mcp";
54
54
  export interface EnvConfig {
55
55
  apiKeys: string[];
@@ -106,26 +106,73 @@ export declare function injectAccountParam(tools: ToolDefinition[], accountNames
106
106
  */
107
107
  export declare function announcedIdentityOf(serverInfo: Implementation | undefined): Implementation;
108
108
  export interface CreateProxyServerOptions {
109
- /** Discovered account identities (index 0 is the primary key used for capability discovery). */
110
- identities: AccountIdentity[];
111
- /** Connect (or reuse) a remote MCP client for a given API key. Called once per key, lazily. */
109
+ /**
110
+ * The operator's FIRST configured key — used for the announcing handshake, the prompt and
111
+ * resource surfaces, and single-account routing. Deliberately not derived from whichever
112
+ * identity lookups happened to succeed: that made a mistyped first key silently promote the
113
+ * second, relocating every unqualified call to a different account.
114
+ */
115
+ primaryKey: string;
116
+ /**
117
+ * Whether a tool call must name an account. Derived from the CONFIGURED key count, so the guard
118
+ * is armed before any network call. Deriving it from resolved identities would let a transient
119
+ * identity failure convert a multi-account proxy into a single-account one and route an
120
+ * unqualified money-moving call to the primary.
121
+ */
122
+ isMultiAccount: boolean;
123
+ /** Connect (or reuse) a remote MCP client for a given API key. */
112
124
  connect: (apiKey: string) => Promise<Client>;
125
+ /** Resolve account identities. Awaited lazily, on the first request that needs the catalog. */
126
+ resolveIdentities: () => Promise<AccountIdentity[]>;
113
127
  }
114
- export interface ProxyServer {
115
- server: Server;
128
+ /**
129
+ * Everything the catalog resolution produces, resolved together as one shared value.
130
+ *
131
+ * The account selector published on every tool schema and the membership check applied to an
132
+ * incoming call are one rule at two altitudes, so `accountNames` and `keyByAccount` are members
133
+ * here rather than re-derived at each handler.
134
+ */
135
+ export interface ProxyCatalog {
136
+ identities: AccountIdentity[];
137
+ accountNames: string[];
138
+ keyByAccount: Map<string, string>;
139
+ tools: ToolDefinition[];
140
+ prompts: Prompt[];
141
+ resources: Resource[];
142
+ }
143
+ /**
144
+ * What a completed warm-up reports back to `main()`, which owns every startup diagnostic.
145
+ *
146
+ * Carries `accountNames` as well as the counts because the account-roster line is the only surface
147
+ * naming which accounts actually resolved — the signal a dangling primary or a silent single-account
148
+ * collapse would otherwise hide.
149
+ */
150
+ export interface WarmSummary {
151
+ accountNames: string[];
116
152
  toolCount: number;
117
153
  promptCount: number;
118
154
  resourceCount: number;
119
- isMultiAccount: boolean;
120
- accountNames: string[];
155
+ }
156
+ export interface ProxyServer {
157
+ server: Server;
121
158
  /** The upstream identity relayed downstream — the contract a local client will actually reach. */
122
159
  announced: Implementation;
160
+ /**
161
+ * Resolve the catalog, returning its counts. Returns the SAME memoized resolution a request
162
+ * triggers — it starts nothing of its own, so warm-up and a first request never resolve twice.
163
+ */
164
+ warm: () => Promise<WarmSummary>;
123
165
  }
124
166
  /**
125
- * Build the local stdio-facing MCP server that proxies to the remote BattleGrid
126
- * server. Discovers remote capabilities through the primary client, augments
127
- * tools with the `account` enum when multiple accounts resolved, and wires
128
- * strip-only-account routing to a lazily-populated per-key client pool.
167
+ * Build the local stdio-facing MCP server that proxies to the remote BattleGrid server.
168
+ *
169
+ * ORDERING IS THE POINT. Exactly one upstream operation happens here: the handshake that yields the
170
+ * identity this proxy relays. `serverInfo` is captured by the SDK at `Server` construction and read
171
+ * when `initialize` is answered, with no setter, so relaying the upstream's identity verbatim makes
172
+ * one round trip inherent. Everything else — identity discovery and the three catalog calls —
173
+ * resolves lazily, after the caller has bound the transport, because none of it is needed to answer
174
+ * `initialize` and every unit of work placed ahead of the bind is paid by every client on every
175
+ * start.
129
176
  */
130
177
  export declare function createProxyServer(options: CreateProxyServerOptions): Promise<ProxyServer>;
131
178
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file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AMG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,kGAAkG;IAClG,SAAS,EAAE,cAAc,CAAC;IAC1B;;;OAGG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;CAClC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,WAAW,CAAC,CAwO/F"}
package/dist/index.js CHANGED
@@ -52,10 +52,16 @@ import { ListToolsRequestSchema, CallToolRequestSchema, ListPromptsRequestSchema
52
52
  * being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
53
53
  * correction. Never move it to track the server.
54
54
  */
55
- export const PACKAGE_VERSION = '31.1.5';
55
+ export const PACKAGE_VERSION = '31.2.1';
56
56
  export const DEFAULT_URL = 'https://mcp.battlegrid.trade/mcp';
57
57
  const MAX_RETRIES = 3;
58
58
  const RETRY_DELAYS_MS = [2000, 4000, 8000];
59
+ // One rule, two expressions. Asserted here so the delay table genuinely bounds the attempt count,
60
+ // which is what lets connectWithRetry index it without a fallback.
61
+ if (RETRY_DELAYS_MS.length !== MAX_RETRIES) {
62
+ throw new Error(`Retry budget disagrees with itself: MAX_RETRIES=${MAX_RETRIES} but RETRY_DELAYS_MS carries ` +
63
+ `${RETRY_DELAYS_MS.length} delays. Reconcile them at their declaration.`);
64
+ }
59
65
  // --- Environment validation (exported for testing) ---
60
66
  export function validateEnv(env) {
61
67
  const apiUrl = env.BATTLEGRID_API_URL || DEFAULT_URL;
@@ -133,7 +139,8 @@ function isAuthError(error) {
133
139
  function sleep(ms) {
134
140
  return new Promise((resolve) => setTimeout(resolve, ms));
135
141
  }
136
- async function connectWithRetry(client, transport, apiUrl) {
142
+ async function connectWithRetry(client, transport, apiUrl, apiKey) {
143
+ const keyPrefix = apiKey.substring(0, 12);
137
144
  for (let attempt = 0; attempt <= MAX_RETRIES; attempt++) {
138
145
  try {
139
146
  await client.connect(transport);
@@ -146,7 +153,7 @@ async function connectWithRetry(client, transport, apiUrl) {
146
153
  : undefined;
147
154
  const errorMessage = error instanceof Error ? error.message : String(error);
148
155
  if (isAuthError(error)) {
149
- throw new Error(`Authentication failed (HTTP ${errorCode ?? 'unknown'}): ${errorMessage}\n` +
156
+ throw new Error(`Authentication failed for key ${keyPrefix} (HTTP ${errorCode ?? 'unknown'}): ${errorMessage}\n` +
150
157
  'This means the server rejected your API key. Possible causes:\n' +
151
158
  ' 1. Key was revoked (a new key invalidates all previous keys)\n' +
152
159
  ' 2. Key was corrupted during copy-paste\n' +
@@ -154,12 +161,13 @@ async function connectWithRetry(client, transport, apiUrl) {
154
161
  'Create a new key at: https://battlegrid.trade → Profile → MCP tab');
155
162
  }
156
163
  if (attempt === MAX_RETRIES) {
157
- throw new Error(`Cannot connect to BattleGrid server at ${apiUrl} after ${MAX_RETRIES + 1} attempts.\n` +
164
+ throw new Error(`Cannot connect to BattleGrid server at ${apiUrl} with key ${keyPrefix} after ` +
165
+ `${MAX_RETRIES + 1} attempts.\n` +
158
166
  `Last error: ${errorMessage}\n` +
159
167
  `Check your internet connection or verify the server is running.\n` +
160
168
  `Health check: ${apiUrl.replace('/mcp', '')}/health`);
161
169
  }
162
- const delay = RETRY_DELAYS_MS[attempt] ?? 8000;
170
+ const delay = RETRY_DELAYS_MS[attempt];
163
171
  process.stderr.write(`Connection attempt ${attempt + 1} failed (${errorMessage}), retrying in ${delay / 1000}s...\n`);
164
172
  await sleep(delay);
165
173
  }
@@ -222,64 +230,153 @@ export function announcedIdentityOf(serverInfo) {
222
230
  return serverInfo;
223
231
  }
224
232
  /**
225
- * Build the local stdio-facing MCP server that proxies to the remote BattleGrid
226
- * server. Discovers remote capabilities through the primary client, augments
227
- * tools with the `account` enum when multiple accounts resolved, and wires
228
- * strip-only-account routing to a lazily-populated per-key client pool.
233
+ * Build the local stdio-facing MCP server that proxies to the remote BattleGrid server.
234
+ *
235
+ * ORDERING IS THE POINT. Exactly one upstream operation happens here: the handshake that yields the
236
+ * identity this proxy relays. `serverInfo` is captured by the SDK at `Server` construction and read
237
+ * when `initialize` is answered, with no setter, so relaying the upstream's identity verbatim makes
238
+ * one round trip inherent. Everything else — identity discovery and the three catalog calls —
239
+ * resolves lazily, after the caller has bound the transport, because none of it is needed to answer
240
+ * `initialize` and every unit of work placed ahead of the bind is paid by every client on every
241
+ * start.
229
242
  */
230
243
  export async function createProxyServer(options) {
231
- const { identities, connect } = options;
232
- const isMultiAccount = identities.length > 1;
233
- const accountNames = identities.map(id => id.username);
234
- // Build lookup: username → apiKey
235
- const keyByAccount = new Map();
236
- for (const id of identities) {
237
- keyByAccount.set(id.username, id.apiKey);
238
- }
239
- // Primary client (first key) is used for capability discovery and non-tool proxying.
240
- const primaryKey = identities[0].apiKey;
244
+ const { primaryKey, isMultiAccount, connect, resolveIdentities } = options;
245
+ // The one retained pre-bind round trip.
241
246
  const primaryClient = await connect(primaryKey);
242
247
  // What this proxy announces downstream is what the upstream just announced to it — read here,
243
248
  // from the completed handshake, so it can never be a stale constant.
244
249
  const announced = announcedIdentityOf(primaryClient.getServerVersion());
245
- // Discover remote capabilities
246
- const [toolsResult, promptsResult, resourcesResult] = await Promise.all([
247
- primaryClient.listTools(),
248
- primaryClient.listPrompts(),
249
- primaryClient.listResources(),
250
- ]);
251
- // Augment tools with account parameter if multi-account
252
- const exposedTools = isMultiAccount
253
- ? injectAccountParam(toolsResult.tools, accountNames)
254
- : toolsResult.tools;
255
- // Create local stdio server, announcing the upstream's identity rather than one of our own.
250
+ // `listChanged` is declared HERE and can never be added later: registerCapabilities throws once a
251
+ // transport is connected, and a client only registers list-changed handlers for capabilities the
252
+ // server advertised. Without it, a client whose first tools/list failed holds an empty catalog for
253
+ // the life of the process — the symptom this lazy catalog exists to remove, made silent.
256
254
  const localServer = new Server(announced, {
257
255
  capabilities: {
258
- tools: {},
259
- prompts: {},
260
- resources: {},
256
+ tools: { listChanged: true },
257
+ prompts: { listChanged: true },
258
+ resources: { listChanged: true },
261
259
  },
262
260
  });
263
- // Keep a pool of remote clients keyed by API key for routing
261
+ // Pool of PROMISES, not clients: concurrent callers for one key share one in-flight connect
262
+ // rather than each building a transport that is never closed. A rejection is removed so the next
263
+ // caller retries.
264
264
  const clientPool = new Map();
265
- clientPool.set(primaryKey, primaryClient);
266
- async function getClientForKey(apiKey) {
265
+ clientPool.set(primaryKey, Promise.resolve(primaryClient));
266
+ function getClientForKey(apiKey) {
267
267
  const existing = clientPool.get(apiKey);
268
268
  if (existing)
269
269
  return existing;
270
- const client = await connect(apiKey);
271
- clientPool.set(apiKey, client);
272
- return client;
270
+ const pending = connect(apiKey);
271
+ clientPool.set(apiKey, pending);
272
+ pending.catch(() => {
273
+ if (clientPool.get(apiKey) === pending)
274
+ clientPool.delete(apiKey);
275
+ });
276
+ return pending;
277
+ }
278
+ let catalogMemo = null;
279
+ let servedCatalogError = false;
280
+ async function announceListsChanged() {
281
+ try {
282
+ await Promise.all([
283
+ localServer.sendToolListChanged(),
284
+ localServer.sendPromptListChanged(),
285
+ localServer.sendResourceListChanged(),
286
+ ]);
287
+ }
288
+ catch (error) {
289
+ const message = error instanceof Error ? error.message : String(error);
290
+ process.stderr.write(`Warning: could not notify client that the catalog recovered: ${message}\n`);
291
+ }
292
+ }
293
+ async function buildCatalog() {
294
+ const identities = await resolveIdentities();
295
+ // The declared primary must be in the resolved roster. Identity discovery is a single unretried
296
+ // request while the handshake retries three times, so a primary can complete the handshake and
297
+ // still be missing here — which would serve prompts and resources as an account that appears in
298
+ // no selector and no log line.
299
+ if (!identities.some((identity) => identity.apiKey === primaryKey)) {
300
+ throw new Error(`Primary key (${primaryKey.substring(0, 12)}) is absent from the resolved account roster, ` +
301
+ 'so every call routed to it would execute as an account this proxy never resolved.');
302
+ }
303
+ const accountNames = identities.map((identity) => identity.username);
304
+ const keyByAccount = new Map();
305
+ for (const identity of identities) {
306
+ if (keyByAccount.has(identity.username)) {
307
+ throw new Error(`Two configured accounts resolved to the display name "${identity.username}", so an ` +
308
+ 'account selection cannot name one of them unambiguously.');
309
+ }
310
+ keyByAccount.set(identity.username, identity.apiKey);
311
+ }
312
+ const [toolsResult, promptsResult, resourcesResult] = await Promise.all([
313
+ primaryClient.listTools(),
314
+ primaryClient.listPrompts(),
315
+ primaryClient.listResources(),
316
+ ]);
317
+ const discovered = toolsResult.tools;
318
+ return {
319
+ identities,
320
+ accountNames,
321
+ keyByAccount,
322
+ tools: isMultiAccount ? injectAccountParam(discovered, accountNames) : discovered,
323
+ prompts: promptsResult.prompts,
324
+ resources: resourcesResult.resources,
325
+ };
326
+ }
327
+ /**
328
+ * The catalog, resolved at most once and shared by every caller.
329
+ *
330
+ * The clear-on-failure is identity-guarded deliberately. The obvious shape — an async IIFE whose
331
+ * inner catch nulls the memo — poisons it permanently when the body throws before its first
332
+ * `await`: that catch runs during the synchronous prefix and the outer assignment then
333
+ * re-installs the rejected promise. Guarding on identity is correct for both timings and also
334
+ * cannot discard a newer resolution another request installed.
335
+ */
336
+ function resolveCatalog() {
337
+ const existing = catalogMemo;
338
+ if (existing)
339
+ return existing;
340
+ const pending = buildCatalog();
341
+ catalogMemo = pending;
342
+ pending.catch(() => {
343
+ if (catalogMemo === pending)
344
+ catalogMemo = null;
345
+ });
346
+ void pending.then(() => {
347
+ if (!servedCatalogError)
348
+ return;
349
+ servedCatalogError = false;
350
+ void announceListsChanged();
351
+ }, () => undefined);
352
+ return pending;
353
+ }
354
+ /** Resolve the catalog, remembering that a failure was served so a later recovery can be announced. */
355
+ async function catalogOrThrow() {
356
+ try {
357
+ return await resolveCatalog();
358
+ }
359
+ catch (error) {
360
+ servedCatalogError = true;
361
+ throw error;
362
+ }
273
363
  }
274
364
  // --- Proxy: tools ---
275
- localServer.setRequestHandler(ListToolsRequestSchema, async () => ({
276
- tools: exposedTools,
277
- }));
365
+ // Throws on rejection: ListToolsResult carries only `tools`, so the tools/call in-band
366
+ // `{content, isError}` shape would ship as a SUCCESSFUL result that fails the client's own parse.
367
+ // The SDK maps a thrown handler error to a proper JSON-RPC error.
368
+ localServer.setRequestHandler(ListToolsRequestSchema, async () => {
369
+ const catalog = await catalogOrThrow();
370
+ return { tools: catalog.tools };
371
+ });
278
372
  localServer.setRequestHandler(CallToolRequestSchema, async (request) => {
279
373
  try {
280
374
  let targetKey = primaryKey;
281
375
  const args = { ...request.params.arguments };
376
+ // Read from the constructor option, never from the catalog: the guard must be armed even
377
+ // while the account set is still unknown.
282
378
  if (isMultiAccount) {
379
+ const { keyByAccount, accountNames } = await catalogOrThrow();
283
380
  const selectedAccount = args.account;
284
381
  if (!selectedAccount || !keyByAccount.has(selectedAccount)) {
285
382
  return {
@@ -308,9 +405,10 @@ export async function createProxyServer(options) {
308
405
  }
309
406
  });
310
407
  // --- Proxy: prompts ---
311
- localServer.setRequestHandler(ListPromptsRequestSchema, async () => ({
312
- prompts: promptsResult.prompts,
313
- }));
408
+ localServer.setRequestHandler(ListPromptsRequestSchema, async () => {
409
+ const catalog = await catalogOrThrow();
410
+ return { prompts: catalog.prompts };
411
+ });
314
412
  localServer.setRequestHandler(GetPromptRequestSchema, async (request) => {
315
413
  return await primaryClient.getPrompt({
316
414
  name: request.params.name,
@@ -318,9 +416,10 @@ export async function createProxyServer(options) {
318
416
  });
319
417
  });
320
418
  // --- Proxy: resources ---
321
- localServer.setRequestHandler(ListResourcesRequestSchema, async () => ({
322
- resources: resourcesResult.resources,
323
- }));
419
+ localServer.setRequestHandler(ListResourcesRequestSchema, async () => {
420
+ const catalog = await catalogOrThrow();
421
+ return { resources: catalog.resources };
422
+ });
324
423
  localServer.setRequestHandler(ReadResourceRequestSchema, async (request) => {
325
424
  return await primaryClient.readResource({
326
425
  uri: request.params.uri,
@@ -328,12 +427,16 @@ export async function createProxyServer(options) {
328
427
  });
329
428
  return {
330
429
  server: localServer,
331
- toolCount: toolsResult.tools.length,
332
- promptCount: promptsResult.prompts.length,
333
- resourceCount: resourcesResult.resources.length,
334
- isMultiAccount,
335
- accountNames,
336
430
  announced,
431
+ warm: async () => {
432
+ const catalog = await resolveCatalog();
433
+ return {
434
+ accountNames: catalog.accountNames,
435
+ toolCount: catalog.tools.length,
436
+ promptCount: catalog.prompts.length,
437
+ resourceCount: catalog.resources.length,
438
+ };
439
+ },
337
440
  };
338
441
  }
339
442
  // --- Main ---
@@ -352,27 +455,25 @@ async function main() {
352
455
  const hashPrefix = createHash('sha256').update(key).digest('hex').substring(0, 16);
353
456
  process.stderr.write(`BattleGrid MCP: Key #${i + 1} prefix=${key.substring(0, 12)} hashPrefix=${hashPrefix} len=${key.length}\n`);
354
457
  }
355
- // Discover identities for all keys
356
- let identities;
357
- try {
358
- identities = await discoverIdentities(config.apiKeys, config.apiUrl);
359
- }
360
- catch (error) {
361
- process.stderr.write(`Error: ${error instanceof Error ? error.message : String(error)}\n`);
362
- process.exit(1);
363
- }
364
- process.stderr.write(`BattleGrid MCP: ${identities.length} account(s) discovered — ${identities.map(id => id.username).join(', ')}\n`);
365
- // Lazily connect a remote MCP client per API key, with retry + auth diagnostics.
458
+ // Connect a remote MCP client for a given API key, with retry + auth diagnostics.
366
459
  const connect = async (apiKey) => {
367
460
  const transport = new StreamableHTTPClientTransport(new URL(config.apiUrl), { requestInit: { headers: { Authorization: `Bearer ${apiKey}` } } });
368
461
  // Upstream is told which proxy build is calling — the one question PACKAGE_VERSION answers.
369
462
  const client = new Client({ name: 'battlegrid-proxy', version: PACKAGE_VERSION }, { capabilities: {} });
370
- await connectWithRetry(client, transport, config.apiUrl);
463
+ await connectWithRetry(client, transport, config.apiUrl, apiKey);
371
464
  return client;
372
465
  };
373
466
  let proxy;
374
467
  try {
375
- proxy = await createProxyServer({ identities, connect });
468
+ proxy = await createProxyServer({
469
+ // The operator's declared first key, chosen before discovery so an unreachable one fails
470
+ // loudly here instead of silently promoting the second.
471
+ primaryKey: config.apiKeys[0],
472
+ // Armed by configuration, so a later identity failure cannot stand the account guard down.
473
+ isMultiAccount: config.apiKeys.length > 1,
474
+ connect,
475
+ resolveIdentities: () => discoverIdentities(config.apiKeys, config.apiUrl),
476
+ });
376
477
  }
377
478
  catch (error) {
378
479
  process.stderr.write(`Error: ${error instanceof Error ? error.message : String(error)}\n`);
@@ -383,11 +484,25 @@ async function main() {
383
484
  // unnoticed for ten days.
384
485
  process.stderr.write(`BattleGrid MCP: announcing ${proxy.announced.name}@${proxy.announced.version} ` +
385
486
  `(server contract, read from the upstream handshake) — proxy ${PACKAGE_VERSION}\n`);
386
- process.stderr.write(`BattleGrid MCP: ${proxy.toolCount} tools, ${proxy.promptCount} prompts, ${proxy.resourceCount} resources\n`);
387
- // --- Start stdio transport ---
487
+ // --- Start stdio transport, BEFORE any catalog work ---
488
+ //
489
+ // Everything above is the single upstream handshake the relayed serverInfo requires. From here the
490
+ // process answers `initialize`; identity discovery and the three catalog calls happen behind it.
388
491
  const stdioTransport = new StdioServerTransport();
389
492
  await proxy.server.connect(stdioTransport);
390
493
  process.stderr.write('BattleGrid MCP server running on stdio\n');
494
+ // Warm the catalog so the first tools/list joins an in-flight resolution rather than starting one.
495
+ // Deliberately NOT awaited, and the rejection handler is the whole of the guarantee that a
496
+ // background failure cannot kill a process that has already answered `initialize`. The failure is
497
+ // reported and absorbed; the next request that needs the catalog retries it.
498
+ void proxy.warm().then((summary) => {
499
+ process.stderr.write(`BattleGrid MCP: ${summary.accountNames.length} account(s) discovered — ${summary.accountNames.join(', ')}\n`);
500
+ process.stderr.write(`BattleGrid MCP: ${summary.toolCount} tools, ${summary.promptCount} prompts, ${summary.resourceCount} resources\n`);
501
+ }, (error) => {
502
+ const message = error instanceof Error ? error.message : String(error);
503
+ process.stderr.write(`Warning: catalog warm-up failed (${message}). The proxy is connected; the next request ` +
504
+ 'that needs the catalog will retry it.\n');
505
+ });
391
506
  }
392
507
  // Only run when executed directly (not when imported for testing)
393
508
  const isDirectExecution = process.argv[1] &&
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;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,GAE1B,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAC9D,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAgB3C,wDAAwD;AAExD,MAAM,UAAU,WAAW,CAAC,GAAuC;IACjE,MAAM,MAAM,GAAG,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC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-1,6 +1,6 @@
1
1
  {
2
2
  "name": "@battlegrid/mcp-server",
3
- "version": "31.1.5",
3
+ "version": "31.2.1",
4
4
  "description": "BattleGrid MCP server — play crypto prediction games from AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",