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

# MCP Server

> Xenarch MCP server — Model Context Protocol server for Claude, Anthropic & MCP clients. Let AI agents check x402 payment gates and pay in USDC on Base.

<script
  type="application/ld+json"
  dangerouslySetInnerHTML={{__html: JSON.stringify({
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Xenarch MCP Server",
"alternateName": ["@xenarch/agent-mcp", "Xenarch Model Context Protocol Server"],
"applicationCategory": "DeveloperApplication",
"applicationSubCategory": "Model Context Protocol",
"operatingSystem": "Any (macOS, Linux, Windows)",
"url": "https://www.npmjs.com/package/@xenarch/agent-mcp",
"downloadUrl": "https://www.npmjs.com/package/@xenarch/agent-mcp",
"description": "Model Context Protocol server for AI agent payments. Exposes three tools — xenarch_check_gate, xenarch_pay, xenarch_get_history — for Claude Desktop, Claude Code, Cursor, and any MCP-compatible AI agent to check x402 payment gates and pay in USDC on Base L2.",
"featureList": [
"xenarch_check_gate — detect x402 payment gates on any URL",
"xenarch_pay — execute USDC micropayment on Base L2 and receive access token",
"xenarch_get_history — query past payments by wallet"
],
"softwareRequirements": "Node.js 18+",
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" },
"publisher": {
"@type": "Organization",
"name": "Xenarch",
"url": "https://xenarch.com"
}
})}}
/>

The Xenarch MCP server (`@xenarch/agent-mcp`) gives AI agents three tools to discover, pay for, and track x402-gated content. It handles wallet management, on-chain USDC payments, and access token retrieval.

## What is an MCP server?

The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) is an open standard from Anthropic that lets AI agents access external tools. An **MCP server** exposes a set of tools over stdio or HTTP; agents (like Claude Desktop and Claude Code) call them as needed. The Xenarch MCP server exposes x402 payment tools — check a gate, pay in USDC on Base, retrieve payment history — so any MCP-compatible agent can autonomously pay for gated APIs and content.

## What it does

| Tool                  | Description                                                                                             |
| --------------------- | ------------------------------------------------------------------------------------------------------- |
| `xenarch_check_gate`  | Check if a URL or domain has a payment gate. Returns price, contract details, and payment instructions. |
| `xenarch_pay`         | Execute a USDC micropayment on Base L2 and return a Bearer access token.                                |
| `xenarch_get_history` | List past payments with tx hashes, amounts, and timestamps.                                             |

## Supported MCP clients

* Claude Desktop
* Claude Code
* Any MCP-compatible client (Cursor, Cline, etc.)

## Quick setup

```bash theme={null}
claude mcp add xenarch -- npx @xenarch/agent-mcp
```

That's it for Claude Code. See [Installation](/mcp/installation) for Claude Desktop and other clients.

## How agents use it

An agent with the Xenarch MCP server can:

1. **Discover**: "Check if example.com has a paywall" → calls `xenarch_check_gate`
2. **Pay**: "Pay for access" → calls `xenarch_pay`, sends USDC on Base
3. **Access**: Uses the returned Bearer token to fetch gated content
4. **Review**: "Show my payment history" → calls `xenarch_get_history`

The agent decides when to pay based on the task context. No hardcoded payment logic needed.
