Output Formats
Formats
mcp time get-current-time 'America/New_York' # human-readable (default)mcp time get-current-time 'America/New_York' -o json # JSON for scriptsmcp time get-current-time 'America/New_York' -o yaml # YAMLmcp time get-current-time 'America/New_York' -o raw # raw text, no formattingScripting
-o json is always script-safe:
- Tool output goes to
stdout - Diagnostics go to
stderr - Exit codes are stable and meaningful
# Use with jqmcp time get-current-time 'UTC' -o json | jq -r '.content[0].text'
# Use in a scriptif mcp acme check-status -o raw; then echo "OK"fiListing formats
The tools, resources, and prompts commands also support -o:
mcp time tools -o json # full tool schemas as JSONmcp time tools -o yaml # YAMLmcp time tools -o raw # just tool names, one per line-o raw is useful for piping into other commands:
mcp time tools -o raw | xargs -I{} mcp time tools {}