lock
Create a lockfile from a running MCP server
Synopsis
mcptrust lock -- <command> [flags]Connects to the specified MCP server, discovers all tools, and writes a deterministic mcp-lock.json file to the current directory.
Options
| Flag | Default | Description |
|---|---|---|
-f, --force | false | Overwrite lockfile even if drift is detected |
-h, --help | help for lock | |
-o, --output | "mcp-lock.json" | Output path for the lockfile |
-t, --timeout | 10s | Timeout for MCP operations |
Examples
Lock a local server:
mcptrust lock -- "npx -y @modelcontextprotocol/server-filesystem /tmp"This will generate mcp-lock.json containing hashes of all exposed tools.