From f66a55b5f4eb7ce0f8b3885633bf9a7b1080e0b5 Mon Sep 17 00:00:00 2001 From: Matt <77928207+mattzcarey@users.noreply.github.com> Date: Tue, 20 Jan 2026 11:56:17 +0100 Subject: [PATCH] Revert "fix(server): application/json header for notifictions" (#1388) --- .changeset/{strong-hairs-study.md => heavy-walls-swim.md} | 2 +- packages/middleware/node/test/streamableHttp.test.ts | 1 - packages/server/src/server/streamableHttp.ts | 7 +------ 3 files changed, 2 insertions(+), 8 deletions(-) rename .changeset/{strong-hairs-study.md => heavy-walls-swim.md} (50%) diff --git a/.changeset/strong-hairs-study.md b/.changeset/heavy-walls-swim.md similarity index 50% rename from .changeset/strong-hairs-study.md rename to .changeset/heavy-walls-swim.md index 9addb05e..7a09cda0 100644 --- a/.changeset/strong-hairs-study.md +++ b/.changeset/heavy-walls-swim.md @@ -2,4 +2,4 @@ '@modelcontextprotocol/server': patch --- -add application/json header for notifications +reverting application/json in notifications diff --git a/packages/middleware/node/test/streamableHttp.test.ts b/packages/middleware/node/test/streamableHttp.test.ts index 5f865ef4..3cc07e8c 100644 --- a/packages/middleware/node/test/streamableHttp.test.ts +++ b/packages/middleware/node/test/streamableHttp.test.ts @@ -657,7 +657,6 @@ describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => { const response = await sendPostRequest(baseUrl, batchNotifications, sessionId); expect(response.status).toBe(202); - expect(response.headers.get('content-type')).toBe('application/json'); }); it('should handle batch request messages with SSE stream for responses', async () => { diff --git a/packages/server/src/server/streamableHttp.ts b/packages/server/src/server/streamableHttp.ts index 19360310..decd862f 100644 --- a/packages/server/src/server/streamableHttp.ts +++ b/packages/server/src/server/streamableHttp.ts @@ -667,12 +667,7 @@ export class WebStandardStreamableHTTPServerTransport implements Transport { for (const message of messages) { this.onmessage?.(message, { authInfo: options?.authInfo, requestInfo }); } - return new Response(null, { - status: 202, - headers: { - 'Content-Type': 'application/json' - } - }); + return new Response(null, { status: 202 }); } // The default behavior is to use SSE streaming