Skip to content

Examples

Six runnable examples under examples/. Two cover transports; four cover projection knobs and ecosystem composition.

Transports

Example Transport Demonstrates
serve/ stdio The default. Editor/agent integrations pipe stdio.
serve-http/ Streamable HTTP The current remote MCP transport. Binds 127.0.0.1:9090/mcp.

Projection + composition

Example Demonstrates
large-tree/ Realistic three-level command tree projected as MCP. Proves the projection scales past tiny demos.
annotated-favorites/ webops.* metadata namespace - which keys land where on the MCP wire for cli-web-ops to consume.
skip-paths/ Options.SkipPaths and Options.IncludeGroups - tuning which commands become tools.
composition-with-guard/ The canonical multi-cli-* pattern: every MCP tool call is also a cli-guard audited verb (argv validation + JSONL log).

Quick recipes

# Stdio (default) demo, smallest CLI possible.
go run ./examples/serve

# Streamable HTTP transport for remote / web clients.
go run ./examples/serve-http

# Audited + argv-validated via cli-guard composition.
go run ./examples/composition-with-guard
# In another terminal: tail $TMPDIR/cli-mcp-composition.jsonl

For production, front the HTTP transport with Caddy (TLS + auth) - see deploy/Caddyfile.example.