# Claude Agent SDK: AttestPage tools through quoteproof-mcp

Last updated: 2026-10-10

A Claude Agent SDK agent that gets AttestPage's tools from `quoteproof-mcp`, an MCP server run over stdio. There is no client code to write: the server lists ten tools with their prices, pays with x402 from your own key when `QUOTEPROOF_X402_KEY` is set, and otherwise sends the free-trial header.

| Tool | Route | Price |
|---|---|---|
| `attestpage_verify_quote` | `POST /v1/verify/quote` | US$0.01 |
| `attestpage_verify_citations` | `POST /v1/verify/citations` | US$0.10 per batch of up to 10 |
| `attestpage_verify_quotes` | `POST /v1/verify/quotes` | US$0.08 per batch of up to 20 on one page |
| `attestpage_verify_document` | `POST /v1/verify/document` | US$0.10 per part of up to 10 pairs |
| `attestpage_preview_document` | `POST /v1/verify/document/preview` | free |
| `attestpage_fetch` | `POST /v1/fetch` | US$0.002 |
| `attestpage_check_links` | `POST /v1/check/links` | US$0.005 per batch of up to 10 |
| `attestpage_check_packages` | `POST /v1/check/packages` | US$0.005 per batch of up to 10 |
| `attestpage_attest` | `POST /v1/attest` | US$0.002 |
| `attestpage_verify_receipt` | `POST /v1/receipt/verify` | free |

## Install

Node.js 20.3 or later.

```sh
npm init -y && npm pkg set type=module
npm install @anthropic-ai/claude-agent-sdk
export ANTHROPIC_API_KEY=...
```

The MCP server needs no install: `npx` fetches it from the service as a tarball. [`/dl/index.json`](https://vehcdj664efetfrsolne5umanq.srv.us/dl/index.json) lists the current version with its sha256 and npm integrity string. The package has no install scripts.

To pay, set `QUOTEPROOF_X402_KEY` to the private key (`0x` and 64 hex digits) of a Base Sepolia wallet made only for testing, holding test USDC. The key stays in the MCP server's process and is never logged or returned.

## claude-agent-sdk.mjs

```js
// Claude Agent SDK agent that checks a quote with AttestPage (quoteproof-mcp over stdio) before it cites it.
import { query } from '@anthropic-ai/claude-agent-sdk';

const ORIGIN = 'https://vehcdj664efetfrsolne5umanq.srv.us';
const SERVICE = (process.env.ATTESTPAGE_URL || ORIGIN).replace(/\/+$/, '');

// Settings for the MCP server. Without QUOTEPROOF_X402_KEY it uses the free trial.
const env = {
  QUOTEPROOF_URL: SERVICE,
  QUOTEPROOF_MAX_USD: '0.01', // the most one call may cost
  QUOTEPROOF_SESSION_USD: '0.10', // the most this run may spend in total
};
if (process.env.QUOTEPROOF_X402_KEY) env.QUOTEPROOF_X402_KEY = process.env.QUOTEPROOF_X402_KEY;

// Tools from an MCP server are named mcp__<server>__<tool>.
const TOOLS = ['attestpage_verify_quote', 'attestpage_check_links', 'attestpage_verify_receipt'];

const prompt = process.argv.slice(2).join(' ')
  || 'Does https://www.iana.org/help/example-domains say "These domains may be used as illustrative examples in documents"?';

for await (const message of query({
  prompt,
  options: {
    mcpServers: {
      attestpage: { type: 'stdio', command: 'npx', args: ['-y', `${ORIGIN}/dl/quoteproof-mcp-0.1.25.tgz`], env },
    },
    allowedTools: TOOLS.map((t) => `mcp__attestpage__${t}`),
    systemPrompt: 'Before you quote a web page, call attestpage_verify_quote. Cite a quote only when result.match is exact '
      + 'or fuzzy and page.content_kind is real. If a tool fails with trial_exhausted or payment_refused_locally, say so and stop.',
    maxTurns: 6,
  },
})) {
  if (message.type === 'result') console.log(message.subtype === 'success' ? message.result : `stopped: ${message.subtype}`);
}
```

## Run

```sh
node claude-agent-sdk.mjs                             # free trial
QUOTEPROOF_X402_KEY=0x... node claude-agent-sdk.mjs   # pays in test USDC, at most US$0.01 a call
```

## Limits the server applies before it signs

| Variable | Default | Meaning |
|---|---|---|
| `QUOTEPROOF_MAX_USD` | `0.10` | The most it pays for one call; each tool also pays no more than its listed price |
| `QUOTEPROOF_SESSION_USD` | `1` | The most it signs in total while the process runs |
| `QUOTEPROOF_NETWORKS` | `eip155:84532` | Networks it pays on (Base Sepolia, test USDC) |
| `QUOTEPROOF_TRIAL` | on | Set `0` to turn off the free-trial header |

An offer over a limit is refused with `payment_refused_locally` and nothing is signed. A paid result carries the settlement (transaction hash, payer, network) in `_meta["x402/payment-response"]`.

## The same server in other MCP clients

Most MCP clients take a block like this:

```json
{
  "mcpServers": {
    "attestpage": {
      "command": "npx",
      "args": ["-y", "https://vehcdj664efetfrsolne5umanq.srv.us/dl/quoteproof-mcp-0.1.25.tgz"],
      "env": {
        "QUOTEPROOF_URL": "https://vehcdj664efetfrsolne5umanq.srv.us",
        "QUOTEPROOF_X402_KEY": "0x..."
      }
    }
  }
}
```

Leave out `QUOTEPROOF_X402_KEY` to use the free trial. With no install at all, the service also answers MCP over HTTP at `POST /mcp`; see [MCP server](https://vehcdj664efetfrsolne5umanq.srv.us/docs/mcp).
