> ## 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.

# Install MCP Server (Claude Desktop & Code)

> Install the Xenarch MCP server for Claude Desktop, Claude Code, Cursor, or any Model Context Protocol client. One-command npx setup in under 2 minutes.

Install the Xenarch MCP server in Claude Desktop, Claude Code, Cursor, or any Model Context Protocol client. A single `npx` command wires up three tools for x402 payments — `xenarch_check_gate`, `xenarch_pay`, and `xenarch_get_history` — no cloning, no build step, no API key.

## Prerequisites

* Node.js 18+
* A wallet with USDC on Base (+ small ETH for gas)

## Claude Code

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

## Claude Desktop

Edit your config file:

* **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
* **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

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

Restart Claude Desktop after saving.

## Other MCP clients

Any client that supports the MCP stdio transport can use the server:

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

The server communicates over stdin/stdout using the MCP protocol.

## Wallet configuration

<Tabs>
  <Tab title="Environment variable">
    Set `XENARCH_PRIVATE_KEY` in the MCP server's env block:

    ```json theme={null}
    {
      "env": {
        "XENARCH_PRIVATE_KEY": "0xYOUR_PRIVATE_KEY"
      }
    }
    ```
  </Tab>

  <Tab title="Config file">
    Create `~/.xenarch/wallet.json`:

    ```bash theme={null}
    mkdir -p ~/.xenarch
    cat > ~/.xenarch/wallet.json << 'EOF'
    {
      "privateKey": "0xYOUR_PRIVATE_KEY"
    }
    EOF
    chmod 600 ~/.xenarch/wallet.json
    ```
  </Tab>

  <Tab title="Auto-generate">
    If no wallet is configured, the server generates one on first run and saves it to `~/.xenarch/wallet.json`. Fund it with USDC before making payments.
  </Tab>
</Tabs>

## Configuration variables

| Variable                   | Default                    | Description                                 |
| -------------------------- | -------------------------- | ------------------------------------------- |
| `XENARCH_PRIVATE_KEY`      | —                          | Wallet private key                          |
| `XENARCH_NETWORK`          | `base`                     | `base` or `base-sepolia`                    |
| `XENARCH_RPC_URL`          | `https://mainnet.base.org` | Base RPC endpoint                           |
| `XENARCH_API_BASE`         | `https://api.xenarch.dev`  | Platform API                                |
| `XENARCH_AUTO_APPROVE_MAX` | —                          | Auto-approve payments up to this USD amount |

## 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

**Tools not appearing**: Restart your MCP client. Verify `npx @xenarch/agent-mcp` runs without errors in your terminal.

**"No wallet configured"**: Set `XENARCH_PRIVATE_KEY` or create `~/.xenarch/wallet.json`.

**"Insufficient USDC"**: Fund your wallet with USDC on Base. You also need a small amount of ETH for gas (\~\$0.01).
