(body: string)
| 103 | const decodeJsonString = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown)); |
| 104 | |
| 105 | const asObject = (body: string): Record<string, unknown> | null => { |
| 106 | if (!body) return null; |
| 107 | const parsed = decodeJsonString(body); |
| 108 | if (Option.isNone(parsed)) return null; |
| 109 | const value = parsed.value; |
| 110 | if (typeof value !== "object" || value === null || Array.isArray(value)) return null; |
| 111 | return value as Record<string, unknown>; |
| 112 | }; |
| 113 | |
| 114 | /** Quick check that a body parses as a JSON-RPC 2.0 envelope. The MCP wire |
| 115 | * protocol is JSON-RPC 2.0, so a real MCP server's response to `initialize` |
no outgoing calls
no test coverage detected