Skip to content

Commit b6f4a86

Browse files
Update stacklok/toolhive to v0.38.0 (#1035)
* Update stacklok/toolhive to v0.38.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Refresh reference assets for toolhive v0.38.0 * Document podTemplateSpec on MCPRemoteProxy for v0.37.0 Covers the new spec.podTemplateSpec field added in stacklok/toolhive#5531. Adds a "Customize the remote proxy pod" section modeled on the parallel MCPServer pattern (container name toolhive, not mcp) and notes the new PodTemplateValid condition in the status section. * Fix inaccurate example list in podTemplateSpec section spec.resources is a first-class field on MCPRemoteProxy, so listing resource limits among options 'not exposed as first-class fields' is misleading. Swap for affinity rules, which genuinely require podTemplateSpec. --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
1 parent 3f7484d commit b6f4a86

5 files changed

Lines changed: 103 additions & 5 deletions

File tree

.github/upstream-projects.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ projects:
4444

4545
- id: toolhive
4646
repo: stacklok/toolhive
47-
version: v0.35.0
47+
version: v0.38.0
4848
# toolhive is a monorepo covering the CLI, the Kubernetes
4949
# operator, and the vMCP gateway. It also introduces cross-
5050
# cutting features that land in concepts/, integrations/,

docs/toolhive/guides-k8s/remote-mcp-proxy.mdx

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,62 @@ via `AssumeRoleWithWebIdentity` and signs requests with SigV4. See the
455455

456456
:::
457457

458+
### Customize the remote proxy pod
459+
460+
Use `podTemplateSpec` to set pod-level options that aren't exposed as
461+
first-class fields on `MCPRemoteProxy`, such as security contexts, node
462+
selectors, tolerations, and affinity rules. The field follows the standard
463+
Kubernetes
464+
[`PodTemplateSpec`](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-template-v1/#PodTemplateSpec)
465+
format, and you only need to specify the fields you want to add or override.
466+
467+
This example sets resource limits on the proxy container and adds a node
468+
selector:
469+
470+
```yaml {15-27} title="analytics-proxy-custom-pod.yaml"
471+
apiVersion: toolhive.stacklok.dev/v1beta1
472+
kind: MCPRemoteProxy
473+
metadata:
474+
name: analytics-proxy
475+
namespace: toolhive-system
476+
spec:
477+
remoteUrl: https://mcp.analytics.example.com
478+
proxyPort: 8080
479+
transport: streamable-http
480+
481+
oidcConfigRef:
482+
name: analytics-oidc
483+
audience: analytics-mcp-proxy
484+
485+
podTemplateSpec:
486+
spec:
487+
nodeSelector:
488+
workload-tier: platform
489+
containers:
490+
- name: toolhive # This name must be "toolhive"
491+
resources:
492+
limits:
493+
cpu: '500m'
494+
memory: '512Mi'
495+
requests:
496+
cpu: '100m'
497+
memory: '128Mi'
498+
```
499+
500+
:::info[Container name requirement]
501+
502+
To override the proxy container, use `name: toolhive`. The operator applies
503+
overrides by matching the container name; any other name adds a sidecar instead.
504+
This differs from [`MCPServer`](./run-mcp-k8s.mdx#customize-the-mcp-server-pod),
505+
where the main container is `mcp`.
506+
507+
:::
508+
509+
If the pod template fails validation, the operator sets the `PodTemplateValid`
510+
condition to `False`, moves the resource to phase `Failed`, and stops updating
511+
the Deployment. See [Check remote proxy status](#check-remote-proxy-status) to
512+
inspect the failure message.
513+
458514
### Inject custom headers
459515

460516
Some remote MCP servers require custom headers for tenant identification, API
@@ -742,7 +798,9 @@ The status shows:
742798
- **Phase**: Current state (Pending, Ready, Failed, Terminating)
743799
- **URL**: Internal cluster URL
744800
- **External URL**: External URL if exposed via Ingress
745-
- **Conditions**: Detailed status conditions
801+
- **Conditions**: Detailed status conditions, including `PodTemplateValid` when
802+
you use [`podTemplateSpec`](#customize-the-remote-proxy-pod). Check the
803+
`message` field of any condition reporting `status: "False"` to see why.
746804
747805
## Telemetry and observability
748806

docs/toolhive/reference/cli/thv_llm_setup.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Configure detected AI tools to use the LLM gateway
1616
### Synopsis
1717

1818
Detect installed AI tools (Claude Code, Gemini CLI, Cursor, VS Code, Xcode,
19-
Claude Desktop) and patch each tool's configuration to route through the LLM
20-
gateway.
19+
Claude Desktop, Codex) and patch each tool's configuration to route through the
20+
LLM gateway.
2121

2222
Token-helper tools (Claude Code, Gemini CLI) are configured to call
2323
"thv llm token" to obtain a fresh OIDC token on demand.
@@ -27,6 +27,14 @@ which also calls "thv llm token". It reads its configuration only at launch, so
2727
fully quit and relaunch it after setup. Pass --models to list the models it
2828
should offer until the gateway serves model discovery itself.
2929

30+
Codex CLI and the ChatGPT desktop app use the same user configuration:
31+
~/.codex/config.toml by default, or %USERPROFILE%\.codex\config.toml on Windows.
32+
ToolHive adds a custom model_provider whose auth command invokes "thv llm token"
33+
directly (no shell), keeping existing model_providers and mcp_servers entries
34+
untouched. Desktop app detection is supported on macOS and Windows; the canonical
35+
--client target remains "codex". If the desktop app is running, fully quit and
36+
reopen it after setup.
37+
3038
Proxy-mode tools (Cursor, VS Code, Xcode) are configured to send requests to
3139
the localhost reverse proxy started by "thv llm proxy start".
3240

@@ -49,7 +57,7 @@ thv llm setup [flags]
4957
--anthropic-path-prefix string Path prefix appended to the gateway URL when writing ANTHROPIC_BASE_URL for direct-mode tools (e.g. /anthropic). When omitted, the gateway is probed automatically.
5058
--audience string OIDC audience (optional)
5159
--callback-port int OIDC callback port (omit to keep current; default: ephemeral)
52-
--client string Configure only this AI tool by name (e.g. claude-code, cursor). Omit to configure all detected tools.
60+
--client string Configure only this AI tool by name (e.g. claude-code, cursor, codex). Omit to configure all detected tools.
5361
--client-id string OIDC client ID
5462
--gateway-url string LLM gateway base URL (must use HTTPS)
5563
-h, --help help for setup

static/api-specs/toolhive-api.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,19 @@ components:
11021102
An empty string signals "use the default for this transport type" during config merging.
11031103
Examples: "golang:1.26-alpine", "node:24-alpine", "python:3.14-slim"
11041104
type: string
1105+
runtime_env:
1106+
additionalProperties:
1107+
type: string
1108+
description: |-
1109+
RuntimeEnv contains environment variables to inject into the Dockerfile's
1110+
final runtime stage. Unlike BuildEnv (pkg/container/templates.TemplateData.BuildEnv),
1111+
which only affects the builder stage, these variables are baked into the
1112+
shipped image and are present in the running container's process
1113+
environment at startup. Use this for values a packaged MCP server reads at
1114+
process start (e.g. feature flags, cache backend selection), not for
1115+
build-time package manager configuration.
1116+
Keys must be uppercase with underscores, values are validated for safety.
1117+
type: object
11051118
type: object
11061119
github_com_stacklok_toolhive_pkg_core.Workload:
11071120
properties:
@@ -2572,6 +2585,13 @@ components:
25722585
pkg_api_v1.createRequest:
25732586
description: Request to create a new workload
25742587
properties:
2588+
allow_docker_gateway:
2589+
description: |-
2590+
Whether to permit outbound connections to Docker gateway addresses
2591+
(host.docker.internal, gateway.docker.internal, 172.17.0.1). These are
2592+
blocked by default in the egress proxy even when network isolation is on.
2593+
Only applicable to Docker deployments with network isolation enabled.
2594+
type: boolean
25752595
authz_config:
25762596
description: Authorization configuration
25772597
type: string
@@ -3104,6 +3124,13 @@ components:
31043124
pkg_api_v1.updateRequest:
31053125
description: Request to update an existing workload (name cannot be changed)
31063126
properties:
3127+
allow_docker_gateway:
3128+
description: |-
3129+
Whether to permit outbound connections to Docker gateway addresses
3130+
(host.docker.internal, gateway.docker.internal, 172.17.0.1). These are
3131+
blocked by default in the egress proxy even when network isolation is on.
3132+
Only applicable to Docker deployments with network isolation enabled.
3133+
type: boolean
31073134
authz_config:
31083135
description: Authorization configuration
31093136
type: string

static/api-specs/toolhive-crds/mcpremoteproxies.schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,11 @@
273273
],
274274
"type": "object"
275275
},
276+
"podTemplateSpec": {
277+
"description": "PodTemplateSpec defines the pod template to use for the MCPRemoteProxy\nThis allows for customizing the pod configuration beyond what is provided by the other fields.\nNote that to modify the specific container the remote proxy runs in, you must specify\nthe `toolhive` container name in the PodTemplateSpec.\nThis field accepts a PodTemplateSpec object as JSON/YAML.",
278+
"type": "object",
279+
"x-kubernetes-preserve-unknown-fields": true
280+
},
276281
"proxyPort": {
277282
"default": 8080,
278283
"description": "ProxyPort is the port to expose the MCP proxy on",

0 commit comments

Comments
 (0)