Problem
pkg/vmcp/server.Server accepts a SessionStorage *vmcpconfig.SessionStorageConfig whose Provider field is enum-validated at memory or redis. The internal helper buildSessionDataStorage (pkg/vmcp/server/server.go:263-291) hardcodes transportsession.NewLocalSessionDataStorage or transportsession.NewRedisSessionDataStorage based on that enum. There is no way for an embedder to inject a transportsession.DataStorage implementation of its own — the interface is public but the server has no seam to accept one.
Use case
Deployments that already run an operational datastore other than Redis (Postgres, DynamoDB, Spanner, MongoDB, etc.) can satisfy transportsession.DataStorage against that datastore to avoid adding Redis purely for MCP session persistence. Today they have to either fork server.go or fall back to in-memory sessions (no persistence across pod restarts).
Proposed API
Add a DataStorage transportsession.DataStorage field to server.Config (or a functional-option equivalent). When set, buildSessionDataStorage short-circuits and returns the caller-supplied implementation; when nil, existing behaviour is preserved. Backwards-compatible.
Alternative: add server.WithDataStorage(ds transportsession.DataStorage) Option and thread it through New(...).
Scope
- Purely additive.
- No change to
transportsession.DataStorage itself — the contract is already public and stable.
- No change to the
memory / redis fast paths.
Problem
pkg/vmcp/server.Serveraccepts aSessionStorage *vmcpconfig.SessionStorageConfigwhoseProviderfield is enum-validated atmemoryorredis. The internal helperbuildSessionDataStorage(pkg/vmcp/server/server.go:263-291) hardcodestransportsession.NewLocalSessionDataStorageortransportsession.NewRedisSessionDataStoragebased on that enum. There is no way for an embedder to inject atransportsession.DataStorageimplementation of its own — the interface is public but the server has no seam to accept one.Use case
Deployments that already run an operational datastore other than Redis (Postgres, DynamoDB, Spanner, MongoDB, etc.) can satisfy
transportsession.DataStorageagainst that datastore to avoid adding Redis purely for MCP session persistence. Today they have to either forkserver.goor fall back to in-memory sessions (no persistence across pod restarts).Proposed API
Add a
DataStorage transportsession.DataStoragefield toserver.Config(or a functional-option equivalent). When set,buildSessionDataStorageshort-circuits and returns the caller-supplied implementation; when nil, existing behaviour is preserved. Backwards-compatible.Alternative: add
server.WithDataStorage(ds transportsession.DataStorage) Optionand thread it throughNew(...).Scope
transportsession.DataStorageitself — the contract is already public and stable.memory/redisfast paths.