Revert "fix(server): application/json header for notifictions" (#1388)

This commit is contained in:
Matt 2026-01-20 11:56:17 +01:00 • committed by GitHub
commit f66a55b5f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2 additions and 8 deletions

View file

@ -0,0 +1,5 @@
---
'@modelcontextprotocol/server': patch
---
reverting application/json in notifications

View file

@ -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 () => {

View file

@ -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