Skip to content

fix(mcp): add GET endpoint for SSE stream connections#28224

Draft
octo-patch wants to merge 1 commit inton8n-io:masterfrom
octo-patch:fix/issue-28137-mcp-get-request-404
Draft

fix(mcp): add GET endpoint for SSE stream connections#28224
octo-patch wants to merge 1 commit inton8n-io:masterfrom
octo-patch:fix/issue-28137-mcp-get-request-404

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Some MCP clients (e.g. Gemini CLI) use GET /mcp-server/http to establish SSE streams for server-initiated messages, per the MCP Streamable HTTP transport specification. Without a registered GET route, these requests returned 404 Not Found.

This PR adds a GET /mcp-server/http endpoint that delegates to StreamableHTTPServerTransport.handleRequest(), following the same stateless pattern used by the existing POST handler (creates a new transport+server per request with sessionIdGenerator: undefined for isolation).

Observed before fix:

  • POST /mcp-server/http → works correctly
  • GET /mcp-server/http404 Not Found (breaks Gemini CLI SSE handshake)

After fix:

  • Both GET and POST requests are handled correctly

Related Linear tickets, Github issues, and Community forum posts

Fixes #28137

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)

Some MCP clients (e.g. Gemini CLI) send GET requests to the MCP
endpoint to establish SSE streams for server-initiated messages,
per the MCP Streamable HTTP transport specification. Without a
registered GET route, these requests returned 404 Not Found.

Add GET /mcp-server/http endpoint that delegates to
StreamableHTTPServerTransport.handleRequest(), which handles the
GET to SSE stream lifecycle internally, matching the MCP spec.

Fixes n8n-io#28137
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


octo-patch seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@n8n-assistant n8n-assistant Bot added community Authored by a community member core Enhancement outside /nodes-base and /editor-ui in linear DEPRECATED labels Apr 9, 2026
@n8n-assistant
Copy link
Copy Markdown
Contributor

n8n-assistant Bot commented Apr 9, 2026

Hey @octo-patch,

Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request.

Before we can proceed, please ensure the following:
• Tests are included for any new functionality, logic changes or bug fixes.
• The PR aligns with our contribution guidelines.

Regarding new nodes:
We no longer accept new nodes directly into the core codebase. Instead, we encourage contributors to follow our Community Node Submission Guide to publish nodes independently.

If your node integrates with an AI service that you own or represent, please email nodes@n8n.io and we will be happy to discuss the best approach.

About review timelines:
This PR has been added to our internal tracker as "GHC-7660". While we plan to review it, we are currently unable to provide an exact timeframe. Our goal is to begin reviews within a month, but this may change depending on team priorities. We will reach out when the review begins.

Thank you again for contributing to n8n.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Authored by a community member core Enhancement outside /nodes-base and /editor-ui in linear DEPRECATED

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native MCP endpoint returns 404 on GET requests (Incompatibility with Gemini CLI)

2 participants