cli-mcp examples/annotated-favorites

NAME

ops - annotated favorites demo

SYNOPSIS

ops

DESCRIPTION

ops demonstrates the webops.* metadata namespace that cli-mcp forwards from cli.Command.Metadata to MCP tool annotations. A cli-web-ops client reads these annotations to render labeled, grouped, optionally-confirmed mobile buttons on its home screen.

The recognized Metadata keys and their MCP wire shape:

webops.favorite (bool)   -> show on the cli-web-ops home screen
webops.label    (string) -> human-readable button label
webops.group    (string) -> sidebar grouping
webops.confirm  (bool)   -> tool.Annotations.DestructiveHint=true,
                            client should ask "are you sure"

A leaf with no webops.* metadata is still registered as an MCP tool (it appears in tools/list) but does not surface on the cli-web-ops home screen. It is reachable via /docs and direct tool calls.

Operating model for an agent reading these annotations:

- Annotations are advisory. A correctly-behaved client respects
  DestructiveHint and prompts the operator. A misbehaved client
  can ignore them; the security boundary is the cli-guard
  audit + argv-validation layer, not the annotation.
- The label is what the operator sees in the button. Pick
  something readable, not the verb name.
- The group is a free-form string; pick a small vocabulary
  (Lifecycle, Destructive, Diagnostic) and stick to it across
  tools so the UI stays organized.

When NOT to annotate: tools that are not user-facing (internal probes, plumbing). Surface those via direct MCP tools/list calls from your agent code, not via the human-targeted home screen.

Usage:

ops [GLOBAL OPTIONS] [command [COMMAND OPTIONS]] [ARGUMENTS...]

COMMANDS

start

start the service

stop

stop the service

drop-db

drop the database (pretend)

internal-probe

diagnostic, not a favorite