Skip to content

Commit c58fb9e

Browse files
Update stacklok/toolhive to v0.40.0 (#1043)
* Update stacklok/toolhive to v0.40.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Refresh reference assets for toolhive v0.40.0 * Document --network host / --isolate-network interaction * Clarify network isolation reconciliation admonition * Add upstream-release-docs content for toolhive v0.40.0 --------- 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 d41a0ea commit c58fb9e

7 files changed

Lines changed: 68 additions & 10 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.38.0
47+
version: v0.40.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-cli/network-isolation.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ accepted:
3131
thv run [--permission-profile </path/to/custom-profile.json>] <SERVER>
3232
```
3333

34+
Isolation requires bridge networking. If you also pass `--network host` or
35+
`--network none`, ToolHive drops isolation for that workload (see
36+
[Interaction with `--network host` and `--network none`](#interaction-with---network-host-and---network-none)).
37+
3438
:::info[Changed in v0.30.1]
3539

3640
Earlier versions of ToolHive required `--isolate-network` to turn on network
@@ -201,6 +205,34 @@ thv run --isolate-network=false <SERVER>
201205
The container's own network namespace still isolates it from the host; only
202206
ToolHive's allowlist enforcement is disabled.
203207

208+
## Interaction with `--network host` and `--network none`
209+
210+
Network isolation is a bridge-network construct: the egress, DNS, and ingress
211+
sidecars only work when the MCP container lives on a container-runtime bridge.
212+
When you pass `--network host` or `--network none`, the container shares the
213+
host network namespace or has no network at all, so the isolation sidecars have
214+
no way to intercept traffic. In v0.40.0 and later, ToolHive reconciles the two
215+
flags automatically:
216+
217+
| `--network` mode | `--isolate-network` source | Behavior |
218+
| -------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
219+
| bridge (unset or `bridge`) | any | Isolation as designed. |
220+
| `host` or custom | default (implicit) | Isolation is dropped with a warning in the run log, restoring outbound connectivity for host-networked workloads. |
221+
| `host` or custom | explicit `--isolate-network=true` | `thv run` fails fast with an error naming both flags. Drop `--network host` to keep enforced isolation, or set `--isolate-network=false` to keep host networking. |
222+
| `none` | any | Isolation is silently dropped (`none` is already maximally confined; isolation would be redundant). |
223+
224+
:::info[Changed in v0.40.0]
225+
226+
Before v0.40.0, `thv run --network host` silently built the isolation sidecars
227+
against an internal-only network, breaking outbound DNS and connectivity.
228+
Isolation is now dropped for `host`/`none` modes so host-networked workloads
229+
keep working. If you rely on host networking, no change is needed. If you
230+
previously combined `--isolate-network` with `--network host` explicitly, pick
231+
one: drop `--network host` to keep enforced isolation, or set
232+
`--isolate-network=false` to keep host networking.
233+
234+
:::
235+
204236
## Example: Enable network isolation using registry defaults
205237

206238
Many MCP servers in the ToolHive registry have default permission profiles that

docs/toolhive/reference/cli/thv_llm_config_set.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ thv llm config set [flags]
3131

3232
```
3333
--audience string OIDC audience (optional)
34+
--bedrock-compat Persist Bedrock compatibility for Claude Code (CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 + per-tier Bedrock model IDs). Applied by "thv llm setup". Use --bedrock-compat=false to clear.
3435
--callback-port int OIDC callback port (omit to keep current; default: ephemeral)
3536
--client-id string OIDC client ID
37+
--enable-1m With Bedrock compat, opt into the 1M context window by appending [1m] to opus/sonnet model IDs.
3638
--gateway-url string LLM gateway base URL (must use HTTPS)
3739
-h, --help help for set
3840
--issuer string OIDC issuer URL
41+
--models strings Model IDs to persist and apply during "thv llm setup", comma-separated or by repeating the flag, e.g. --models=us.anthropic.claude-opus-4-8,us.anthropic.claude-sonnet-5. Credential-helper clients (Claude Desktop) write these as inferenceModels; with Bedrock compat, each ID is also mapped to a Claude Code tier by matching 'haiku', 'opus', or 'sonnet' in the ID.
3942
--proxy-port int Localhost proxy listen port (omit to keep current; default: 14000)
4043
--tls-skip-verify Skip TLS certificate verification for the upstream gateway (local dev only; use --tls-skip-verify=false to clear)
4144
```

docs/toolhive/reference/cli/thv_llm_setup.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ Inline flags (--gateway-url, --issuer, --client-id, etc.) are applied for this
4545
run and persisted to config only after login and tool patching succeed. This
4646
lets you combine "config set" and "setup" into a single command.
4747

48+
For a gateway that forwards to AWS Bedrock, add --bedrock-compat to configure
49+
Claude Code with CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 and per-tier Bedrock
50+
model IDs (override with --models; add --enable-1m for the 1M context window on
51+
opus/sonnet). The setting is persisted and only affects Claude Code. To add it to
52+
an already-configured Claude Code, re-run:
53+
54+
thv llm setup --client claude-code --bedrock-compat
55+
56+
Re-running is idempotent and uses the cached token (no browser prompt).
57+
4858
Run "thv llm teardown" to revert all changes.
4959

5060
```
@@ -56,14 +66,16 @@ thv llm setup [flags]
5666
```
5767
--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.
5868
--audience string OIDC audience (optional)
69+
--bedrock-compat Configure Claude Code for a gateway that forwards to AWS Bedrock: write CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 (Bedrock rejects the experimental anthropic-beta headers) and pin per-tier Bedrock model IDs (override with --models). Persisted, so a later plain "thv llm setup" keeps it; clear with --bedrock-compat=false. Only affects Claude Code.
5970
--callback-port int OIDC callback port (omit to keep current; default: ephemeral)
6071
--client string Configure only this AI tool by name (e.g. claude-code, cursor, codex). Omit to configure all detected tools.
6172
--client-id string OIDC client ID
73+
--enable-1m With --bedrock-compat, append the [1m] suffix to the opus and sonnet model IDs to opt into the 1M-token context window on Bedrock (never haiku, which is 200K). Off by default.
6274
--gateway-url string LLM gateway base URL (must use HTTPS)
6375
-h, --help help for setup
6476
--issuer string OIDC issuer URL
6577
--lazy Skip the interactive OIDC login and defer it until the first time a configured tool accesses the gateway. Tool config and persisted settings are written normally. Useful for unattended provisioning (e.g. an MDM profile).
66-
--models strings Explicit model IDs to expose to credential-helper clients (Claude Desktop's inferenceModels). Repeat or comma-separate. Omit to rely on the gateway's own model discovery once it is available.
78+
--models strings Model IDs to configure, comma-separated or by repeating the flag, e.g. --models=us.anthropic.claude-opus-4-8,us.anthropic.claude-sonnet-5. For credential-helper clients (Claude Desktop) these become inferenceModels. With --bedrock-compat, each ID is also mapped to a Claude Code tier by matching 'haiku', 'opus', or 'sonnet' in the ID (IDs matching no tier are ignored with a warning). Omit to use the built-in Bedrock defaults / gateway model discovery.
6779
--proxy-port int Localhost proxy listen port (omit to keep current; default: 14000)
6880
--skip-browser Print the OIDC authorization URL instead of opening a browser, then wait for the callback. Use in headless/SSH/CI environments where no system browser is available.
6981
--tls-skip-verify Skip TLS certificate verification for the upstream gateway (local dev only). For direct-mode tools (Claude Code, Gemini CLI) this sets NODE_TLS_REJECT_UNAUTHORIZED=0, disabling TLS for ALL of that tool's outbound connections. For proxy-mode tools only the proxy-to-gateway connection is affected.

docs/toolhive/reference/cli/thv_run.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ thv run [flags] SERVER_OR_IMAGE_OR_PROTOCOL [-- ARGS...]
128128
--host string Host for the HTTP proxy to listen on (IP or hostname) (default "127.0.0.1")
129129
--ignore-globally Load global ignore patterns from ~/.config/toolhive/thvignore (default true)
130130
--image-verification string Set image verification mode (warn, enabled, disabled) (default "warn")
131-
--isolate-network Isolate the container network from the host. Use --isolate-network=false to opt out. (default true)
131+
--isolate-network Isolate the container network from the host. Use --isolate-network=false to opt out. Not enforced with --network host or --network none (isolation requires bridge networking). (default true)
132132
--jwks-allow-private-ip Allow JWKS/OIDC endpoints on private IP addresses (use with caution) (default false)
133133
--jwks-auth-token-file string Path to file containing bearer token for authenticating JWKS/OIDC requests
134134
-l, --label stringArray Set labels on the container (format: key=value)
135135
--name string Name of the MCP server (default to auto-generated from image)
136-
--network string Connect the container to a network (e.g., 'host' for host networking)
136+
--network string Connect the container to a network (e.g., 'host' for host networking). Note: 'host' and 'none' cannot enforce network isolation, so isolation is dropped for those modes.
137137
--oidc-audience string Expected audience for the token
138138
--oidc-client-id string OIDC client ID
139139
--oidc-client-secret string OIDC client secret (optional, for introspection)

static/api-specs/toolhive-api.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,14 @@ components:
469469
allow_private_ips:
470470
description: |-
471471
AllowPrivateIPs permits the upstream provider's HTTP client to connect to
472-
private IP ranges (RFC-1918, link-local). Use only when the upstream is
473-
hosted inside the same cluster and has no public endpoint. HTTP-scheme
474-
restrictions are unchanged — HTTPS is still required for non-localhost hosts.
475-
Defaults to false.
472+
private IP ranges (RFC-1918, link-local). When DCRConfig is set, this
473+
also gates the DCR discovery and registration calls made on this
474+
upstream's behalf (see pkg/authserver/runner/dcr_adapter.go), so a
475+
single flag covers the whole upstream rather than needing a separate
476+
DCR-specific setting. Use only when the upstream is hosted inside the
477+
same cluster and has no public endpoint. HTTP-scheme restrictions are
478+
unchanged — HTTPS is still required for non-localhost hosts. Defaults
479+
to false.
476480
type: boolean
477481
authorization_endpoint:
478482
description: AuthorizationEndpoint is the URL for the OAuth authorization
@@ -2294,13 +2298,13 @@ components:
22942298
uniqueItems: false
22952299
registryBaseUrl:
22962300
description: RegistryBaseURL is the base URL of the package registry (used
2297-
by npm, pypi, nuget; not used by oci, mcpb)
2301+
by npm, pypi, nuget, cargo; not used by oci, mcpb)
22982302
example: https://registry.npmjs.org
22992303
format: uri
23002304
type: string
23012305
registryType:
23022306
description: RegistryType indicates how to download packages (e.g., "npm",
2303-
"pypi", "oci", "nuget", "mcpb")
2307+
"pypi", "cargo", "oci", "nuget", "mcpb")
23042308
example: npm
23052309
minLength: 1
23062310
type: string

static/api-specs/upstream-registry.schema.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@
5555
"items": {
5656
"$ref": "https://raw.githubusercontent.com/stacklok/toolhive-core/main/registry/types/data/skill.schema.json"
5757
}
58+
},
59+
"plugins": {
60+
"type": "array",
61+
"description": "Array of plugins in the registry",
62+
"items": {
63+
"$ref": "https://raw.githubusercontent.com/stacklok/toolhive-core/main/registry/types/data/plugin.schema.json"
64+
}
5865
}
5966
}
6067
}

0 commit comments

Comments
 (0)