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

FlagDefaultDescription
-f, --forcefalseOverwrite lockfile even if drift is detected
-h, --helphelp for lock
-o, --output"mcp-lock.json"Output path for the lockfile
-t, --timeout10sTimeout 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.