Fixes found by dogfooding the MCP OAuth 2.0 flow as both an admin and
an internal user:
1. Fix [object Object] error when creating MCP server
- Use parseErrorMessage() in create_mcp_server.tsx catch handler
- Fix deriveErrorMessage() in networking.tsx to always return a string
instead of potentially returning an object
2. Pre-configured OAuth servers auto-select auth type
- Add auth_type field to DiscoverableMCPServer type
- Add auth_type='oauth2' to Atlassian and Linear in mcp_registry.json
- Pre-fill auth_type in create form when selecting from catalog
- Use requestAnimationFrame to defer setting after transport dropdown mounts
3. Backend: drop tool_choice when MCP resolves no tools
- In chat_completions_handler.py, remove tool_choice from kwargs when
all_tools is empty after MCP resolution, preventing 400 errors from
providers that reject tool_choice without tools
4. Chat UI: OAuth-aware MCP server management
- MCPAppsPanel: show lock icon for OAuth servers in grid, show
'Authorization required' banner + 'Authorize' button in detail view,
and initiate PKCE OAuth flow via existing proxy endpoints
- MCPConnectPicker: show lock icon next to OAuth server names
- Store user OAuth tokens in sessionStorage for the session
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>