|
| 1 | +--- |
| 2 | +title: thv build |
| 3 | +hide_title: true |
| 4 | +description: Reference for ToolHive CLI command `thv build` |
| 5 | +last_update: |
| 6 | + author: autogenerated |
| 7 | +slug: thv_build |
| 8 | +mdx: |
| 9 | + format: md |
| 10 | +--- |
| 11 | + |
| 12 | +## thv build |
| 13 | + |
| 14 | +Build a container for an MCP server without running it |
| 15 | + |
| 16 | +### Synopsis |
| 17 | + |
| 18 | +Build a container for an MCP server using a protocol scheme without running it. |
| 19 | + |
| 20 | +ToolHive supports building containers from protocol schemes: |
| 21 | + |
| 22 | + $ thv build uvx://package-name |
| 23 | + $ thv build npx://package-name |
| 24 | + $ thv build go://package-name |
| 25 | + $ thv build go://./local-path |
| 26 | + |
| 27 | +Automatically generates a container that can run the specified package |
| 28 | +using either uvx (Python with uv package manager), npx (Node.js), |
| 29 | +or go (Golang). For Go, you can also specify local paths starting |
| 30 | +with './' or '../' to build local Go projects. |
| 31 | + |
| 32 | +The container will be built and tagged locally, ready to be used with 'thv run' |
| 33 | +or other container tools. The built image name will be displayed upon successful completion. |
| 34 | + |
| 35 | +Examples: |
| 36 | + $ thv build uvx://mcp-server-git |
| 37 | + $ thv build --tag my-custom-name:latest npx://@modelcontextprotocol/server-filesystem |
| 38 | + $ thv build go://./my-local-server |
| 39 | + |
| 40 | +``` |
| 41 | +thv build [flags] PROTOCOL |
| 42 | +``` |
| 43 | + |
| 44 | +### Options |
| 45 | + |
| 46 | +``` |
| 47 | + -h, --help help for build |
| 48 | + -t, --tag string Name and optionally a tag in the 'name:tag' format for the built image |
| 49 | +``` |
| 50 | + |
| 51 | +### Options inherited from parent commands |
| 52 | + |
| 53 | +``` |
| 54 | + --debug Enable debug mode |
| 55 | +``` |
| 56 | + |
| 57 | +### SEE ALSO |
| 58 | + |
| 59 | +* [thv](thv.md) - ToolHive (thv) is a lightweight, secure, and fast manager for MCP servers |
| 60 | + |
0 commit comments