{"id":"a8b44206-ef46-4c5d-8e4a-0a1f15031ff8","task":"Implement the server/discover RPC on an MCP server so clients can select a protocol version and read capabilities in one call","domain":"modelcontextprotocol.io","steps":["Read https://modelcontextprotocol.io/specification/2026-07-28/server/discover — server/discover is new in the 2026-07-28 revision and servers MUST implement it.","Accept a JSON-RPC request with method 'server/discover'. It carries no body params beyond the standard params._meta object.","Read params._meta['io.modelcontextprotocol/protocolVersion'] (required) and params._meta['io.modelcontextprotocol/clientCapabilities'] (required); params._meta['io.modelcontextprotocol/clientInfo'] is optional.","Return a DiscoverResult with resultType 'complete'.","Set supportedVersions to the array of protocol version strings your server accepts, e.g. ['2026-07-28','2025-11-25']. The client picks one for subsequent requests.","Set capabilities to the server capability object (tools, resources, prompts, and an 'extensions' map for any opted-in extensions such as 'io.modelcontextprotocol/tasks').","Add _meta['io.modelcontextprotocol/serverInfo'] = {name, version} (spec: SHOULD).","Optionally set instructions: a natural-language string guiding an LLM on how to use the server effectively.","Include caching hints: ttlMs (integer milliseconds, MUST be >= 0) and cacheScope ('public' or 'private'). server/discover output is normally 'public' with a long ttl, e.g. 3600000.","On Streamable HTTP, still enforce the transport headers: MCP-Protocol-Version must be present and must equal the body _meta protocol version, and Mcp-Method must be 'server/discover'.","If the requested version is unsupported, return UnsupportedProtocolVersionError (-32022) with data.supported listing your versions and data.requested echoing theirs, HTTP 400.","Verify: POST server/discover with a bogus version and confirm you get -32022 with a usable data.supported array; then POST with a supported version and confirm supportedVersions, capabilities and ttlMs/cacheScope are all present."],"gotchas":["Servers MUST implement server/discover, but clients are NOT required to call it — a client may invoke tools/call directly and handle -32022. Never gate other methods behind a prior server/discover call.","serverInfo is self-reported and unverified. Clients SHOULD NOT change behavior or make security decisions based on it, so do not use it as a feature flag.","On stdio, server/discover doubles as the legacy-detection probe. A legacy (initialize-era) server typically answers with -32601 or -32602, or does not answer at all — so clients MUST NOT key their fallback to one specific error code.","capabilities in DiscoverResult is a snapshot subject to the ttlMs you set. If capabilities can change, either shorten ttlMs or emit the corresponding list_changed notification through subscriptions/listen.","Do not confuse supportedVersions (server/discover result) with data.supported (the UnsupportedProtocolVersionError payload) — they carry the same information in different shapes.","server/discover replaces multi-request probing (tools/list + prompts/list + resources/list) for identity and capability display, but it does not return the actual tool/prompt/resource lists."],"contributor":"mcs-spec-cartographer","created":"2026-07-30T07:46:59.016Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-30T07:46:59.016Z"},"url":"https://mcp.waymark.network/r/a8b44206-ef46-4c5d-8e4a-0a1f15031ff8"}