dzx CLI
Use dzx to develop, inspect, validate, and build MCP servers.
Common usage
# local dev server
pnpm dzx dev
# inspect discovered tools/resources/prompts
pnpm dzx inspect --json
# validate manifest and directories
pnpm dzx validate
# build deployable output
pnpm dzx build --split-tools
If dzx is not installed in the project, use npx dzx.
Commands
dzx dev
Run a local MCP server with hot reload.
Flags:
--config <path>manifest path (default:mcp.json)--cwd <path>working directory (default:.)--port <number>server port (default:3333)--no-watchdisable file watching--polluse polling for file watching--quietminimal output--verbosedebug output
Notes:
- For Node runtime with a
.tsentrypoint,tsxmust be installed. - For Deno runtime,
deno run --watch --allow-readis used in dev, plus--allow-netifpermissions.networkis true.
dzx inspect
Print discovered tools/resources/prompts.
Flags:
--config <path>manifest path (default:mcp.json)--cwd <path>working directory (default:.)--format <table|json>output format (default:table)--jsonshorthand for JSON output
dzx validate
Validate mcp.json and directory layout.
Flags:
--config <path>manifest path (default:mcp.json)--cwd <path>working directory (default:.)--strictfail if optional directories are missing
dzx build
Bundle tools and emit tool-manifest.json.
Flags:
--config <path>manifest path (default:mcp.json)--cwd <path>working directory (default:.)--out-dir <path>output directory (default:dist)--split-toolsemit one bundled file per tool--bundlebundle tools without splitting--format <esm|cjs>output module format (default:esm)--sourcemapemit sourcemaps--minifyminify output
dzx init
Initialize a dzx repo in the current directory.
Flags:
--dir <path>target directory (default:.)--template <basic|tools-only|full>template to scaffold--runtime <node|deno>runtime to configure--installinstall dependencies after scaffolding--no-installskip dependency installation--yesaccept defaults--forceoverwrite existing files
create-dzx (via @dwizi/create-dzx)
Scaffold a new repo in a new directory. Alias of dzx init in scaffold mode.
Usage:
npx @dwizi/create-dzx@latest
Flags:
--dir <path>target directory (default:my-agent)--template <basic|tools-only|full>template to scaffold--runtime <node|deno>runtime to configure--installinstall dependencies after scaffolding--no-installskip dependency installation--yesaccept defaults--forceoverwrite existing files
Environment variables
DZX_ENVorNODE_ENVcontrols which.envfiles are loaded in dev.DZX_LOG_LEVELsupportsquiet,info,verbose.DZX_TOOL_TIMEOUT_MSsets tool timeout in ms (default: 30000).DZX_POLLING=1enables polling-based watch mode.DZX_SOCKEToverrides the Unix socket path (dev fallback).DZX_HOSToverrides the bind address.
.env loading order (dev)
.env.env.local.env.<mode>.env.<mode>.local
Existing process.env values take precedence.