Skip to content

Improve DX for protocol version negotiation errorsย #962

@olaservo

Description

@olaservo

Context

From #959 and community feedback, when an MCP server returns a protocol version error during initialization, the
Inspector shows a generic "Connection Error" message that doesn't help developers diagnose the issue.

Example error (only visible in browser console):

McpError: MCP error -32602: Unsupported protocol version: 2025-11-25 - supported versions: 2025-06-18,2025-03-26,2024-11-05,2024-10-07

Background: How Version Negotiation Works

Per the https://modelcontextprotocol.io/specification/2025-11-25/basic/lifecycle#version-negotiation:

  1. Client sends initialize with its latest supported protocolVersion
  2. Server MUST respond with either:
  • The same version (if supported), OR
  • A different version it supports (should be its latest)
  1. Client checks if it supports the server's returned version and disconnects if not

The SDK handles this correctly:

  • Client (@modelcontextprotocol/sdk v1.24.3): Sends 2025-11-25, accepts ['2025-11-25', '2025-06-18', '2025-03-26', '2024-11-05', '2024-10-07']
  • Server: Should respond with a supported version, not an error

When a server returns an error instead of negotiating, it's non-compliant with the spec. However, the Inspector should help developers understand what went wrong.

Suggested Improvements

  1. Surface MCP errors in the UI

Parse McpError responses and display the actual error message instead of generic "Connection Error". For version errors specifically, show:

  • The protocol version the Inspector requested
  • The versions the server says it supports (if included in error)
  1. Show error details in Sidebar

Add an expandable error details section below the connection status indicator.

  1. Display protocol version info when connected

Show the negotiated protocol version alongside server name/version in the connected state.

  1. Log failed initialize attempts in History

Currently pushHistory only happens on success. Showing failed attempts would help debugging.

  1. Provide actionable guidance

For version mismatch errors, include guidance like:

  • "The server returned an error instead of negotiating a compatible version. This may indicate a non-compliant MCP server implementation."
  • Link to the MCP spec's version negotiation section
  1. (Advanced) Allow client version selection

Add a Configuration option to select which protocol version the Inspector sends, for testing compatibility with older servers.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions