fix(mcp): carry requestIdFormat through MCP config discovery

The option was only present on the transport-facing `MCPServerConfig`, so a
value written in `.omp/mcp.json` or a standalone `.mcp.json` never reached the
transports: discovery normalizes config into the canonical `MCPServer` shape and
`convertToLegacyConfig()` rebuilds the transport config from it, and neither step
knew about the field. Setting `"number"` in the documented config path silently
kept the snowflake-string default, which is the hang the option exists to avoid.

Wire it through the same four places `timeout` already uses: the canonical
`MCPServer` shape, the two OMP-native loaders (with validate-and-warn on an
unrecognized value), and the legacy conversion. Foreign-format providers are
untouched, since the key is OMP-specific.

Also point the `MCPServerConfigBase` doc comment at `RequestIdAllocator` rather
than a helper name that never existed.
This commit is contained in:
Jérémy Marchand
2026-07-31 21:03:06 +02:00
parent fa9aa68218
commit 3cb6e5df9c
6 changed files with 113 additions and 1 deletions
@@ -4,6 +4,8 @@
* Canonical shape for MCP server configurations, regardless of source format.
* All providers translate their native format to this shape.
*/
import type { MCPRequestIdFormat } from "../mcp/types";
import { defineCapability } from ".";
import type { SourceMeta } from "./types";
@@ -17,6 +19,8 @@ export interface MCPServer {
enabled?: boolean;
/** Connection timeout in milliseconds */
timeout?: number;
/** Encoding for outgoing JSON-RPC request ids (default: `"string"`) */
requestIdFormat?: MCPRequestIdFormat;
/** Command to run (for stdio transport) */
command?: string;
/** Command arguments */