vercel/ai · error · MCPClientError

Server does not support the requested protocol version: ${th

Error message

Server does not support the requested protocol version: ${this.protocolVersion}

What it means

Thrown by applyDiscoverResult during modern protocol discovery when the server's server/discover result does not list the client's requested protocolVersion in supportedVersions. The client refuses to proceed because the server explicitly does not support the negotiated version.

Source

Thrown at packages/mcp/src/tool/mcp-client.ts:643

      this.applyDiscoverResult(result);
      return true;
    } catch (error) {
      if (
        MCPClientError.isInstance(error) &&
        error.code != null &&
        MODERN_PROTOCOL_ERROR_CODES.includes(error.code)
      ) {
        throw error;
      }

      return false;
    }
  }

  private applyDiscoverResult(result: DiscoverResult): void {
    if (!result.supportedVersions.includes(this.protocolVersion)) {
      throw new MCPClientError({
        message: `Server does not support the requested protocol version: ${this.protocolVersion}`,
      });
    }

    const serverInfo = result._meta?.['io.modelcontextprotocol/serverInfo'];
    if (
      serverInfo != null &&
      typeof serverInfo === 'object' &&
      'name' in serverInfo &&
      typeof serverInfo.name === 'string' &&
      'version' in serverInfo &&
      typeof serverInfo.version === 'string'
    ) {
      this._serverInfo = serverInfo as Configuration;
    }

    this.serverCapabilities = result.capabilities;
    this._serverInstructions = result.instructions;

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Upgrade @ai-sdk/mcp so the client requests a protocol version the server supports.
  2. Upgrade the MCP server so it supports the client's requested protocol version.
  3. Check the server's serverInfo/_meta in the discover result to see which versions are supported and align deployments.
  4. Disable protocol version discovery if the server only supports the legacy handshake.

Example fix

// before (server discover result)
{ supportedVersions: ['2025-03-26'], _meta: {...} }
// after (server supports client's requested version)
{ supportedVersions: ['2025-06-18', '2025-03-26'], _meta: {...} }
Defensive patterns

Strategy: try-catch

Validate before calling

// probe discovery manually
const res = await fetch(mcpUrl, { method: 'POST', body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'server/discover' }) });
const { result } = await res.json();
if (!result?.supportedVersions?.includes('2025-06-18')) {
  console.warn('Server does not support client protocol version; upgrade server or SDK');
}

Type guard

function supportsVersion(r: unknown, v: string): boolean {
  return !!r && typeof r === 'object' && Array.isArray((r as any).supportedVersions) && (r as any).supportedVersions.includes(v);
}

Try / catch

try {
  const client = await createMCPClient({ transport });
} catch (e) {
  if (MCPClientError.isInstance(e) && e.message.startsWith('Server does not support the requested protocol version')) {
    // align server/SDK versions or fall back to legacy handshake
  } else throw e;
}

Prevention

When it happens

Trigger: Client attempts protocol version discovery ('server/discover'); the server responds successfully but its supportedVersions array omits the version the client sent (LATEST_PROTOCOL_VERSION).

Common situations: Connecting to a newer/older MCP server that supports different protocol versions; mixed client/server SDK versions after an MCP spec release; proxies that advertise discovery but with restricted versions.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/c5210b2ef78acd78. Report an issue: GitHub.