# Claude Agent SDK: AttestPage tools through quoteproof-mcp

Last updated: 2026-10-17

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 thirteen tools with their prices, pays with x402 from your own key when `ATTESTPAGE_X402_KEY` is set, and otherwise sends no payment, so a paid tool returns the x402 price.

| 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.02 per batch of up to 20 on one page |
| `attestpage_verify_text_quote` | `POST /v1/verify/text-quote` | US$0.005 |
| `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_recheck` | `POST /v1/recheck` | US$0.003 |
| `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 |

For the same check in other frameworks, see [LangChain](/docs/examples/langchain), [LlamaIndex](/docs/examples/llamaindex), [OpenAI Agents SDK](/docs/examples/openai-agents-sdk) and [Vercel AI SDK](/docs/examples/vercel-ai-sdk).

## 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://s2h6qt73jtzlgbgnnfacln2poq.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 `ATTESTPAGE_X402_KEY` to the private key (`0x` and 64 hex digits) of a Base wallet holding a little USDC (real money). 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://s2h6qt73jtzlgbgnnfacln2poq.srv.us';
const SERVICE = (process.env.ATTESTPAGE_URL || ORIGIN).replace(/\/+$/, '');

// Settings for the MCP server. Without ATTESTPAGE_X402_KEY it sends no payment and gets the price back.
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.ATTESTPAGE_X402_KEY) env.QUOTEPROOF_X402_KEY = process.env.ATTESTPAGE_X402_KEY;
if (process.env.QP_OWN_TOKEN) env.QP_OWN_TOKEN = process.env.QP_OWN_TOKEN;

// Tools from an MCP server are named mcp__<server>__<tool>.
const TOOLS = ['attestpage_verify_quote', 'attestpage_check_links', 'attestpage_check_packages', '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.40.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 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                             # no key: returns the price
ATTESTPAGE_X402_KEY=0x... node claude-agent-sdk.mjs   # pays in USDC, at most US$0.01 a call
```

## Check packages before install

The `attestpage_check_packages` tool checks up to 10 names on npm, PyPI or crates.io in one call, for US$0.005 per batch. Ask the agent to run it before it installs anything a model suggested. Its input:

```json
{ "packages": [{ "ecosystem": "npm", "name": "left-pad" }, { "ecosystem": "pypi", "name": "requests", "version": "2.32.3" }] }
```

Each result has `exists` (`true`, `false`, or `null` when the lookup failed), `latest_version`, and `vulnerabilities`: the known OSV.dev advisories for the version shown. It is not a security verdict. The full answer is at [`/docs/check-packages`](https://s2h6qt73jtzlgbgnnfacln2poq.srv.us/docs/check-packages).

## 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:8453` | Networks it pays on (Base, USDC) |
| `QUOTEPROOF_TRIAL` | on | Set `0` to send no 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://s2h6qt73jtzlgbgnnfacln2poq.srv.us/dl/quoteproof-mcp-0.1.40.tgz"],
      "env": {
        "QUOTEPROOF_URL": "https://s2h6qt73jtzlgbgnnfacln2poq.srv.us",
        "QUOTEPROOF_X402_KEY": "0x..."
      }
    }
  }
}
```

Leave out `QUOTEPROOF_X402_KEY` and calls carry no payment, so a paid tool returns the price. With no install at all, the service also answers MCP over HTTP at `POST /mcp`; see [MCP server](https://s2h6qt73jtzlgbgnnfacln2poq.srv.us/docs/mcp).

Prices are per call in USDC. The full list is at [`/pricing.json`](https://s2h6qt73jtzlgbgnnfacln2poq.srv.us/pricing.json).
