Summary
ToolHive's --stateless flag (stacklok/toolhive#4515) lets the proxy handle stateless streamable-HTTP servers correctly — servers like Spring AI's WebMvcStatelessServerTransport that accept POST only and don't serve SSE on GET. The flag works, but it's a CLI-only property. The registry schema has no way to express it.
This means every user running a stateless server through a registry must know to pass --stateless manually. The registry should be the single source of truth for how to run a server. Transport type, proxy port, and OAuth config are all declarable in the registry today. Stateless mode is the same kind of property.
Proposed change
Add a Stateless bool field to BaseServerMetadata, ServerExtensions, and the JSON schemas (legacy registry and publisher-provided). Update the bidirectional converters to preserve the field through round-trips.
This is the type-system half. A follow-up PR against stacklok/toolhive will read this field in buildRunnerConfig so that thv run <server> applies stateless mode automatically when the registry declares it.
Downstream impact
The ServerMetadata interface gains GetStateless() bool, following the pattern of the 14 existing BaseServerMetadata getters. No downstream repo implements ServerMetadata directly. The field uses omitempty and defaults to false, so existing registry data is unaffected.
Summary
ToolHive's
--statelessflag (stacklok/toolhive#4515) lets the proxy handle stateless streamable-HTTP servers correctly — servers like Spring AI'sWebMvcStatelessServerTransportthat accept POST only and don't serve SSE on GET. The flag works, but it's a CLI-only property. The registry schema has no way to express it.This means every user running a stateless server through a registry must know to pass
--statelessmanually. The registry should be the single source of truth for how to run a server. Transport type, proxy port, and OAuth config are all declarable in the registry today. Stateless mode is the same kind of property.Proposed change
Add a
Stateless boolfield toBaseServerMetadata,ServerExtensions, and the JSON schemas (legacy registry and publisher-provided). Update the bidirectional converters to preserve the field through round-trips.This is the type-system half. A follow-up PR against stacklok/toolhive will read this field in
buildRunnerConfigso thatthv run <server>applies stateless mode automatically when the registry declares it.Downstream impact
The
ServerMetadatainterface gainsGetStateless() bool, following the pattern of the 14 existingBaseServerMetadatagetters. No downstream repo implementsServerMetadatadirectly. The field usesomitemptyand defaults tofalse, so existing registry data is unaffected.