# 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.

An agent reaches Abazi over MCP, JSON-RPC, REST or an SDK. It calls six tools over the Model Context Protocol (MCP), sends the same tool calls as plain JSON-RPC requests to the MCP endpoint, or calls the same operations over the REST API, directly or through an SDK. Every harness on this page is one of those paths with a different front end. Pick the one your agent already runs in.

<HarnessList />

## Compare the harnesses [#compare-the-harnesses]

| Harness | Transport | Best for | Setup | Auth | Tools |
| --- | --- | --- | --- | --- | --- |
| [Claude Code](/docs/agents/claude-code) | Streamable HTTP | Coding agents and scripted tasks in a terminal | 1 command | Bearer header set at `claude mcp add` | Six MCP tools |
| [Claude Desktop](/docs/agents/claude-desktop) | stdio, bridged to HTTP by `mcp-remote` | A person chatting with an assistant that can buy | 2 steps: edit the config, restart | Bearer header passed to `mcp-remote` | Six MCP tools |
| [Cursor](/docs/agents/cursor) | Streamable HTTP | Agents inside the editor | 1 file | `headers` in `mcp.json` | Six MCP tools |
| [Any MCP client](/docs/agents/any-mcp-client) | Streamable HTTP, or stdio through `mcp-remote` | Your own agent, another MCP host, a quick curl check | 1 request | Bearer header on every request | Six MCP tools |
| [JSON-RPC](/docs/agents/json-rpc) | JSON-RPC 2.0 over HTTP POST to the MCP endpoint, no session | Scripts, non-MCP agent frameworks, any language with an HTTP client | 1 request | Bearer header on every request | Six MCP tools |
| [Python SDK](/docs/agents/python-sdk) | REST | Python agents and back-end jobs | 2 lines | Bearer header, set once in the client | REST equivalents of the tools |
| [Plain HTTP](/docs/agents/http-api) | REST | Any language, any HTTP client | 1 request | `Authorization: Bearer` and `Idempotency-Key` | REST equivalents of the tools |
| [TypeScript](/docs/agents/typescript) | REST, typed from the OpenAPI contract | Node and browser agents that want types | 2 steps: generate types, create the client | Bearer header in `createClient` | REST equivalents of the tools |
| [Local model on Tether QVAC](/docs/agents/local-model-qvac) | MCP; the model runs on your machine | Agents whose model must stay on the device | 3 steps: serve the model, connect MCP, run the loop | Bearer header held by the agent program, never by the model | Three slim MCP tools exposed to the model |

## The same everywhere [#the-same-everywhere]

The harness changes how the agent talks. It does not change what Abazi does.

- **One agent credential.** An `agk_test_...` credential identifies the agent on MCP, JSON-RPC and REST alike. It carries no spending power on its own.
- **Six tools, or their REST equivalents.** `search_catalog`, `request_purchase`, `request_installment_purchase`, `get_purchase_status`, `get_spending_status` and `get_receipt`. Each maps to one REST operation.
- **One policy.** Every purchase runs through the same mandate and the same deterministic policy engine, and comes back as ALLOW, REQUIRE_APPROVAL or DENY with a reason code.
- **The same receipts.** A paid purchase produces a signed receipt with a public verification link, whichever harness asked for it.
- **No keys in the agent.** The agent never holds a wallet key, a card number or its own limits. Abazi's signer holds the keys; the owner's mandate holds the limits.

<McpToolTable />

## Get an agent credential [#get-an-agent-credential]

<Steps>
<Step>

### Create the agent [#create-the-agent]

In the Console, open **Agents** and choose **New agent**. Abazi shows the secret (`agk_test_...`) once and stores only a hash. Put it in your secret manager or in an environment variable such as `ABAZI_AGENT_KEY`.

</Step>
<Step>

### Sign a mandate [#sign-a-mandate]

Set the agent's limits, rails and networks, then sign with your passkey. Without a signed mandate every purchase is denied with <ReasonCode code="MANDATE_MISSING" />. See [Write a mandate](/docs/guides/write-a-mandate).

</Step>
<Step>

### Connect a harness [#connect-a-harness]

Follow the page for your harness below. Every page ends with a first search and a first purchase, so you see the whole path once before the agent runs on its own.

</Step>
</Steps>

A rotated or revoked credential fails on the next call with <ReasonCode code="AGENT_CREDENTIAL_INVALID" />. The agent should stop and ask for a new one, never retry with the old key.

## What every harness handles [#what-every-harness-handles]

| Result | What it means | What the agent does |
| --- | --- | --- |
| `paid` | ALLOW. The payment confirmed; the result carries the resource and a `receipt_id`. | Use the resource. Keep the receipt id. |
| `submitted` | ALLOW. The payment was sent and is waiting for confirmation. | Poll `get_purchase_status` after `poll_after_ms`. |
| `awaiting_approval` | REQUIRE_APPROVAL, for example <ReasonCode code="ABOVE_AUTO_THRESHOLD" />. Approvers get a link; the agent does not. | Poll `get_purchase_status` with the same intent. The link expires after <Limit name="approvalTtl" />. |
| Error `POLICY_DENIED` | DENY, for example <ReasonCode code="HARD_CAP_EXCEEDED" />. | Follow `next_action`. Never retry a denial with a new idempotency key. |

## Next steps [#next-steps]

<Cards>
  <Card title="Claude Code" href="/docs/agents/claude-code" description="One command adds Abazi to Claude Code." />
  <Card title="Any MCP client" href="/docs/agents/any-mcp-client" description="Connect your own agent or check the server with curl." />
  <Card title="JSON-RPC" href="/docs/agents/json-rpc" description="Call the six tools with plain POST requests, no MCP client." />
  <Card title="Python SDK" href="/docs/agents/python-sdk" description="Search and buy from Python in four lines." />
  <Card title="MCP tools" href="/docs/mcp" description="Inputs, results and errors of the six tools." />
</Cards>

