> ## 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 (Claude Desktop & Code)

> Claude Desktop MCP example — add Xenarch x402 payment tools to Claude with zero code. Auto-checks payment gates and pays in USDC on Base.

Configuration-only setup. No code to write.

## Claude Code

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

Done. The three Xenarch tools are now available.

## Claude Desktop

Edit your config file:

<Tabs>
  <Tab title="macOS">
    ```
    ~/Library/Application Support/Claude/claude_desktop_config.json
    ```
  </Tab>

  <Tab title="Windows">
    ```
    %APPDATA%\Claude\claude_desktop_config.json
    ```
  </Tab>
</Tabs>

Add the Xenarch server:

```json theme={null}
{
  "mcpServers": {
    "xenarch": {
      "command": "npx",
      "args": ["@xenarch/agent-mcp"],
      "env": {
        "XENARCH_PRIVATE_KEY": "0xYOUR_PRIVATE_KEY"
      }
    }
  }
}
```

Restart Claude Desktop.

## Test it

Try these prompts:

* "Check if example.com has a Xenarch payment gate"
* "Pay for access to example.com and show me the content"
* "Show my Xenarch payment history"

## Testnet

For testing without real funds:

```json theme={null}
{
  "mcpServers": {
    "xenarch": {
      "command": "npx",
      "args": ["@xenarch/agent-mcp"],
      "env": {
        "XENARCH_PRIVATE_KEY": "0xYOUR_PRIVATE_KEY",
        "XENARCH_NETWORK": "base-sepolia",
        "XENARCH_RPC_URL": "https://sepolia.base.org"
      }
    }
  }
}
```

## Troubleshooting

| Issue                  | Fix                                                                                   |
| ---------------------- | ------------------------------------------------------------------------------------- |
| Tools not appearing    | Restart Claude Desktop. Run `npx @xenarch/agent-mcp` in terminal to check for errors. |
| "No wallet configured" | Set `XENARCH_PRIVATE_KEY` in the env block or create `~/.xenarch/wallet.json`.        |
| "Insufficient USDC"    | Fund your wallet with USDC on Base. Need \~\$0.01 ETH for gas too.                    |
