Skip to main content

Automation Patterns

Use this guide for repeatable operator automation workflows on Management MCP.

  1. Initialize session (initialize) and capture Mcp-Session-Id.
  2. Read current state (tools/list + read tools).
  3. Plan diff (desired vs current configuration).
  4. Apply change with minimal mutation calls.
  5. Validate post-state (read-back and functional smoke checks).
  6. Record audit outcome and close session.

CI/CD safety gates

  • Dry-run mode for planning stage
  • Approval required for destructive operations
  • Staged rollout (dev -> stage -> prod)
  • Automatic rollback trigger on failed validation

Example: read-before-write tool call

curl -i https://gateway.example.com/api/v1/mcp \
-H "Authorization: Bearer $MCP_TOKEN" \
-H "Mcp-Session-Id: $MCP_SESSION_ID" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"id":"call-1",
"method":"tools/call",
"params":{"name":"list_collections","arguments":{}}
}'

Failure handling

  • If write call fails, stop pipeline and keep prior state.
  • If functional smoke fails after write, apply rollback playbook.
  • If auth fails (401), refresh OIDC token and restart session.