Skip to content

feat: add a error type for mcp response and optimize the ui when encounter an mcp auth error - #9349

Merged
ZxBing0066 merged 4 commits into
developfrom
feat/optimize-mcp-auth-error
Nov 10, 2025
Merged

ZxBing0066 merged 4 commits into
developfrom
feat/optimize-mcp-auth-error

Conversation

@ZxBing0066

@ZxBing0066 ZxBing0066 commented Nov 6, 2025 •

Copy link
Copy Markdown
Member

Background

INS-1662
We may encounter different auth errors based on the mcp auth server implementation.

Changes

  • Add a response error type
  • Show more details by display the events when the error is an auth error

@ZxBing0066 ZxBing0066 self-assigned this Nov 6, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 MCPAuthError custom error class for better error identification
  • Added errorType field to McpResponse model 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
ZxBing0066 marked this pull request as ready for review November 10, 2025 03:10
@ZxBing0066
ZxBing0066 enabled auto-merge (squash) November 10, 2025 06:04
@ZxBing0066
ZxBing0066 merged commit 7f58168 into develop Nov 10, 2025
@ZxBing0066
ZxBing0066 deleted the feat/optimize-mcp-auth-error branch November 10, 2025 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants