Skip to content

Conversation

@mrubens
Copy link
Collaborator

@mrubens mrubens commented May 30, 2025

Related GitHub Issue

Closes: #2705

Description

Fixes the issue where headers aren't correctly passed through SSE with an approach similar to modelcontextprotocol/typescript-sdk#436 (comment)

Test Procedure

I set up a SSE server locally following https://glama.ai/mcp/servers/@anisirji/mcp-server-remote-setup-with-jwt-auth and confirmed that this change sent the header through correctly with config like this:

{
  "mcpServers": {
    "test-server": {
      "type": "sse",
      "url": "http://localhost:3001/sse",
      "headers": {
        "Authorization": "Bearer ey..."
      }
    }
  }
}

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

Headers are already documented - this just makes them work: https://docs.roocode.com/features/mcp/using-mcp-in-roo#understanding-transport-types


Important

Fixes header passing in SSE connections in McpHub.ts by modifying the fetch function to include headers.

  • Behavior:
    • Fixes header passing in SSE connections in McpHub.ts by modifying the fetch function to include headers from configInjected.
  • Misc:
    • Adds a changeset file nine-windows-read.md to document the patch.

This description was created by Ellipsis for 5092a3f. You can customize this summary. It will automatically update as commits are pushed.

@mrubens mrubens requested a review from cte as a code owner May 30, 2025 19:06
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels May 30, 2025
@mrubens mrubens mentioned this pull request May 30, 2025
@fabriciojoc
Copy link

Just tested and it works!! @cte or who else needs to review this, please do it asap to add it to the next release!! This is awesome, thanks @mrubens !

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 30, 2025
@mrubens mrubens merged commit 116a50f into main May 30, 2025
18 checks passed
@mrubens mrubens deleted the fix_sse_headers branch May 30, 2025 19:34
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap May 30, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

header not work

4 participants