Repository navigation
feat: add a error type for mcp response and optimize the ui when encounter an mcp auth error - #9349
Merged
Merged
Conversation
…unter an mcp auth error
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances error handling for MCP (Model Context Protocol) authentication errors by providing better identification and user guidance. When an MCP authentication error occurs, the UI now displays a specific documentation link about MCP authentication while keeping the events view visible for better troubleshooting context.
Key Changes:
- Introduced
MCPAuthErrorcustom error class for better error identification - Added
errorTypefield toMcpResponsemodel to categorize errors - Modified error display logic to show authentication-specific documentation links
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/insomnia/src/main/mcp/oauth-client-provider.ts | Defines MCPAuthError class and helper function for error identification |
| packages/insomnia/src/main/mcp/transport-streamable-http.ts | Wraps authentication errors in MCPAuthError for better identification |
| packages/insomnia/src/main/network/mcp.ts | Uses error name instead of message for transport errors and propagates error type |
| packages/insomnia/src/models/mcp-response.ts | Adds optional errorType field to track error categories |
| packages/insomnia/src/ui/components/viewers/response-error-viewer.tsx | Accepts optional docsLink parameter for custom documentation links |
| packages/insomnia/src/ui/components/websockets/realtime-response-pane.tsx | Conditionally displays error viewer for auth errors while preserving events view |
| packages/insomnia/src/common/documentation.ts | Adds documentation link for MCP authentication |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ZxBing0066
marked this pull request as ready for review
November 10, 2025 03:10
cwangsmv
approved these changes
Nov 10, 2025
ZxBing0066
enabled auto-merge (squash)
November 10, 2025 06:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
INS-1662
We may encounter different auth errors based on the mcp auth server implementation.
Changes