---
title: "Answer an unsupported protocol version · Agent Wranglers"
url: https://agentwranglers.se/playbook/agents-as-users/mcp-servers/protocol-version-errors
id: AGT-35
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 937
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Answer an unsupported protocol version with the versions you serve

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [MCP servers](https://agentwranglers.se/playbook/agents-as-users/mcp-servers.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: AGT-35
- Level: Recommended
- Chapter: [MCP servers](https://agentwranglers.se/playbook/agents-as-users/mcp-servers.md)
- Rule: Implement `server/discover`. Answer a request in a protocol version you do not serve with error `-32022` that lists the versions you serve. Answer a legacy `initialize` with an error that names them too.
- Check: Send `tools/list` with protocol version `1900-01-01`. The answer is error -32022, and its `data.supported` equals the versions `server/discover` lists. Send a legacy `initialize`. The error message names each supported version.
- Spec version: MCP 2026-07-28
- Review by: 2027-04-30
- How: A client picks a version from your list and retries, so a clear error keeps agents working through an upgrade. Older clients have no way to move forward on their own, and the error text may be all their user sees. The 2026-07-28 revision deprecated Roots, Sampling, Logging and Dynamic Client Registration. Each deprecated feature stays for at least twelve months, so plan the move off them now. Register clients as [Register MCP clients with Client ID Metadata Documents](https://agentwranglers.se/playbook/agents-as-users/mcp-servers/client-id-metadata-documents.md) says.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
const SUPPORTED_VERSIONS = ['2026-07-28', '2025-11-25'];
const UNSUPPORTED_PROTOCOL_VERSION = -32022;

export function versionError(id, requested) {
  if (SUPPORTED_VERSIONS.includes(requested)) return null;
  return { jsonrpc: '2.0', id, error: { code: UNSUPPORTED_PROTOCOL_VERSION, message: 'Unsupported protocol version', data: { supported: SUPPORTED_VERSIONS, requested } } };
}
```

### Python example

```python
SUPPORTED_VERSIONS = ["2026-07-28", "2025-11-25"]
UNSUPPORTED_PROTOCOL_VERSION = -32022

def version_error(request_id: int, requested: str) -> dict | None:
    if requested in SUPPORTED_VERSIONS:
        return None
    return {"jsonrpc": "2.0", "id": request_id, "error": {"code": UNSUPPORTED_PROTOCOL_VERSION,
            "message": "Unsupported protocol version", "data": {"supported": SUPPORTED_VERSIONS, "requested": requested}}}
```

## Sources

- [MCP versioning and compatibility](https://modelcontextprotocol.io/specification/2026-07-28/basic/versioning)
- [MCP 2026-07-28 changelog](https://modelcontextprotocol.io/specification/2026-07-28/changelog)

## Related rules

- AGT-13 [Register MCP clients with Client ID Metadata Documents](https://agentwranglers.se/playbook/agents-as-users/mcp-servers/client-id-metadata-documents.md) in Agents as users

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/agents-as-users/mcp-servers/protocol-version-errors">Agent Wranglers agents as users playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Ask for secrets only on your own page and check who opens it](https://agentwranglers.se/playbook/agents-as-users/mcp-servers/url-elicitation-for-secrets.md)
- [MCP servers](https://agentwranglers.se/playbook/agents-as-users/mcp-servers.md)
