Automation Patterns
Use this guide for repeatable operator automation workflows on Management MCP.
Recommended execution pattern
- Initialize session (
initialize) and captureMcp-Session-Id. - Read current state (
tools/list+ read tools). - Plan diff (desired vs current configuration).
- Apply change with minimal mutation calls.
- Validate post-state (read-back and functional smoke checks).
- 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.