(lookup: "not-found" | "forbidden")
| 192 | |
| 193 | /** Render a non-`Response` {@link McpDispatchResult} discriminant. */ |
| 194 | const renderDispatchError = (lookup: "not-found" | "forbidden"): Response => |
| 195 | lookup === "not-found" |
| 196 | ? jsonRpcResponse(404, -32001, "Session not found") |
| 197 | : jsonRpcResponse(403, -32003, "MCP session does not belong to the current bearer"); |
| 198 | |
| 199 | /** Dispatch an MCP request through authenticate -> store.dispatch -> transport. */ |
| 200 | const mcpDispatch = (resource: McpResource) => |
no test coverage detected