feat: implement server/discover method on stdio and HTTP transports - #101
feat: implement server/discover method on stdio and HTTP transports#101github-actions[bot] wants to merge 1 commit into
Conversation
Bump to 2.10.1. MCP 2026-07-28 replaces the connection-scoped initialize handshake with a per-request metadata model, and modern clients classify a server's era by probing server/discover first. We answered -32601 method not found, which still triggered the correct legacy fallback but through an ambiguous error and with no capability hints. Return a real result instead: the same protocolVersion, capabilities and serverInfo as initialize (now built by a shared buildInitializeResult so the two transports can't drift), plus supportedProtocolVersions ["2025-03-26"]. That gives modern clients a deterministic "legacy server, negotiate 2025-03-26" fast path without sending a blind initialize. The HTTP probe needs no Mcp-Session-Id -- a fresh client has no session yet -- and is exempt from the unrecognized-session 404 so a stale header can't turn an era classification into a not-found. The server stays legacy-only: no 2026 stateless semantics, no extension advertising, no session changes, initialize unchanged. Also realigns .kiro-plugin/plugin.json, which was left at 2.9.0 by the 2.10.0 release. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
AI ReviewAdds Checklist
Issues found[warning] U1 — [warning] U6 — This review was generated automatically. A human maintainer should still make the merge decision. |
Closes #97
Implements the
server/discoverJSON-RPC method on both transports so MCP 2026-07-28 clients can classify this server deterministically as legacy-only instead of inferring it from a-32601 method not found.What changed
mcp_server.go— addedmcpProtocolVersion,mcpSupportedProtocolVersions, and the sharedbuildInitializeResult()/buildDiscoverResult()helpers, so the two transports build the same payload and can't drift. Newcase "server/discover"in the stdio dispatcher.mcp_http.go—initializenow usesbuildInitializeResult(); newcase "server/discover"returnsbuildDiscoverResult(). The method is also exempt from the unrecognized-session 404 inhttpHandlePost, since a modern client probes before it has a session and a stale header must not turn an era classification into a not-found.Response shape:
{ "protocolVersion": "2025-03-26", "supportedProtocolVersions": ["2025-03-26"], "capabilities": { "tools": {}, "resources": {}, "prompts": {} }, "serverInfo": { "name": "convctl-mcp", "version": "<mcpServerVersion>" } }Out of scope as specified: no 2026 stateless semantics, no extension advertising, no session-management changes, no
UnsupportedProtocolVersionErrorfrominitialize.initializebehaviour is unchanged. Nocapabilities.extensions: {}— an empty map signals nothing.Tests
TestMCPProtocol_ServerDiscover(stdio) — probesserver/discoverbefore any handshake, assertssupportedProtocolVersions, then comparesprotocolVersion/capabilities/serverInfobyte-for-byte against a subsequentinitialize.TestHTTPDispatch_ServerDiscover— same assertions throughhttpDispatch.TestHTTPHandlePost_ServerDiscover_NoSessionRequiredand..._ExemptFromSessionCheck— 200 with no session header, and 200 with a stale one.go build ./...,go vet ./...andgo test -race ./...are clean (full package, 58.9% coverage).Version
Bumped to 2.10.1 across the manifests, with a CHANGELOG entry.
plugins/corezoid/.kiro-plugin/plugin.jsonwas stranded at 2.9.0 by the 2.10.0 release (CI only checks the other four) — realigned here.🤖 Generated with Claude Code