Skip to content

feat: implement server/discover method on stdio and HTTP transports - #101

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
feat/server-discover-issue-97
Open

feat: implement server/discover method on stdio and HTTP transports#101
github-actions[bot] wants to merge 1 commit into
mainfrom
feat/server-discover-issue-97

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Closes #97

Implements the server/discover JSON-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 — added mcpProtocolVersion, mcpSupportedProtocolVersions, and the shared buildInitializeResult() / buildDiscoverResult() helpers, so the two transports build the same payload and can't drift. New case "server/discover" in the stdio dispatcher.
  • mcp_http.goinitialize now uses buildInitializeResult(); new case "server/discover" returns buildDiscoverResult(). The method is also exempt from the unrecognized-session 404 in httpHandlePost, 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 UnsupportedProtocolVersionError from initialize. initialize behaviour is unchanged. No capabilities.extensions: {} — an empty map signals nothing.

Tests

  • TestMCPProtocol_ServerDiscover (stdio) — probes server/discover before any handshake, asserts supportedProtocolVersions, then compares protocolVersion / capabilities / serverInfo byte-for-byte against a subsequent initialize.
  • TestHTTPDispatch_ServerDiscover — same assertions through httpDispatch.
  • TestHTTPHandlePost_ServerDiscover_NoSessionRequired and ..._ExemptFromSessionCheck — 200 with no session header, and 200 with a stale one.

go build ./..., go vet ./... and go 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.json was stranded at 2.9.0 by the 2.10.0 release (CI only checks the other four) — realigned here.

🤖 Generated with Claude Code

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>
@gh-corezoid

Copy link
Copy Markdown
Contributor

AI Review

Adds server/discover JSON-RPC on both stdio and HTTP transports so MCP 2026-07-28 clients can classify this server as legacy-only without relying on a -32601 error; bumps the plugin to 2.10.1 and realigns .kiro-plugin/plugin.json which was stranded at 2.9.0.

Checklist

Check Result
U1 — Conventional commit format ⚠️ warning
U2 — No leaked credentials ✅ pass
U3 — No merge commits ✅ pass
U4 — PR targets correct base branch (main) ✅ pass
U5 — Build & tests (Go) ✅ pass
U6 — Architectural & design consequences ⚠️ warning (pre-existing)
C1 — All four manifest files version-synced ✅ pass
C2 — Node IDs in .conv.json files ⏭️ skip (no .conv.json changed)
C3 — No hardcoded env-specific values in .conv.json ⏭️ skip
C4 — extra fields have matching extra_type ⏭️ skip
C5 — README updated for new skills ⏭️ skip (no new skill directories)

Issues found

[warning] U1 — bump to X.Y.Z missing from commit subject line
The single commit feat(mcp-server): implement server/discover on stdio and HTTP touches four version manifests (all bumped to 2.10.1) but the subject line does not include the trailing , bump to 2.10.1 required by the project's conventional-commit convention. The bump is documented clearly in the commit body, so the intent is unambiguous — but future tooling that parses only the headline (changelogs, release-note automation) may silently omit it.
Fix: rename the commit subject to feat(mcp-server): implement server/discover on stdio and HTTP, bump to 2.10.1.


[warning] U6 — mcpServerVersion constant out of sync with plugin version (pre-existing)
mcp_server.go:53 has const mcpServerVersion = "2.3.5" with a comment "Keep this in sync with .claude-plugin/plugin.json", but the manifests are at 2.10.1. This discrepancy predates this PR and is not introduced by it; the serverInfo.version field in every initialize and server/discover response therefore reports 2.3.5 to clients. Flagging here because the new buildDiscoverResult() prominently surfaces serverInfo and makes the mismatch more visible to MCP 2026-07-28 clients that inspect the discovery payload.
Fix (separate PR): align mcpServerVersion with the current plugin version or intentionally decouple the two and document the difference.


This review was generated automatically. A human maintainer should still make the merge decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: implement server/discover method on stdio and HTTP transports

1 participant