Skip to content

Commit 7485c5f

Browse files
Document v0.29.0 workload upgrade, mcp call, and CIMD
- Add "Check for and apply upgrades" section to the CLI manage guide covering thv upgrade check/apply and thv list --check-upgrades. Notes local-runtime scope, verify-then-pull ordering, and no-rollback behavior. - Add a "thv mcp call" subsection to the CLI test guide explaining JSON args, mutually exclusive --args/--args-file, and --ignore-tool-error semantics. - Add a Client ID Metadata Document (CIMD) section to the embedded auth server concept doc and a cimd row to the K8s embedded-auth-server configuration reference.
1 parent eb8fb83 commit 7485c5f

4 files changed

Lines changed: 162 additions & 11 deletions

File tree

docs/toolhive/concepts/embedded-auth-server.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,36 @@ DCR-registered client gains the ability to request these scopes, including
166166
public clients like Claude Code, Cursor, and VS Code, so privileged scopes do
167167
not belong in the baseline.
168168

169+
## Client ID Metadata Document (CIMD)
170+
171+
DCR requires every client to register before its first authorization request.
172+
Some MCP clients, including recent VS Code builds, can instead present an HTTPS
173+
URL that hosts a Client ID Metadata Document (CIMD), letting the authorization
174+
server resolve client metadata on demand without a prior registration step.
175+
176+
To allow CIMD-style client IDs, enable CIMD on the embedded authorization
177+
server. When enabled, the server accepts HTTPS URLs as `client_id` values,
178+
fetches the document from the URL, and caches the result. When disabled (the
179+
default), only DCR-registered `client_id` values are accepted.
180+
181+
```yaml
182+
spec:
183+
embeddedAuthServer:
184+
cimd:
185+
enabled: true
186+
cacheMaxSize: 256
187+
cacheFallbackTtl: '5m'
188+
```
189+
190+
`cacheMaxSize` sets the LRU cache capacity (default `256`), and
191+
`cacheFallbackTtl` sets the TTL applied to every cached entry as a Go duration
192+
string (default `5m`). The CIMD fetcher does not yet honor `Cache-Control`
193+
headers; every cached document uses the fallback TTL.
194+
195+
If you also set `baselineClientScopes`, those scopes apply to CIMD-resolved
196+
clients too. Because CIMD clients can be resolved from arbitrary HTTPS URLs,
197+
keep the baseline narrow.
198+
169199
## Session storage
170200

171201
By default, session storage is in-memory. Upstream tokens are lost when pods

docs/toolhive/guides-cli/manage-mcp-servers.mdx

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,92 @@ thv start <REMOTE_SERVER_NAME>
161161

162162
This will always prompt for re-authentication, even if valid tokens exist.
163163

