Skip to content

Document callbackPath requirement for MCP OAuth security (agents#868)#28198

Closed
agents-git-bot[bot] wants to merge 2 commits into
productionfrom
sync-docs-pr-868
Closed

Document callbackPath requirement for MCP OAuth security (agents#868)#28198
agents-git-bot[bot] wants to merge 2 commits into
productionfrom
sync-docs-pr-868

Conversation

@agents-git-bot

@agents-git-bot agents-git-bot Bot commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates MCP client API documentation to reflect security improvements from cloudflare/agents#868.

Changes

  • Security Enforcement: Documents that callbackPath is now required when sendIdentityOnConnect is false, and that addMcpServer() will throw an error if not provided
  • Enhanced Callback Matching: Explains the improved callback request detection that uses the state query parameter plus origin/pathname verification for defense-in-depth
  • API Clarification: Adds details about callbackPath format requirements (should be a plain path without query strings or fragments)

Context

When using sendIdentityOnConnect: false to protect sensitive instance names (like session IDs or user IDs), the default OAuth callback URL would expose the instance name in the path. This PR documents the new requirement to provide a custom callbackPath that prevents this security issue.

Related PR

🤖 Generated with Claude Code

Update MCP client API documentation to reflect new security requirements
from agents PR #868:

- Clarify that callbackPath is required when sendIdentityOnConnect is false
- Document that addMcpServer() throws an error without callbackPath
- Explain the enhanced callback matching logic (state param + origin/pathname verification)
- Add details about callbackPath format requirements (plain path, no query strings)

Related to: cloudflare/agents#868

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@agents-git-bot
agents-git-bot Bot requested a review from a team February 8, 2026 23:05
@agents-git-bot
agents-git-bot Bot requested a review from a team as a code owner February 8, 2026 23:05
@github-actions github-actions Bot added the product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. label Feb 8, 2026
@github-actions

github-actions Bot commented Feb 8, 2026

Copy link
Copy Markdown
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, @whoiskatrin, @cloudflare/pcx-technical-writing, @cloudflare/ai-agents, @cloudflare/dev-plat-leads

Update MCP client API documentation to reflect the new security requirement
that callbackPath must be provided when sendIdentityOnConnect is false.

Changes:
- Emphasize that callbackPath is REQUIRED (not optional) when sendIdentityOnConnect is false
- Add error behavior information (throws if callbackPath is missing)
- Update callback matching explanation (state parameter + origin/pathname verification)
- Add example callback URL format for custom callbackPath
- Clarify security implications (OAuth provider, browser history, address bar)

Related to cloudflare/agents#868

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@agents-git-bot

agents-git-bot Bot commented Feb 8, 2026

Copy link
Copy Markdown
Contributor Author

Updated documentation with more comprehensive explanation of the security issue and callback matching mechanism.

Changes:

  • Expanded security vulnerability explanation (OAuth provider exposure, browser history, address bar)
  • Clarified error behavior when callbackPath is missing with sendIdentityOnConnect: false
  • Enhanced callback matching explanation with numbered list for clarity
  • Updated API reference to mention when callbackPath is optional vs required

@github-actions

github-actions Bot commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

@github-actions
github-actions Bot deleted the sync-docs-pr-868 branch April 10, 2026 04:58
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/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants