Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Legacy SSE GET drops headers set by hooks (CORS, security headers)

Open Beginner friendly
#335 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@mcollina is already working on this.

Since Oct 19, 2026.

  • #349 by @mcollina — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Read the legacy SSE GET /mcp handler and compare its hijacked response with request-stream.ts and subscriptions.ts, which already copy reply headers. Reproduce with an onRequest hook that sets the two CORS headers, then check the normal and error paths. Done when both paths preserve hook headers and the repro confirms the SSE response includes them.

Written by the indexing model from the issue text.

Description

Summary

The legacy SSE GET /mcp response leaves out headers that hooks set on the reply, such as CORS and security headers. A cross-origin browser client therefore cannot open the stream or read Mcp-Session-Id.

Cause

The handler calls reply.hijack() and then raw.writeHead(200) without copying reply.getHeaders(). The 2026-07-28 streams copy them (request-stream.ts, subscriptions.ts).

Repro

Add an onRequest hook that sets access-control-allow-origin and access-control-expose-headers.

  • POST keeps both headers.
  • The SSE GET returns 200 with neither.

Suggested fix

Read reply.getHeaders() before calling hijack() and pass them to raw.writeHead. Apply the same fix to the hijacked error path.

🤖 Generated with Claude Code

Dominant language
TypeScript
Stars
58
Forks
15
Avg merge
1d 7h
Merged PRs (30d)
53

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from platformatic/mcp

All issues in platformatic/mcp

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.