> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xintel.aispace.bot/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Xintel agents pay for shared report bodies only via x402 — never profile, posts, or edges.
> Preferred flow: GET /api/intel/list → GET /api/intel/reports?username= (menu) → select=all|range with X-402-Payment.
> Docs: https://docs.xintel.aispace.bot — App: https://xintel.aispace.bot — Agent playbook: /agents.md

# CLI & MCP

> Skip the toolchain — one npx package that pays for Xintel reports as either a CLI or an MCP server.

The raw [Agent API](/agent-api/quickstart) is plain HTTP, but the payment step asks your agent to sign an EIP-3009 authorization — which normally means installing `x402` + `viem`, handling ESM/CJS, prefixing the key with `0x`, and knowing the payload is x402Version 1 while the challenge is version 2.

**`@xintel/agent`** bakes all of that in. It's one package that runs as both a **CLI** and an **MCP server**, so an agent can buy a report in a single command with no crypto toolchain to bootstrap.

<Note>
  Buys **shared report bodies only** — never profile, posts, or edges. Same product and pricing as the HTTP API (`$0.01` USDC per report on Base).
</Note>

## CLI (npx)

Nothing to install — `npx` fetches and caches it:

```bash theme={null}
# free browsing (no wallet)
npx @xintel/agent list
npx @xintel/agent menu --username AskVenice

# paid ($0.01 USDC per report on Base)
export XINTEL_AGENT_KEY=0x<base-wallet-private-key-funded-with-usdc>
npx @xintel/agent buy --username AskVenice --select all
npx @xintel/agent buy --username AskVenice --select range --ids <id1>,<id2>
```

Add `--json` to any command for the raw response. The `buy` command runs the full `402 → sign → retry` loop and prints the delivered reports.

## MCP server

Add Xintel to any MCP-aware host (Cursor, Claude Desktop) — the same package, started with the `mcp` subcommand:

```json theme={null}
{
  "mcpServers": {
    "xintel": {
      "command": "npx",
      "args": ["-y", "@xintel/agent", "mcp"],
      "env": { "XINTEL_AGENT_KEY": "0x<base-wallet-private-key>" }
    }
  }
}
```

Tools exposed:

| Tool              | Paid?          | Purpose                                                        |
| ----------------- | -------------- | -------------------------------------------------------------- |
| `xintel_list`     | free           | list usernames with shared reports                             |
| `xintel_menu`     | free           | list a username's report menu (ids, dates, model)              |
| `xintel_purchase` | `$0.01`/report | buy report bodies — handles the 402/sign/retry loop internally |

## Environment

| Variable           | Required for              | Description                                                                                                                                        |
| ------------------ | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `XINTEL_AGENT_KEY` | `buy` / `xintel_purchase` | Base wallet private key funded with USDC. Read from env only — never a CLI flag. The client runs locally; your key never touches Xintel's servers. |
| `XINTEL_BASE_URL`  | optional                  | Override the API base (default `https://xintel.aispace.bot`; use `http://localhost:5173` for local dev).                                           |

## When to use what

* **MCP** — best for hosted agents (Cursor, Claude Desktop). One-time `mcp.json` entry, then the agent calls tools directly.
* **CLI (`npx`)** — best for scripts, cron, or agent frameworks (LangChain, CrewAI) that shell out. Zero setup per run.
* **Raw HTTP** — see the [Quickstart](/agent-api/quickstart) if you'd rather implement the flow yourself or can't run Node.

All three hit the same endpoints and the same `$0.01`/report pricing.
