Scripting
Basics
Output format detection
# These all produce JSON:
mcp sentry search_issues '{"query": "..."}' | jq '.' # piped → JSON
mcp sentry --list > tools.json # redirected → JSON
mcp sentry --list --json # explicit → JSONOutput goes to stdout
result=$(mcp sentry search_issues '{"query": "is:unresolved"}')
echo "$result" | jq '.content[0].text'Errors go to stderr
# This captures only the JSON, not auth messages or warnings
mcp sentry search_issues '{"query": "is:unresolved"}' > results.jsonExit codes
Piping input
Parsing with jq
Get tool names
Extract text content
Check for errors
Common patterns
Loop over results
Build arguments dynamically
Chain multiple servers
Cron job
CI/CD
GitHub Actions
Tips
Last updated
Was this helpful?