Skip to content
Merged
8 changes: 7 additions & 1 deletion mocks/mcp-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,13 @@ export function createMcpApp(options: MockMcpServerOptions): HonoApp {

const transport = new StreamableHTTPTransport();
await mcp.connect(transport);
return transport.handleRequest(c);
const response = await transport.handleRequest(c);
// @hono/mcp accepts a notification with a JSON `null` body. The spec, and the real
// endpoint, send none, and under MSW the client's cancel of that body never settles.
if (response?.status === 202) {
return new Response(null, { status: 202 });
}
return response;
});

return app;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"publishConfig": {
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json"
}
Expand Down
Loading
Loading