experimental-ext-variants/go/sdk/variants
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Steven Chen b95923d172
variants: simplify dispatch and session by reducing method boilerplate (#8)
Simplify variant dispatch and session by replacing per-method
boilerplate with generic handlers backed by reflect.

## Motivation and Context
The dispatcher and backend session had separate handler functions for
every MCP method (ListTools, ListResources, CallTool, Subscribe, etc.),
each following an identical pattern: extract params, inject metadata,
call inner handler, cast result. This meant ~250 lines of near-identical
code across dispatch.go and session.go, and every new MCP method
required adding another copy.

## How Has This Been Tested?
All existing unit and integration tests pass (go test -v ./...)

## Breaking Changes
None. All changes are internal to the variants package. Public API is
unchanged.

## Types of changes
Refactor (non-breaking change which fixes an issue)
2026-05-01 12:29:10 +01:00
..
backend.go variants: redirect inner server sending methods to fix dropping notifications in stateless mode (#7) 2026-03-23 15:39:57 +00:00
context_test.go variants: redirect inner server sending methods to fix dropping notifications in stateless mode (#7) 2026-03-23 15:39:57 +00:00
dispatch.go variants: simplify dispatch and session by reducing method boilerplate (#8) 2026-05-01 12:29:10 +01:00
dispatch_test.go variants: simplify dispatch and session by reducing method boilerplate (#8) 2026-05-01 12:29:10 +01:00
notification_test.go variants: redirect inner server sending methods to fix dropping notifications in stateless mode (#7) 2026-03-23 15:39:57 +00:00
ranking.go Implement variant-aware MCP server (#3) 2026-02-18 12:57:21 +00:00
sending_test.go variants: redirect inner server sending methods to fix dropping notifications in stateless mode (#7) 2026-03-23 15:39:57 +00:00
server.go variants: redirect inner server sending methods to fix dropping notifications in stateless mode (#7) 2026-03-23 15:39:57 +00:00
server_test.go Implement variant-aware MCP server (#3) 2026-02-18 12:57:21 +00:00
session.go variants: simplify dispatch and session by reducing method boilerplate (#8) 2026-05-01 12:29:10 +01:00
types.go Implement variant-aware MCP server (#3) 2026-02-18 12:57:21 +00:00