Skip to content

Conversation

@threepointone
Copy link
Contributor

Syncs documentation changes from cloudflare/agents#654

Changes

This PR documents the relatedRequestId routing feature for bidirectional MCP streams in the Streamable HTTP transport.

Added to transport.mdx:

  • New section: Bidirectional streams with relatedRequestId
  • Explanation of how relatedRequestId routing works
  • When to use relatedRequestId (elicitation, progress updates, callbacks)
  • Implementation example showing the routing mechanism
  • Note clarifying this is specific to Streamable HTTP transport

This feature enables proper server-to-client request routing, ensuring that server-initiated requests (like elicitation) are delivered through the correct bidirectional stream while maintaining proper request-response pairing.

Related PR: cloudflare/agents#654

@github-actions github-actions bot added size/s product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. labels Nov 17, 2025
@github-actions
Copy link
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/agents/ @irvinebroque, @rita3ko, @elithrar, @thomasgauvin, @threepointone, @cloudflare/pcx-technical-writing

Copy link
Contributor

@irvinebroque irvinebroque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generating docs like this from PRs seems to be working really well — this all reads really well

Add documentation explaining how the Agents SDK routes server-to-client
requests through the correct HTTP stream using the relatedRequestId
parameter. This is particularly important for elicitation requests that
need to flow through the same bidirectional stream as the tool call
that triggered them.

Includes:
- Explanation of the routing behavior and priority
- Code example showing how to use relatedRequestId with elicitInput
- Technical details about stream mapping

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@threepointone
Copy link
Contributor Author

Updated documentation to reflect the latest changes from cloudflare/agents#654

The documentation now includes:

  • Clear explanation of bidirectional stream routing behavior
  • Priority order for routing decisions (responses → related requests → standalone)
  • Practical code example showing how to use relatedRequestId with elicitInput

This ensures developers understand how to properly route server-to-client requests through the correct HTTP stream when using elicitation or other bidirectional communication patterns.

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

Labels

product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants