Skip to content

feat: answer server/discover for connection-less capability discovery - #235

Open
sideeffffect wants to merge 1 commit into
softwaremill:masterfrom
sideeffffect:feat/server-discover
Open

feat: answer server/discover for connection-less capability discovery#235
sideeffffect wants to merge 1 commit into
softwaremill:masterfrom
sideeffffect:feat/server-discover

Conversation

@sideeffffect

Copy link
Copy Markdown

Part of the MCP roadmap's HTTP-native / stateless direction. Relates to #163.

Context

chimp's server is already stateless: McpHandler handles each JSON-RPC request on its own, stores no session, issues no Mcp-Session-Id, and doesn't require an initialize handshake before other methods. So the 2026-07-28 "stateless architecture" is largely chimp's existing model — a request can land on any instance behind a plain round-robin load balancer.

The one concrete primitive it was missing is the discovery entry point.

What

Handle the server/discover method: a client or proxy can learn the server's capabilities up front, without negotiating a session, before doing any real work. It returns the same serverInfo, capabilities and protocolVersion payload as initialize (the initialize capability computation is refactored into a shared discoveryResult helper, so the two can't drift).

Additive — an extra method the server answers — so it doesn't affect the 2025-11-25 conformance suite or existing clients.

Tests

  • McpHandlerSpec gets a case asserting server/discover returns the server info + capabilities with no prior initialize.
  • sbt scalafmtCheckAll compile Test/compile compileDocs and the full McpHandlerSpec (33 cases) pass locally.

Notes

The exact server/discover result shape in the 2026-07-28 RC isn't fully pinned down publicly yet; mirroring the initialize result (capabilities + serverInfo + protocolVersion + instructions) is the natural, forward-compatible choice. Happy to adjust to the final schema. Documented under server capabilities. Draft/WIP.

🤖 Generated with Claude Code

The chimp server is already stateless: it stores no session, issues no
Mcp-Session-Id, and does not require an initialize handshake before other
methods. Add support for the `server/discover` method so a client or proxy can
learn the server's capabilities up front without negotiating a session; it
returns the same serverInfo, capabilities and protocol version as initialize.

This aligns with the 2026-07-28 stateless architecture direction. Tracks softwaremill#163.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sideeffffect sideeffffect changed the title feat: answer server/discover for connection-less capability discovery WIP: feat: answer server/discover for connection-less capability discovery Aug 28, 2026
@sideeffffect
sideeffffect marked this pull request as ready for review August 31, 2026 17:08
@sideeffffect sideeffffect changed the title WIP: feat: answer server/discover for connection-less capability discovery feat: answer server/discover for connection-less capability discovery Aug 31, 2026
@sideeffffect

Copy link
Copy Markdown
Author

Hello @kubinio123 , what do you think about this PR? Could I ask you for a review? 🙏

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.

1 participant