Skip to content

Investigate OAuth error surfacing and broadcasting to React hooks #707

@mattzcarey

Description

@mattzcarey

Context

From PR #696 review comments by @ghostwriternr:

1. Error surfacing to browser

Do OAuth errors get surfaced properly to the browser? Need to investigate:

  • Look at handleMcpOAuthCallback behavior
  • Test various combinations of customHandler and errorRedirect
  • Ensure error messages are helpful for both users and developers

"I vaguely remember feeling constantly stumped by the error messages that surface up to the DO runtime from the MCP client and they were not helpful for 1. me as a user and 2. me as a developer building a client."

2. Broadcasting state on errors

Are we calling this.broadcastMcpServers to React hooks even in error scenarios? This is important so the frontend can reflect auth failures appropriately.

Files to investigate

  • packages/agents/src/mcp/client.ts - handleCallbackRequest and error handling
  • packages/agents/src/mcp/index.ts - handleMcpOAuthCallback

Related

/cc @mattzcarey

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions