Status: Experimental. This repository provides a multi-language reference implementation of the variants proposal for the Model Context Protocol (MCP), as described in SEP-2053.
by modelcontextprotocolGo
Last 12 weeks · 6 commits
5 of 6 standards met
Add four new example servers demonstrating different SEP-2053 variant patterns: model-optimized (same tools, different descriptions per LLM family) trading (API versioning with deprecation lifecycle) research (context budget management) Refactor the existing variants-http example into a GitHub-style server with custom ranking.
Summary Builds on the types and architecture from the previous PR to deliver a working variant-aware MCP server that routes requests to inner mcp.Server instances based on per-request _meta variant selection, enabling a single MCP endpoint to serve multiple tool/resource/prompt variants simultaneously. Key additions Backend abstraction (inMemoryBackend) — creates in-memory transport pairs between the variant server and inner mcp.Server instances, with notification forwarding for progress and logging events. Request dispatcher (dispatch.go) — handles routing for tools/list, tools/call, resources/list, resources/read, resources/subscribe, prompts/list, prompts/get, and completion/complete methods. Implements variant-scoped cursor wrapping to correctly paginate across multiple inner servers. Session middleware (session.go) — manages per-session inner connections in stateful mode and shared connections in stateless HTTP mode, ensuring proper lifecycle management. Initialize enrichment — injects availableVariants into the server's capabilities response so clients can discover which variants are available. Capability discovery — merges inner server capabilities via union to present a unified capability set to clients. NewStreamableHTTPHandler — provides an HTTP handler for multi-client serving over Streamable HTTP transport. Integration tests (server_test.go, 458 lines) — covers end-to-end variant selection, backward compatibility (no variant specified), HTTP transport, and stateless modes. Examples — stdio-based (examples/server/variants/main.go) and HTTP-based (examples/server/variants-http/main.go) example servers demonstrating the API. README — rewritten with API documentation and architecture diagrams. TODO (subsequent PRs): Unit Testing More integration tests
Repository: modelcontextprotocol/experimental-ext-variants. Description: Status: Experimental. This repository provides a multi-language reference implementation of the variants proposal for the Model Context Protocol (MCP), as described in SEP-2053. Stars: 4, Forks: 0. Primary language: Go. Languages: Go (97.2%), Python (1.3%), TypeScript (1.2%), JavaScript (0.3%). License: Apache-2.0. Topics: experimental, extension. Open PRs: 2, open issues: 0. Last activity: 19h ago. Community health: 87%. Top contributors: Degiorgio, sambhav.
Defines the core types and API for server variants extension, laying groundwork for multi-variant server implementation. Server.Run() is not yet implemented but architecture is designed and documented. Add Server type with variant registration Implement default priority-based ranking Define ServerVariant, VariantHints, and related types per SEP spec Add comprehensive example demonstrating intended multi-variant usage Document implementation plan for Server.Run() dispatch architecture Next PRs: Unit Tests Implementation for Server.Run Conformance Testing
Establishes a multi-language monorepo structure for MCP Variants. Implements an efficient CI/CD system that only tests what changes. 🏗️ SDK Scaffolding Python SDK () TypeScript SDK () Go SDK () Monorepo structure: Consistent pattern across all implementations #### 🚀 CI/CD Pipeline Path-based workflow triggering: Only runs CI for languages that actually changed Change Python → only Python CI runs Change multiple languages → only those CIs run Status check workflow: Single required check that dynamically validates based on changes Comment triggers**: Maintainers can run all checks with PR comment