MCP examples
JSON-RPC examples for paid database MCP access
Use the server-card to create checkout, claim a bearer token, and call fixed database query guard tools.
Initialize
POST /mcp
Authorization: Bearer <token>
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {},
"clientInfo": { "name": "db-query-agent", "version": "1.0.0" }
}
}
Simulate query
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "simulate_query",
"arguments": {
"schemaSample": "payments: customer_id, amount, card_last4, status, created_at",
"naturalLanguageQuestion": "Show payment volume by status for the last 30 days"
}
}
}
Structured result shape
{
"ok": true,
"workspaceId": "ws_...",
"source": { "type": "simulate_query", "databaseType": "postgres" },
"generatedSql": "SELECT status, SUM(amount) FROM payments GROUP BY status LIMIT 100",
"queryHash": "q_...",
"verdict": { "status": "approval_required" },
"sensitiveColumns": [],
"redactedPreview": [],
"audit": {},
"nextActions": []
}