Skip to content

Add stateless field to registry server types #88

@gkatz2

Description

@gkatz2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions