Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/toolhive/reference/cli/thv_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ thv run [flags] SERVER_OR_IMAGE_OR_PROTOCOL [-- ARGS...]
### Options

```
--allow-docker-gateway Allow outbound connections to Docker gateway addresses (host.docker.internal, gateway.docker.internal, 172.17.0.1). Only applies when --isolate-network is set. These are blocked by default even when insecure_allow_all is enabled.
--audit-config string Path to the audit configuration file
--authz-config string Path to the authorization configuration file
--ca-cert string Path to a custom CA certificate file to use for container builds
Expand Down
29 changes: 25 additions & 4 deletions docs/toolhive/reference/crd-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ _Appears in:_
| `telemetry` _[pkg.telemetry.Config](#pkgtelemetryconfig)_ | Telemetry configures OpenTelemetry-based observability for the Virtual MCP server<br />including distributed tracing, OTLP metrics export, and Prometheus metrics endpoint. | | Optional: \{\} <br /> |
| `audit` _[pkg.audit.Config](#pkgauditconfig)_ | Audit configures audit logging for the Virtual MCP server.<br />When present, audit logs include MCP protocol operations.<br />See audit.Config for available configuration options. | | Optional: \{\} <br /> |
| `optimizer` _[vmcp.config.OptimizerConfig](#vmcpconfigoptimizerconfig)_ | Optimizer configures the MCP optimizer for context optimization on large toolsets.<br />When enabled, vMCP exposes only find_tool and call_tool operations to clients<br />instead of all backend tools directly. This reduces token usage by allowing<br />LLMs to discover relevant tools on demand rather than receiving all tool definitions. | | Optional: \{\} <br /> |
| `sessionStorage` _[vmcp.config.SessionStorageConfig](#vmcpconfigsessionstorageconfig)_ | SessionStorage configures session storage for stateful horizontal scaling.<br />When provider is "redis", the operator injects Redis connection parameters<br />(address, db, keyPrefix) here. The Redis password is provided separately via<br />the THV_SESSION_REDIS_PASSWORD environment variable. | | Optional: \{\} <br /> |


#### vmcp.config.ConflictResolutionConfig
Expand Down Expand Up @@ -502,6 +503,27 @@ _Appears in:_
| `default` _[pkg.json.Any](#pkgjsonany)_ | Default is the fallback value if template expansion fails.<br />Type coercion is applied to match the declared Type. | | Schemaless: \{\} <br />Optional: \{\} <br /> |


#### vmcp.config.SessionStorageConfig



SessionStorageConfig configures session storage for stateful horizontal scaling.
The Redis password is not stored here; it is injected as the THV_SESSION_REDIS_PASSWORD
environment variable by the operator when spec.sessionStorage.passwordRef is set.



_Appears in:_
- [vmcp.config.Config](#vmcpconfigconfig)

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `provider` _string_ | Provider is the session storage backend type. | | Enum: [memory redis] <br />Required: \{\} <br /> |
| `address` _string_ | Address is the Redis server address (required when provider is redis). | | Optional: \{\} <br /> |
| `db` _integer_ | DB is the Redis database number. | 0 | Minimum: 0 <br />Optional: \{\} <br /> |
| `keyPrefix` _string_ | KeyPrefix is an optional prefix for all Redis keys used by ToolHive. | | Optional: \{\} <br /> |


#### vmcp.config.StaticBackendConfig


Expand Down Expand Up @@ -991,6 +1013,7 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `issuer` _string_ | Issuer is the issuer identifier for this authorization server.<br />This will be included in the "iss" claim of issued tokens.<br />Must be a valid HTTPS URL (or HTTP for localhost) without query, fragment, or trailing slash (per RFC 8414). | | Pattern: `^https?://[^\s?#]+[^/\s?#]$` <br />Required: \{\} <br /> |
| `authorizationEndpointBaseUrl` _string_ | AuthorizationEndpointBaseURL overrides the base URL used for the authorization_endpoint<br />in the OAuth discovery document. When set, the discovery document will advertise<br />`\{authorizationEndpointBaseUrl\}/oauth/authorize` instead of `\{issuer\}/oauth/authorize`.<br />All other endpoints (token, registration, JWKS) remain derived from the issuer.<br />This is useful when the browser-facing authorization endpoint needs to be on a<br />different host than the issuer used for backend-to-backend calls.<br />Must be a valid HTTPS URL (or HTTP for localhost) without query, fragment, or trailing slash. | | Pattern: `^https?://[^\s?#]+[^/\s?#]$` <br />Optional: \{\} <br /> |
| `signingKeySecretRefs` _[api.v1alpha1.SecretKeyRef](#apiv1alpha1secretkeyref) array_ | SigningKeySecretRefs references Kubernetes Secrets containing signing keys for JWT operations.<br />Supports key rotation by allowing multiple keys (oldest keys are used for verification only).<br />If not specified, an ephemeral signing key will be auto-generated (development only -<br />JWTs will be invalid after restart). | | MaxItems: 5 <br />Optional: \{\} <br /> |
| `hmacSecretRefs` _[api.v1alpha1.SecretKeyRef](#apiv1alpha1secretkeyref) array_ | HMACSecretRefs references Kubernetes Secrets containing symmetric secrets for signing<br />authorization codes and refresh tokens (opaque tokens).<br />Current secret must be at least 32 bytes and cryptographically random.<br />Supports secret rotation via multiple entries (first is current, rest are for verification).<br />If not specified, an ephemeral secret will be auto-generated (development only -<br />auth codes and refresh tokens will be invalid after restart). | | Optional: \{\} <br /> |
| `tokenLifespans` _[api.v1alpha1.TokenLifespanConfig](#apiv1alpha1tokenlifespanconfig)_ | TokenLifespans configures the duration that various tokens are valid.<br />If not specified, defaults are applied (access: 1h, refresh: 7d, authCode: 10m). | | Optional: \{\} <br /> |
Expand Down Expand Up @@ -2698,10 +2721,8 @@ SessionStorageConfig defines session storage configuration for horizontal scalin
This is the CRD/K8s-aware surface: it uses SecretKeyRef for secret resolution.
The reconciler resolves PasswordRef to a plain string and builds a
session.RedisConfig (pkg/transport/session) for the actual storage backend.

vMCP process receives session storage config through the existing config injection
path (same as Optimizer and Audit). The CRD type will remain separate because
PasswordRef is K8s-specific and gets resolved away before the config-pkg type.
The operator also populates pkg/vmcp/config.SessionStorageConfig (without PasswordRef)
into the vMCP ConfigMap so the vMCP process receives connection parameters at startup.



Expand Down
14 changes: 14 additions & 0 deletions static/api-specs/toolhive-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,13 @@ components:
type: string
type: array
uniqueItems: false
authorization_endpoint_base_url:
description: |-
AuthorizationEndpointBaseURL overrides the base URL used for the authorization_endpoint
in the OAuth discovery document. When set, the discovery document will advertise
`{authorization_endpoint_base_url}/oauth/authorize` instead of `{issuer}/oauth/authorize`.
All other endpoints remain derived from the issuer.
type: string
hmac_secret_files:
description: |-
HMACSecretFiles contains file paths to HMAC secrets for signing authorization codes
Expand Down Expand Up @@ -869,6 +876,13 @@ components:
type: object
github_com_stacklok_toolhive_pkg_runner.RunConfig:
properties:
allow_docker_gateway:
description: |-
AllowDockerGateway permits outbound connections to Docker gateway addresses
(host.docker.internal, gateway.docker.internal, 172.17.0.1). These are
blocked by default in the egress proxy even when InsecureAllowAll is set.
Only applicable to Docker deployments with network isolation enabled.
type: boolean
audit_config:
$ref: '#/components/schemas/github_com_stacklok_toolhive_pkg_audit.Config'
audit_config_path:
Expand Down