# x402 Trinity

> x402 Trinity is an open-source MCP server. Give an agent a wallet. Pays for x402 resources within hard limits. Base + USDC, gasless. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Repository:** https://github.com/devmster/x402-trinity
- **MCP Registry name:** io.github.devmster/x402-trinity
- **Listing updated:** 2026-11-13

## About

Give an agent a wallet. Pays for x402 resources within hard limits. Base + USDC, gasless.

## Install

### Claude Code (Terminal)

```sh
claude mcp add x402-trinity --env X402_PRIVATE_KEY='<X402_PRIVATE_KEY>' --env X402_MAX_PER_REQUEST='<X402_MAX_PER_REQUEST>' --env X402_TOTAL_BUDGET='<X402_TOTAL_BUDGET>' -- npx -y x402-trinity
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "x402-trinity": {
      "command": "npx",
      "args": [
        "-y",
        "x402-trinity"
      ],
      "env": {
        "X402_PRIVATE_KEY": "<X402_PRIVATE_KEY>",
        "X402_MAX_PER_REQUEST": "<X402_MAX_PER_REQUEST>",
        "X402_TOTAL_BUDGET": "<X402_TOTAL_BUDGET>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "x402-trinity": {
      "command": "npx",
      "args": [
        "-y",
        "x402-trinity"
      ],
      "env": {
        "X402_PRIVATE_KEY": "<X402_PRIVATE_KEY>",
        "X402_MAX_PER_REQUEST": "<X402_MAX_PER_REQUEST>",
        "X402_TOTAL_BUDGET": "<X402_TOTAL_BUDGET>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "x402-trinity": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "x402-trinity"
      ],
      "env": {
        "X402_PRIVATE_KEY": "<X402_PRIVATE_KEY>",
        "X402_MAX_PER_REQUEST": "<X402_MAX_PER_REQUEST>",
        "X402_TOTAL_BUDGET": "<X402_TOTAL_BUDGET>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "x402-trinity": {
      "command": "npx",
      "args": [
        "-y",
        "x402-trinity"
      ],
      "env": {
        "X402_PRIVATE_KEY": "<X402_PRIVATE_KEY>",
        "X402_MAX_PER_REQUEST": "<X402_MAX_PER_REQUEST>",
        "X402_TOTAL_BUDGET": "<X402_TOTAL_BUDGET>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "x402-trinity": {
      "command": "npx",
      "args": [
        "-y",
        "x402-trinity"
      ],
      "env": {
        "X402_PRIVATE_KEY": "<X402_PRIVATE_KEY>",
        "X402_MAX_PER_REQUEST": "<X402_MAX_PER_REQUEST>",
        "X402_TOTAL_BUDGET": "<X402_TOTAL_BUDGET>"
      }
    }
  }
}
```

## FAQ

### Is x402 Trinity free?

Yes. x402 Trinity is open source, so you can use and self-host it for free.

### How do I add x402 Trinity to Claude Code?

Run this command in your terminal: claude mcp add x402-trinity --env X402_PRIVATE_KEY='<X402_PRIVATE_KEY>' --env X402_MAX_PER_REQUEST='<X402_MAX_PER_REQUEST>' --env X402_TOTAL_BUDGET='<X402_TOTAL_BUDGET>' -- npx -y x402-trinity

## Where this comes from

- Description: from the official MCP Registry entry.
- Install steps: from the official MCP Registry entry.

---
Source: https://ai-powered.com/mcp/x402-trinity
