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

Claude Desktop starts MCP servers as local processes over stdio. Abazi's MCP server runs over streamable HTTP, so the configuration starts `mcp-remote`, a small bridge that forwards stdio to `https://api.52-28-238-205.sslip.io/mcp` and adds the agent's credential as a Bearer header on every request.

## Before you start [#before-you-start]

| You need | Why |
| --- | --- |
| An agent credential (`agk_test_...`) | Created in the [Console](https://app.52-28-238-205.sslip.io) under **Agents > New agent**. Shown once. Replace `YOUR_AGENT_KEY` with it. See [Get an agent credential](/docs/agents#get-an-agent-credential). |
| A signed mandate for that agent | Without one every purchase is denied with <ReasonCode code="MANDATE_MISSING" />. |
| Claude Desktop | On macOS or Windows. |
| Node.js | Claude Desktop runs the bridge with `npx`, which ships with Node.js. |

## Connect [#connect]

<Steps>
<Step>

### Edit the configuration file [#edit-the-configuration-file]

In Claude Desktop, open **Settings > Developer > Edit Config**, or open the file directly:

| System | File |
| --- | --- |
| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
| Windows | `%APPDATA%\Claude\claude_desktop_config.json` |

Add the `abazi` server. If the file already has an `mcpServers` object, add `abazi` inside it.

```json title="claude_desktop_config.json"
{
  "mcpServers": {
    "abazi": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://api.52-28-238-205.sslip.io/mcp",
        "--header",
        "Authorization:Bearer ${ABAZI_AGENT_KEY}"
      ],
      "env": {
        "ABAZI_AGENT_KEY": "YOUR_AGENT_KEY"
      }
    }
  }
}
```

`mcp-remote` replaces `${ABAZI_AGENT_KEY}` with the value from `env`. The header has no space after the colon on purpose: some systems split arguments at spaces, and `Authorization:Bearer` survives that intact.

</Step>
<Step>

### Restart Claude Desktop [#restart-claude-desktop]

Quit Claude Desktop completely and open it again. It reads the file only at start.

</Step>
</Steps>

## Verify [#verify]

Open a new chat and look at the tools menu in the message box. `abazi` is listed with six tools: `search_catalog`, `request_purchase`, `request_installment_purchase`, `get_purchase_status`, `get_spending_status` and `get_receipt`.

Ask for a search. Searching spends nothing.

```text title="Prompt"
Search the Abazi catalog for "forecast" and list the services with their prices.
```

Claude calls `search_catalog` and gets back services with a `service_id`, the merchant and its trust tier, a price in base units (`50000` is 0.05 USDC), the asset and the networks.

## First purchase [#first-purchase]

```text title="Prompt"
Search the catalog for forecast and buy it for Tbilisi. Then show me the receipt.
```

Claude Desktop asks you to allow each tool call the first time. Claude then calls `request_purchase` with the `service_id`, a `task_id` and a fresh `idempotency_key`, and reads the result.

### ALLOW [#allow]

`status` is `paid`, with `decision: "ALLOW"`, the resource and a `receipt_id`. Claude calls `get_receipt` and shows the signed receipt with its public verification link. If `status` is `submitted`, the payment is still settling and Claude polls `get_purchase_status` after `poll_after_ms`.

### REQUIRE_APPROVAL [#require_approval]

`status` is `awaiting_approval`, with a reason such as <ReasonCode code="ABOVE_AUTO_THRESHOLD" />, <ReasonCode code="FIRST_PURCHASE" /> or <ReasonCode code="UNKNOWN_MERCHANT_LIMIT" />. Abazi sends the approval link to the owner's approvers; Claude never sees it. Claude keeps the same `intent_id` and polls `get_purchase_status`. The link expires after <Limit name="approvalTtl" />. See [Approve on a phone](/docs/guides/approve-on-a-phone).

### DENY [#deny]

The tool returns an error result with `error_code: "POLICY_DENIED"`, a `reason_code` such as <ReasonCode code="HARD_CAP_EXCEEDED" /> or <ReasonCode code="BUDGET_EXCEEDED" />, `retryable` and `next_action`. Claude reports the reason. A denial is final for that purchase.

## Troubleshooting [#troubleshooting]

| Symptom | Cause and fix |
| --- | --- |
| Tool calls fail with `AGENT_CREDENTIAL_INVALID` | The credential in `env` is wrong, rotated or revoked (<ReasonCode code="AGENT_CREDENTIAL_INVALID" />). Paste the new one and restart. The tool list still loads with a bad key; only the calls fail. |
| `abazi` is not in the tools menu | Check the file is valid JSON, that `npx` runs in a terminal, and that the URL ends in `/mcp`. Claude Desktop writes MCP logs next to its configuration (on macOS, `~/Library/Logs/Claude/`). Restart after every change. |
| 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. |

## Next steps [#next-steps]

<Cards>
  <Card title="MCP tools" href="/docs/mcp" description="Inputs, results and errors of the six tools." />
  <Card title="Claude Code" href="/docs/agents/claude-code" description="The same server, added with one command." />
  <Card title="Verify a receipt" href="/docs/guides/verify-a-receipt" description="Check what Claude bought, without an account." />
  <Card title="All harnesses" href="/docs/agents" description="Compare the other ways to connect." />
</Cards>

