hud run
command executes MCP servers in three ways: (1) Python module/file (decorator‑based), (2) arbitrary command, or (3) Docker image (local/remote). Unlike hud dev
, hud run
is optimized for execution, not hot‑reload.
Usage
Arguments
Python module/file (e.g.,
controller
or controller:server
) or a Docker image (e.g., myorg/env:latest
)Additional Docker arguments (accepted after the image)
Docker arguments are passed positionally after the image in this command form.
Options
Run locally with Docker instead of remote execution
Explicitly run remotely (default behavior if neither —local nor —remote is set)
Transport protocol:
stdio
or http
. Short: -t
Port for HTTP transport (ignored for stdio). Short:
-p
Remote MCP server URL
API key for remote server (defaults to
HUD_API_KEY
env var)Run ID for tracking (remote only)
Show detailed output. Short:
-v
Launch interactive testing mode (HTTP transport only; local Docker only)
Auto-reload when files change (Python mode only)
Directories to watch when using
--reload
(Python mode)Run an arbitrary command as an MCP server (e.g.,
python -m controller
)Python Mode (Decorator-based)
Run a Python module, package, or file containing an MCP server (default attributemcp
; override with module:attr
).
Remote Execution (Default for Docker)
By default,hud run
executes your Docker image on the HUD platform’s remote infrastructure. This provides:
- Scalability: Run hundreds of concurrent instances
- Resource Management: Automatic container lifecycle management
- Monitoring: Live telemetry and performance metrics
- Geographic Distribution: Global edge deployment
Remote Examples
Authentication
Remote execution requires authentication via API key:Run Tracking
Use--run-id
to track specific execution instances:
Local Execution
Use--local
to run the image locally with Docker:
- Development and testing
- Environments without internet access
- Custom Docker configurations
- Debugging before remote deployment
Transport Modes
Stdio Transport (Default)
- Direct JSON-RPC over stdin/stdout
- Single client connection
- Lower latency
- MCP protocol native
HTTP Transport
- HTTP proxy at specified port
- Multiple concurrent connections
- Web-compatible
- Inspector support
Docker Arguments
Pass Docker arguments after--
separator:
The
--
separator is required to distinguish HUD options from Docker arguments.Environment Variables
Variable | Description | Default |
---|---|---|
HUD_MCP_URL | Remote MCP server URL | https://mcp.hud.so/v3/mcp |
HUD_API_KEY | API key for remote authentication | required for remote |
Comparison with Other Commands
Command | Purpose | Hot-reload | Target Use Case |
---|---|---|---|
hud dev | Development with auto-restart | ✅ Yes | Local development iteration |
hud run | Production execution | ❌ No | Production workloads, testing |
hud debug | Environment validation | ❌ No | Debugging and validation |
Examples
Basic Usage
Production Deployment
Development Testing
CI/CD Integration
Error Handling
hud run
provides clear error messages for common issues:
- Missing image: Suggests available images or build commands
- Authentication failure: Guides through API key setup
- Port conflicts: Suggests alternative ports
- Docker errors: Shows Docker-specific troubleshooting
See Also
hud pull
- Get environments before runninghud analyze
- Inspect capabilities firsthud debug
- Test environment compliancehud dev
- Development with hot-reload- Build Environments - Environment development guide