(body: string)
| 75 | const decodeJsonString = Schema.decodeUnknownOption(Schema.fromJsonString(Schema.Unknown)); |
| 76 | |
| 77 | const asObject = (body: string): Record<string, unknown> | null => { |
| 78 | if (!body) return null; |
| 79 | const parsed = decodeJsonString(body); |
| 80 | if (Option.isNone(parsed)) return null; |
| 81 | const value = parsed.value; |
| 82 | if (typeof value !== "object" || value === null || Array.isArray(value)) return null; |
| 83 | return value as Record<string, unknown>; |
| 84 | }; |
| 85 | |
| 86 | /** Quick check that a body parses as a JSON-RPC 2.0 envelope. The MCP wire |
| 87 | * protocol is JSON-RPC 2.0, so a real MCP server's response to `initialize` |
no outgoing calls
no test coverage detected