@@ -17,7 +17,7 @@ Run an MCP server
1717
1818Run an MCP server with the specified name, image, or protocol scheme.
1919
20- ToolHive supports four ways to run an MCP server:
20+ ToolHive supports five ways to run an MCP server:
2121
22221 . From the registry:
2323
@@ -50,6 +50,14 @@ ToolHive supports four ways to run an MCP server:
5050
5151 Runs an MCP server using a previously exported configuration file.
5252
53+ 5 . Remote MCP server:
54+
55+ $ thv run <URL> [--name <name>]
56+
57+ Runs a remote MCP server as a workload, proxying requests to the specified URL.
58+ This allows remote MCP servers to be managed like local workloads with full
59+ support for client configuration, tool filtering, import/export, etc.
60+
5361The container will be started with the specified transport mode and
5462permission profile. Additional configuration can be provided via flags.
5563
@@ -60,50 +68,61 @@ thv run [flags] SERVER_OR_IMAGE_OR_PROTOCOL [-- ARGS...]
6068### Options
6169
6270```
63- --audit-config string Path to the audit configuration file
64- --authz-config string Path to the authorization configuration file
65- --ca-cert string Path to a custom CA certificate file to use for container builds
66- --enable-audit Enable audit logging with default configuration
67- -e, --env stringArray Environment variables to pass to the MCP server (format: KEY=VALUE)
68- --env-file string Load environment variables from a single file
69- --env-file-dir string Load environment variables from all files in a directory
70- -f, --foreground Run in foreground mode (block until container exits)
71- --from-config string Load configuration from exported file
72- --group string Name of the group this workload belongs to (defaults to 'default' if not specified) (default "default")
73- -h, --help help for run
74- --host string Host for the HTTP proxy to listen on (IP or hostname) (default "127.0.0.1")
75- --ignore-globally Load global ignore patterns from ~/.config/toolhive/thvignore (default true)
76- --image-verification string Set image verification mode (warn, enabled, disabled) (default "warn")
77- --isolate-network Isolate the container network from the host (default: false)
78- --jwks-allow-private-ip Allow JWKS/OIDC endpoints on private IP addresses (use with caution)
79- --jwks-auth-token-file string Path to file containing bearer token for authenticating JWKS/OIDC requests
80- -l, --label stringArray Set labels on the container (format: key=value)
81- --name string Name of the MCP server (auto-generated from image if not provided)
82- --oidc-audience string Expected audience for the token
83- --oidc-client-id string OIDC client ID
84- --oidc-client-secret string OIDC client secret (optional, for introspection)
85- --oidc-introspection-url string URL for token introspection endpoint
86- --oidc-issuer string OIDC issuer URL (e.g., https://accounts.google.com)
87- --oidc-jwks-url string URL to fetch the JWKS from
88- --otel-enable-prometheus-metrics-path Enable Prometheus-style /metrics endpoint on the main transport port
89- --otel-endpoint string OpenTelemetry OTLP endpoint URL (e.g., https://api.honeycomb.io)
90- --otel-env-vars stringArray Environment variable names to include in OpenTelemetry spans (comma-separated: ENV1,ENV2)
91- --otel-headers stringArray OpenTelemetry OTLP headers in key=value format (e.g., x-honeycomb-team=your-api-key)
92- --otel-insecure Connect to the OpenTelemetry endpoint using HTTP instead of HTTPS
93- --otel-sampling-rate float OpenTelemetry trace sampling rate (0.0-1.0) (default 0.1)
94- --otel-service-name string OpenTelemetry service name (defaults to toolhive-mcp-proxy)
95- --permission-profile string Permission profile to use (none, network, or path to JSON file)
96- --print-resolved-overlays Debug: show resolved container paths for tmpfs overlays
97- --proxy-mode string Proxy mode for stdio transport (sse or streamable-http) (default "sse")
98- --proxy-port int Port for the HTTP proxy to listen on (host port)
99- --resource-url string Explicit resource URL for OAuth discovery endpoint (RFC 9728)
100- --secret stringArray Specify a secret to be fetched from the secrets manager and set as an environment variable (format: NAME,target=TARGET)
101- --target-host string Host to forward traffic to (only applicable to SSE or Streamable HTTP transport) (default "127.0.0.1")
102- --target-port int Port for the container to expose (only applicable to SSE or Streamable HTTP transport)
103- --thv-ca-bundle string Path to CA certificate bundle for ToolHive HTTP operations (JWKS, OIDC discovery, etc.)
104- --tools stringArray Filter MCP server tools (comma-separated list of tool names)
105- --transport string Transport mode (sse, streamable-http or stdio)
106- -v, --volume stringArray Mount a volume into the container (format: host-path:container-path[:ro])
71+ --audit-config string Path to the audit configuration file
72+ --authz-config string Path to the authorization configuration file
73+ --ca-cert string Path to a custom CA certificate file to use for container builds
74+ --enable-audit Enable audit logging with default configuration
75+ -e, --env stringArray Environment variables to pass to the MCP server (format: KEY=VALUE)
76+ --env-file string Load environment variables from a single file
77+ --env-file-dir string Load environment variables from all files in a directory
78+ -f, --foreground Run in foreground mode (block until container exits)
79+ --from-config string Load configuration from exported file
80+ --group string Name of the group this workload belongs to (defaults to 'default' if not specified) (default "default")
81+ -h, --help help for run
82+ --host string Host for the HTTP proxy to listen on (IP or hostname) (default "127.0.0.1")
83+ --ignore-globally Load global ignore patterns from ~/.config/toolhive/thvignore (default true)
84+ --image-verification string Set image verification mode (warn, enabled, disabled) (default "warn")
85+ --isolate-network Isolate the container network from the host (default: false)
86+ --jwks-allow-private-ip Allow JWKS/OIDC endpoints on private IP addresses (use with caution)
87+ --jwks-auth-token-file string Path to file containing bearer token for authenticating JWKS/OIDC requests
88+ -l, --label stringArray Set labels on the container (format: key=value)
89+ --name string Name of the MCP server (auto-generated from image if not provided)
90+ --oidc-audience string Expected audience for the token
91+ --oidc-client-id string OIDC client ID
92+ --oidc-client-secret string OIDC client secret (optional, for introspection)
93+ --oidc-introspection-url string URL for token introspection endpoint
94+ --oidc-issuer string OIDC issuer URL (e.g., https://accounts.google.com)
95+ --oidc-jwks-url string URL to fetch the JWKS from
96+ --otel-enable-prometheus-metrics-path Enable Prometheus-style /metrics endpoint on the main transport port
97+ --otel-endpoint string OpenTelemetry OTLP endpoint URL (e.g., https://api.honeycomb.io)
98+ --otel-env-vars stringArray Environment variable names to include in OpenTelemetry spans (comma-separated: ENV1,ENV2)
99+ --otel-headers stringArray OpenTelemetry OTLP headers in key=value format (e.g., x-honeycomb-team=your-api-key)
100+ --otel-insecure Connect to the OpenTelemetry endpoint using HTTP instead of HTTPS
101+ --otel-sampling-rate float OpenTelemetry trace sampling rate (0.0-1.0) (default 0.1)
102+ --otel-service-name string OpenTelemetry service name (defaults to toolhive-mcp-proxy)
103+ --permission-profile string Permission profile to use (none, network, or path to JSON file)
104+ --print-resolved-overlays Debug: show resolved container paths for tmpfs overlays
105+ --proxy-mode string Proxy mode for stdio transport (sse or streamable-http) (default "sse")
106+ --proxy-port int Port for the HTTP proxy to listen on (host port)
107+ --remote-auth Enable OAuth/OIDC authentication to remote MCP server
108+ --remote-auth-authorize-url string OAuth authorization endpoint URL (alternative to --remote-auth-issuer for non-OIDC OAuth)
109+ --remote-auth-callback-port int Port for OAuth callback server during remote authentication (default 8666)
110+ --remote-auth-client-id string OAuth client ID for remote server authentication
111+ --remote-auth-client-secret string OAuth client secret for remote server authentication (optional for PKCE)
112+ --remote-auth-client-secret-file string Path to file containing OAuth client secret (alternative to --remote-auth-client-secret)
113+ --remote-auth-issuer string OAuth/OIDC issuer URL for remote server authentication (e.g., https://accounts.google.com)
114+ --remote-auth-scopes strings OAuth scopes to request for remote server authentication (defaults: OIDC uses 'openid,profile,email')
115+ --remote-auth-skip-browser Skip opening browser for remote server OAuth flow
116+ --remote-auth-timeout duration Timeout for OAuth authentication flow (e.g., 30s, 1m, 2m30s) (default 30s)
117+ --remote-auth-token-url string OAuth token endpoint URL (alternative to --remote-auth-issuer for non-OIDC OAuth)
118+ --resource-url string Explicit resource URL for OAuth discovery endpoint (RFC 9728)
119+ --secret stringArray Specify a secret to be fetched from the secrets manager and set as an environment variable (format: NAME,target=TARGET)
120+ --target-host string Host to forward traffic to (only applicable to SSE or Streamable HTTP transport) (default "127.0.0.1")
121+ --target-port int Port for the container to expose (only applicable to SSE or Streamable HTTP transport)
122+ --thv-ca-bundle string Path to CA certificate bundle for ToolHive HTTP operations (JWKS, OIDC discovery, etc.)
123+ --tools stringArray Filter MCP server tools (comma-separated list of tool names)
124+ --transport string Transport mode (sse, streamable-http or stdio)
125+ -v, --volume stringArray Mount a volume into the container (format: host-path:container-path[:ro])
107126```
108127
109128### Options inherited from parent commands
0 commit comments