164+
## Check for and apply upgrades
165+
166+
For MCP servers you ran from a registry entry (`thv run <SERVER_NAME>`),
167+
ToolHive can compare each workload's image and configuration against the
168+
registry's current entry and report when a newer version is available. This only
169+
works for registry-sourced workloads on the local runtime; remote servers and
170+
workloads run directly from an image reference report as `not-registry-sourced`.
171+
172+
:::note
173+
174+
Upgrade detection is not yet available for the Kubernetes operator.
175+
176+
:::
177+
178+
### Check for available upgrades
179+
180+
The `thv upgrade check` command is an offline metadata comparison: it inspects
181+
each workload's image tag and configuration against the registry and never pulls
182+
images.
183+
184+
To see a summary table for every workload (including stopped ones):
185+
186+
```bash
187+
thv upgrade check
188+
```
189+
190+
Each row shows the workload's current image, the candidate image the registry
191+
reports, the count of new environment variables the candidate declares, and a
192+
posture marker if the candidate's transport or permission profile differs from
193+
the workload's current configuration. Possible statuses are `up-to-date`,
194+
`upgrade-available`, `not-registry-sourced`, `server-not-found`, and `unknown`.
195+
196+
For a detailed report on a single workload, pass its name:
197+
198+
```bash
199+
thv upgrade check <SERVER_NAME>
200+
```
201+
202+
The detailed report adds the registry server name, any new environment variables
203+
(with their descriptions and whether they're required), and the specific
204+
transport or permission profile changes between the running workload and the
205+
candidate.
206+
207+
You can also surface an upgrade column alongside `thv list` with an opt-in flag:
208+
209+
```bash
210+
thv list --check-upgrades
211+
```
212+
213+
The default `thv list` output is unchanged and performs no registry lookup, so
214+
it stays offline-friendly.
215+
216+
### Apply an upgrade
217+
218+
To upgrade a workload to the candidate image while preserving its configuration
219+
(environment variables, secrets, permission profile, transport, volumes,
220+
middleware), use `thv upgrade apply`:
221+
222+
```bash
223+
thv upgrade apply <SERVER_NAME>
224+
```
225+
226+
ToolHive resolves, verifies, and pulls the candidate image **before** touching
227+
the running workload, then stops the existing workload and starts a new one on
228+
the candidate image. There is no automatic rollback: if recreation fails after
229+
the existing workload is stopped, recovery is a forward operation. For an
230+
interactive session, the command prints what would change and prompts for
231+
confirmation before applying.
232+
233+
If the candidate declares new environment variables or secrets that the workload
234+
does not yet supply, pass them with `--env` or `--secret`:
235+
236+
```bash
237+
thv upgrade apply <SERVER_NAME> --env NEW_FLAG=true --secret api-key,target=API_KEY
238+
```
239+
240+
To preview the planned changes without applying them:
241+
242+
```bash
243+
thv upgrade apply <SERVER_NAME> --dry-run
244+
```
245+
246+
To skip the confirmation prompt (for example, in a script), pass `--yes`. In
247+
non-interactive shells the command runs non-interactively automatically and
248+
fails if any required value is missing.
249+
164250
## Next steps
165251

166252
- [Organize servers into groups](./group-management.mdx) to manage related
@@ -177,3 +263,5 @@ This will always prompt for re-authentication, even if valid tokens exist.
177263
- [`thv stop` command reference](../reference/cli/thv_stop.md)
178264
- [`thv start` command reference](../reference/cli/thv_start.md)
179265
- [`thv rm` command reference](../reference/cli/thv_rm.md)
266+
- [`thv upgrade check` command reference](../reference/cli/thv_upgrade_check.md)
267+
- [`thv upgrade apply` command reference](../reference/cli/thv_upgrade_apply.md)

docs/toolhive/guides-cli/test-mcp-servers.mdx

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ you can interactively test the MCP server's tools, prompts, and resources.
5151

5252
## `thv mcp` commands
5353

54-
ToolHive also includes several
55-
[`thv mcp` commands](../reference/cli/thv_mcp_list.md) to test and validate MCP
56-
servers. You can list the MCP server's tools, prompts, and resources:
54+
ToolHive also includes several [`thv mcp` commands](../reference/cli/thv_mcp.md)
55+
to test and validate MCP servers. You can list the MCP server's tools, prompts,
56+
and resources:
5757

5858
```bash
5959
thv mcp list tools --server <SERVER_NAME_OR_URL>
@@ -78,6 +78,37 @@ directly, like `thv mcp list tools --server http://localhost:12345/mcp`.
7878

7979
:::
8080

81+
### Invoke a tool
82+
83+
`thv mcp list` shows _what_ a server exposes, but not how it behaves. To invoke
84+
a tool directly from the CLI and inspect its result without opening the
85+
Inspector, use `thv mcp call`:
86+
87+
```bash
88+
thv mcp call <TOOL_NAME> --server <SERVER_NAME_OR_URL>
89+
```
90+
91+
Pass arguments as a JSON object via `--args` (inline) or `--args-file` (file
92+
path; use `-` to read from stdin). The two flags are mutually exclusive, and the
93+
parsed value must be a JSON object. If you supply neither flag, the tool is
94+
called with no arguments.
95+
96+
For example, to call the `fetch` tool on a `fetch` MCP server:
97+
98+
```bash
99+
thv mcp call fetch --server fetch --args '{"url":"https://example.com"}'
100+
```
101+
102+
By default, the command exits non-zero when the tool reports an error
103+
(`CallToolResult.IsError=true`); pass `--ignore-tool-error` to exit zero in that
104+
case. Transport and protocol failures always exit non-zero.
105+
106+
Add `--format json` to print the full `CallToolResult` instead of the default
107+
text rendering. This is useful for piping output into other tools or capturing
108+
structured content in scripts.
109+
110+
The `--transport` and `--timeout` flags work the same way as for `thv mcp list`.
111+
81112
## ToolHive playground
82113

83114
While the MCP Inspector and `thv mcp` commands are great for basic functional
@@ -103,3 +134,4 @@ about the playground's features and how to get started.
103134

104135
- [`thv inspector` command reference](../reference/cli/thv_inspector.md)
105136
- [`thv mcp list` command reference](../reference/cli/thv_mcp_list.md)
137+
- [`thv mcp call` command reference](../reference/cli/thv_mcp_call.md)

docs/toolhive/guides-k8s/auth-k8s.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,15 @@ kubectl apply -f embedded-auth-config.yaml
544544

545545
**Configuration reference:**
546546

547-
| Field | Description |
548-
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
549-
| `issuer` | HTTPS URL identifying this authorization server. Appears in the `iss` claim of issued JWTs. |
550-
| `signingKeySecretRefs` | References to Secrets containing JWT signing keys. First key is active; additional keys support rotation. |
551-
| `hmacSecretRefs` | References to Secrets with symmetric keys for signing authorization codes and refresh tokens. |
552-
| `tokenLifespans` | Configurable durations for access tokens (default: 1h), refresh tokens (default: 168h), and auth codes (default: 10m). |
553-
| `upstreamProviders` | Configuration for upstream identity providers. MCPServer and MCPRemoteProxy support one provider; VirtualMCPServer supports multiple providers for sequential authentication. |
554-
| `baselineClientScopes` | Optional list of OAuth 2.0 scopes merged into every DCR-registered client's scope set. Use this when MCP clients register with a narrowed `scope` field but then request wider scopes at `/oauth/authorize`. See [Baseline scopes for DCR clients](../concepts/embedded-auth-server.mdx#baseline-scopes-for-dcr-clients). |
547+
| Field | Description |
548+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
549+
| `issuer` | HTTPS URL identifying this authorization server. Appears in the `iss` claim of issued JWTs. |
550+
| `signingKeySecretRefs` | References to Secrets containing JWT signing keys. First key is active; additional keys support rotation. |
551+
| `hmacSecretRefs` | References to Secrets with symmetric keys for signing authorization codes and refresh tokens. |
552+
| `tokenLifespans` | Configurable durations for access tokens (default: 1h), refresh tokens (default: 168h), and auth codes (default: 10m). |
553+
| `upstreamProviders` | Configuration for upstream identity providers. MCPServer and MCPRemoteProxy support one provider; VirtualMCPServer supports multiple providers for sequential authentication. |
554+
| `baselineClientScopes` | Optional list of OAuth 2.0 scopes merged into every DCR-registered client's scope set. Use this when MCP clients register with a narrowed `scope` field but then request wider scopes at `/oauth/authorize`. See [Baseline scopes for DCR clients](../concepts/embedded-auth-server.mdx#baseline-scopes-for-dcr-clients). |
555+
| `cimd` | Optional Client ID Metadata Document (CIMD) configuration. When `cimd.enabled` is `true`, the auth server accepts HTTPS URLs as `client_id` values and resolves them via CIMD, letting clients (for example, VS Code) authenticate without prior Dynamic Client Registration. See [Client ID Metadata Document (CIMD)](../concepts/embedded-auth-server.mdx#client-id-metadata-document-cimd). |
555556

556557
**Step 5: Create the MCPOIDCConfig and MCPServer resources**
557558

0 commit comments

Comments
 (0)