Reference

CLI reference

Five subcommands and two demo entry points. Everything writes to stderr, because stdout is the MCP wire.

Commands at a glance

CommandPurpose
kams shimWrap a stdio MCP server
kams proxyReverse-proxy a streamable-HTTP MCP server
kams pinPromote recorded definitions to pinned
kams statusShow trust state and standing restrictions
kams daemonRun the control plane (webhook + enrichment)
kams-demo-agentReal Amazon Bedrock agent loop
kams-demo-alertExternal control-loop proof

kams shim

bash
kams shim [options] -- <upstream command...>

Everything after -- is launched as a child process. See stdio shim.

FlagDefault
--serverupstream binary basename
--lockkams.lock
--policypolicy.yaml
--statekams-state.json
--kamsdhttp://127.0.0.1:8787/findings
--otlp-endpointSigNoz local default
--log-levelwarning (or KAMS_LOG_LEVEL)
--no-telemetryoff — pure relay, emits nothing
--no-enforceoff — observe only
--no-reflexoff — permissive policy, still honours SigNoz state
--no-integrityoff
--no-egressoff
--no-behaviouraloff
--no-forwardoff — do not send findings to kamsd

kams proxy

bash
kams proxy --upstream http://localhost:8000/mcp --server signoz-mcp --port 8900

See Streamable HTTP.

FlagDefault
--upstreamrequired
--serverderived from upstream hostname
--host127.0.0.1
--port8900
--path/mcp
--log-levelinfo

All the detector, policy, lock, state, and OTLP flags from shim apply identically.

kams pin

bash
kams pin notes-mcp     # one server
kams pin               # every recorded server

Turns trust-on-first-use into an assertion. After pinning, any change to a tool's name, description, or schema is a finding at full severity — which is what makes a rug pull visible.

FlagDefault
serverpositional; omit to pin all
--lockkams.lock

Exits non-zero if the lockfile is empty (run the shim once first) or the named server is unknown.

kams status

bash
kams status
text
notes-mcp                pinned       2 tools
    list_notes           4e91ab77c2d10f38
    save_note            a3f1c8905e4b7d21

standing restrictions
    notes-mcp            quarantine_server  [signoz:Kams — MCP tool definition
                         poisoned (CRITICAL)] via signoz, 3218s left

Forces a fresh read of shared state rather than using the one-second cache.

FlagDefault
--lockkams.lock
--statekams-state.json

kams daemon

bash
kams daemon --port 8787 --ttl 1h

Runs the control plane: the SigNoz webhook receiver and the optional LLM enrichment worker. Not on the request path — a missing daemon degrades alert-driven policy without breaking MCP traffic.

FlagDefault
--port8787
--statekams-state.json
--ttl1h — how long an alert-driven quarantine lasts
--no-judgeoff — disable LLM enrichment
--otlp-endpointSigNoz local default
--log-levelinfo

kams-demo-agent

bash
kams-demo-agent

Makes live provider calls

Requires AMAZON_BEDROCK_API_KEY; model and region are configurable in .env. May incur charges.

Calls Bedrock Converse, executes the model's selected MCP tool through Kams, feeds the resulting policy error back into the conversation, and reconciles estimated result cost against the provider-reported input-token delta. It is not a playback.

kams-demo-alert

bash
kams-demo-alert

The judge-proof command. Runs with --no-reflex, waits for Foundry's alert evaluator, and fails unless the saved restriction has origin=signoz and the next MCP call is blocked. Allow up to five minutes.

Exit codes

CodeMeaning
0Success
1Usage error, unknown server, or a failed proof assertion

Logging

Every command logs to stderr with the format kams LEVEL logger: message. Set the level with --log-level or KAMS_LOG_LEVEL; --log-level debug adds per-message correlation detail useful when a span is not closing as expected.