You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace raw fetch() in useMCP with mcpRequest() so a 401 on /mcp flips
the same auth store /api/* uses. This makes the AuthRequiredBanner
render on the MCP route when the session expires, instead of leaving the
401 stuck in local toolsError / per-call error state.
- api-client: extract rawRequest helper that defaults Content-Type,
attaches credentials, and signals useAuthStore on 401. apiFetch reuses
it; new mcpRequest export returns the raw Response so MCP can read
Mcp-Session-Id and parse SSE bodies the JSON shape can't expose.
- useMCP: rpc() routes through mcpRequest; drops the now-redundant
Content-Type / credentials it inherits from the helper.
- Providers: keep the QueryCache/MutationCache 401 gate as a defensive
layer; comment updated to reflect that the HTTP boundary is now the
primary signal (signalUnauthorized is idempotent).
- Tests: api-client unit tests cover apiFetch + mcpRequest 401 → store
flip; new MCPConsole.test renders the route with /mcp returning 401
and asserts AuthRequiredBanner appears.
Co-authored-by: Paperclip <noreply@paperclip.ing>
0 commit comments