Group of 2 Under the hood
Error messages from MCP server connection and OAuth problems now clamp sensitive detail based on the specific server's setup
What
Errors from MCP (Model Context Protocol) server connections and OAuth flows now pass through helper functions that use the server's config object to decide how much detail to clamp or redact before showing or logging the error:
- OAuth errors (a rejected custom
redirectUri, a failed localhost fallback, or a failed OAuth completion) now route through this redaction logic, and a failed localhost OAuth fallback now throws an error instead of silently producing no result. - General MCP client reconnect/error-formatting calls now take the server's
configalongside the error, letting the formatter tailor the message to the connection type, matching a 'detail withheld on this connection' pattern used for off-box connections.
Why
This avoids leaking sensitive connection detail in error messages while still giving useful, connection-appropriate context, and it fixes a case where a failed OAuth fallback used to fail silently instead of surfacing an error.