-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
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:
- Client sends initialize with its latest supported protocolVersion
- Server MUST respond with either:
- The same version (if supported), OR
- A different version it supports (should be its latest)
- 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
- 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)
- Show error details in Sidebar
Add an expandable error details section below the connection status indicator.
- Display protocol version info when connected
Show the negotiated protocol version alongside server name/version in the connected state.
- Log failed initialize attempts in History
Currently pushHistory only happens on success. Showing failed attempts would help debugging.
- 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
- (Advanced) Allow client version selection
Add a Configuration option to select which protocol version the Inspector sends, for testing compatibility with older servers.
Related
- Feedback: Throws error on
Unsupported protocol versionย #959 - Original bug report