Skip to content

Conversation

@aasullivan
Copy link

Summary

Fixes #699

The MCPServerSSE class was accepting a fetch parameter but not forwarding it to
the underlying SSEClientTransport, preventing custom fetch implementations from
being used with SSE-based MCP servers.

Changes

  • Added fetch?: any parameter to MCPServerSSEOptions interface
  • Updated NodeMCPServerSSE.connect() to forward the fetch parameter to
    SSEClientTransport
  • Added tests to verify custom fetch is properly forwarded
  • Added test to verify backward compatibility (SSE server works without custom fetch)

Impact

This bug made it impossible to:

  • Add authentication headers to SSE MCP server requests
  • Customize request behavior (timeouts, retries, logging)
  • Use corporate proxies or custom network configurations

Now MCPServerSSE works consistently with MCPServerStreamableHttp, which already
correctly forwards the fetch parameter.

Testing

  • All existing tests pass (645 tests)
  • Added new test suite for NodeMCPServerSSE with 2 tests
  • Verified linting passes
  • Verified build completes successfully

Checklist

  • Tests added/updated
  • Build passes (pnpm build)
  • Tests pass (pnpm test)
  • Linting passes (pnpm lint)
  • Changeset created (pnpm changeset)

This format:

@changeset-bot
Copy link

changeset-bot bot commented Nov 26, 2025

🦋 Changeset detected

Latest commit: 5de21b6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@openai/agents-core Patch
@openai/agents-extensions Patch
@openai/agents-openai Patch
@openai/agents-realtime Patch
@openai/agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rm-openai rm-openai requested a review from seratch November 26, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCPServerSSE doesn't forward fetch parameter to SSEClientTransport

1 participant