---
title: thv build
hide_title: true
description: Reference for ToolHive CLI command `thv build`
last_update:
  author: autogenerated
slug: thv_build
mdx:
  format: md
---

## 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.

Build-time arguments can be baked into the container's ENTRYPOINT:

	$ thv build npx://@launchdarkly/mcp-server -- start
	$ thv build uvx://package -- --transport stdio

These arguments become part of the container image and will always run,
with runtime arguments (from 'thv run -- <args>') appending after them.

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 npx://@launchdarkly/mcp-server -- start

```
thv build [flags] PROTOCOL [-- ARGS...]
```

### Options

```
      --dry-run         Generate Dockerfile without building (stdout output unless -o is set) (default false)
  -h, --help            help for build
  -o, --output string   Write the Dockerfile to the specified file instead of building (default builds an image instead of generating a Dockerfile)
  -t, --tag string      Name and optionally a tag in the 'name:tag' format for the built image (default generates a unique image name based on the package and transport type)
```

### Options inherited from parent commands

```
      --debug   Enable debug mode
```

### SEE ALSO

* [thv](thv.md)	 - ToolHive (thv) is a lightweight, secure, and fast manager for MCP servers

