Claude Code
Add Abazi's MCP server to Claude Code with one command, check the six tools, and let Claude Code search the catalog and make its first purchase under your mandate.
Claude Code connects to Abazi's MCP server over streamable HTTP. One command registers the server with the agent's credential in a Bearer header. After that, Claude Code can search the catalog, buy, follow a purchase and fetch receipts, and every purchase runs through the owner's mandate.
Before you start
| You need | Why |
|---|---|
An agent credential (agk_test_...) | Created in the Console under Agents > New agent. Shown once. Replace YOUR_AGENT_KEY with it. See Get an agent credential. |
| A signed mandate for that agent | Without one every purchase is denied with MANDATE_MISSING. |
| Claude Code installed | The claude command on your path. |
| MCP URL | https://api.52-28-238-205.sslip.io/mcp |
Connect
Put the credential in your shell, then add the server.
export ABAZI_AGENT_KEY="YOUR_AGENT_KEY"
claude mcp add --transport http abazi https://api.52-28-238-205.sslip.io/mcp --header "Authorization: Bearer $ABAZI_AGENT_KEY"The shell expands $ABAZI_AGENT_KEY when you run the command, so Claude Code stores the credential in your local configuration for this project.
Share the server with a team
--scope project writes the server to .mcp.json in the project root, which you can commit. Use single quotes so the file keeps the variable name, not the secret. Each person sets ABAZI_AGENT_KEY in their own environment, and Claude Code expands it when it starts the server.
claude mcp add --transport http --scope project abazi https://api.52-28-238-205.sslip.io/mcp --header 'Authorization: Bearer ${ABAZI_AGENT_KEY}'{
"mcpServers": {
"abazi": {
"type": "http",
"url": "https://api.52-28-238-205.sslip.io/mcp",
"headers": { "Authorization": "Bearer ${ABAZI_AGENT_KEY}" }
}
}
}Verify
claude mcp listabazi appears with its URL and a connected status. Inside Claude Code, run /mcp: the abazi server lists six tools, search_catalog, request_purchase, request_installment_purchase, get_purchase_status, get_spending_status and get_receipt. Claude Code names them mcp__abazi__search_catalog and so on.
Then ask for a search. Searching spends nothing.
Use the abazi tools to search the catalog for "forecast". Show me the service ids and prices.Claude Code calls search_catalog and gets back a list like this:
{
"services": [
{
"service_id": "svc_...",
"name": "Weather forecast",
"merchant": "Forecast Co",
"tier": "VERIFIED",
"price_base_units": "50000",
"asset": "USDC",
"chains": ["solana:...", "eip155:..."],
"description": "Daily forecast for one city"
}
]
}Prices are in base units: USDC has six decimals, so 50000 is 0.05 USDC.
First purchase
Search the catalog for forecast and buy it for Tbilisi. Use task id trip-plan-7. Then show me the receipt.Claude Code calls request_purchase with the service_id it found, a task_id and a fresh idempotency_key. It does not send a price, an address or a network: Abazi takes those from the catalog and the mandate. The call waits up to 20 seconds for the payment to settle.
ALLOW
{
"status": "paid",
"intent_id": "pi_...",
"decision": "ALLOW",
"reason_code": "WITHIN_POLICY",
"receipt_id": "rcpt_...",
"amount_base_units": "50000",
"asset": "USDC",
"rail": "x402",
"merchant": { "name": "Forecast Co", "tier": "VERIFIED" },
"resource": { "content_type": "application/json", "body": "..." }
}Claude Code then calls get_receipt and shows the signed receipt with its public verification link. If the payment is still settling, status is submitted and Claude Code polls get_purchase_status after poll_after_ms.
REQUIRE_APPROVAL
Above the auto-approve limit, on a first purchase from a merchant, or for an unknown merchant, the result is awaiting_approval with a reason such as ABOVE_AUTO_THRESHOLD or FIRST_PURCHASE. Abazi sends the approval link to the owner's approvers, not to Claude Code. Claude Code keeps the same intent_id and polls get_purchase_status every poll_after_ms (5 seconds). The link expires after 10 minutes. A rejected or expired approval ends as denied with APPROVAL_REJECTED or APPROVAL_EXPIRED. See Approve on a phone.
DENY
A denial comes back as an error result whose text is JSON:
{
"error_code": "POLICY_DENIED",
"reason_code": "HARD_CAP_EXCEEDED",
"message": "...",
"retryable": false,
"next_action": "...",
"intent_id": "pi_..."
}Claude Code reports the reason and follows next_action. For BUDGET_EXCEEDED it can call get_spending_status to see what is left. A denial is final for that purchase.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
Every tool call fails with AGENT_CREDENTIAL_INVALID | The credential is wrong, rotated or revoked (AGENT_CREDENTIAL_INVALID). Remove the server with claude mcp remove abazi, set the new key and add it again. The tool list still loads with a bad key; only the calls fail. |
abazi is missing from /mcp, or shows no tools | The URL must end in /mcp and use --transport http. Run claude mcp list to see the stored URL. With --scope project, approve the project server when Claude Code asks. |
The purchase stays awaiting_approval | A person has not decided yet. Keep polling the same intent_id; do not start a new purchase. |
IDEMPOTENCY_CONFLICT | The same idempotency_key was sent with a different request. Use a new key for a different purchase; reuse a key only to retry the same one. |
Next steps
Agents and harnesses
Every way an agent uses Abazi, from Claude Code and Cursor to a typed TypeScript client and a local model on Tether QVAC, with one credential, one policy and the same receipts.
Claude Desktop
Connect Claude Desktop to Abazi through the mcp-remote bridge, check the six tools, and ask Claude to find a service and buy it under the owner's mandate.