thv build
Build a container for an MCP server without running it
Synopsis
Build a container for an MCP server using a protocol scheme without running it.
ToolHive supports building containers from protocol schemes:
$ thv build uvx://package-name
$ thv build npx://package-name
$ thv build go://package-name
$ thv build go://./local-path
Automatically generates a container that can run the specified package using either uvx (Python with uv package manager), npx (Node.js), or go (Golang). For Go, you can also specify local paths starting with './' or '../' to build local Go projects.
The container will be built and tagged locally, ready to be used with 'thv run' or other container tools. The built image name will be displayed upon successful completion.
Examples: $ thv build uvx://mcp-server-git $ thv build --tag my-custom-name:latest npx://@modelcontextprotocol/server-filesystem $ thv build go://./my-local-server
thv build [flags] PROTOCOL
Options
-h, --help help for build
-t, --tag string Name and optionally a tag in the 'name:tag' format for the built image
Options inherited from parent commands
--debug Enable debug mode
SEE ALSO
- thv - ToolHive (thv) is a lightweight, secure, and fast manager for MCP servers