Skip to content

Commit 258632c

Browse files
danbarrclaude[bot]ChrisJBurns
authored
Add runconfig import/export documentation (#142)
Signed-off-by: Dan Barr <[email protected]> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Chris Burns <[email protected]> Co-authored-by: Dan Barr <[email protected]>
1 parent e5b77c1 commit 258632c

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,57 @@ thv run uvx://some-package
465465
thv run --ca-cert /path/to/special-ca.crt uvx://other-package
466466
```
467467

468+
## Share and reuse server configurations
469+
470+
ToolHive allows you to export a server's configuration and run servers using
471+
previously exported configurations. This is useful for:
472+
473+
- Sharing server setups with team members
474+
- Creating backups of complex configurations
475+
- Running identical server instances across different environments
476+
477+
### Export a server configuration
478+
479+
To export a running server's configuration to a file, use the
480+
[`thv export`](../reference/cli/thv_export.md) command:
481+
482+
```bash
483+
thv export <server-name> <output-file>
484+
```
485+
486+
For example, to export the configuration of a running server named "fetch":
487+
488+
```bash
489+
thv export fetch ./fetch-config.json
490+
```
491+
492+
This creates a JSON file containing all the server's configuration, including:
493+
494+
- Container image and version
495+
- Environment variables and secrets references
496+
- Volume mounts and permissions
497+
- Network settings
498+
- Transport configuration
499+
500+
### Run a server from an exported configuration
501+
502+
To run a server using a previously exported configuration, use the
503+
[`thv run`](../reference/cli/thv_run.md) command with the `--from-config` flag:
504+
505+
```bash
506+
thv run --from-config <config-file>
507+
```
508+
509+
For example, to run a server using the exported configuration:
510+
511+
```bash
512+
thv run --from-config ./fetch-config.json
513+
```
514+
515+
This creates a new server instance with identical settings to the original. If
516+
the original server used secrets, you must have the same secrets available in
517+
your ToolHive secrets store.
518+
468519
## Next steps
469520

470521
See [Monitor and manage MCP servers](./manage-mcp-servers.md) to monitor and

docs/toolhive/tutorials/quickstart-cli.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ server. Here are some next steps to explore:
293293
servers that require authentication
294294
- Explore [custom permissions](../guides-cli/custom-permissions.mdx) for MCP
295295
servers
296+
- Learn how to
297+
[share and reuse server configurations](../guides-cli/run-mcp-servers.mdx#share-and-reuse-server-configurations)
298+
using the export and import functionality
296299
- Set up [shell completion](../guides-cli/install.mdx#enable-shell-completion)
297300
to make ToolHive commands easier to use
298301
- Learn how to [upgrade ToolHive](../guides-cli/install.mdx#upgrade-toolhive)

0 commit comments

Comments
 (0)