# x402 Trinity [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/devmster/x402-trinity  
**GitHub Stars:** 3  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/x402-trinity

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

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

**Requires environment variables:** `X402_PRIVATE_KEY`, `X402_MAX_PER_REQUEST`, `X402_TOTAL_BUDGET` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the x402 Trinity MCP server does

The x402 Trinity MCP server exposes three MCP tools for agents that need to use HTTP resources requiring x402 payments:

- `check_price` inspects what a resource requests without sending payment.
- `pay_and_fetch` retrieves a resource and pays when the challenge satisfies the configured policy.
- `wallet_status` reports the wallet address, balance, amount spent, and remaining budget.

The MCP package is a buyer interface. It does not provide seller functionality, hold funds, broadcast transactions, or act as a hosted signing service. The payment flow is intended for resources that answer with HTTP 402, including paid APIs, datasets, files, and services offered by other agents.

## How it works

Run the MCP server with `npx -y x402-trinity-mcp` and provide its wallet and policy through the client configuration. When a tool requests a paid resource, the server reads the x402 challenge, checks the amount and destination against its limits, signs locally, and retries the request. Base mainnet with USDC is the default release configuration.

The x402 Trinity MCP server supports x402 protocol versions 1 and 2 and declines unknown versions rather than guessing how to handle them. Its payment model uses EIP-3009, allowing a facilitator to submit the transfer while the payer wallet only needs USDC rather than gas. The private key remains in the server process unless a separate signing arrangement is used by the underlying library.

## Setup and configuration

Add an MCP entry similar to the following to a compatible client:

```json
{
  "mcpServers": {
    "x402-trinity": {
      "command": "npx",
      "args": ["-y", "x402-trinity-mcp"],
      "env": {
        "X402_PRIVATE_KEY": "0x...",
        "X402_MAX_PER_REQUEST": "50000",
        "X402_TOTAL_BUDGET": "1000000"
      }
    }
  }
}
```

`X402_PRIVATE_KEY`, `X402_MAX_PER_REQUEST`, and `X402_TOTAL_BUDGET` are required; the process refuses to start without them. `X402_BUDGET_FILE` can persist spending across restarts, and `X402_ALLOW_HOSTS` restricts payment to named hosts. `X402_NETWORKS` selects permitted networks, with `base` shown in the supplied configuration.

## Tools and capabilities

The x402 Trinity MCP server separates price inspection from payment, so an agent can check a charge before committing funds. Its payment tool applies a maximum amount per request and a total budget supplied outside the model. Host restrictions provide another boundary when the wallet is used with external URLs.

The broader x402-trinity package supports Node, Bun, Deno, and Cloudflare Workers, but the supplied MCP setup is launched as a command-line process. The library also offers Python buyer support and a TypeScript seller interface; those are separate from the MCP tool surface.

## Limitations and notes

The total budget is otherwise an in-memory, per-instance counter. On restart, or across Cloudflare Worker isolates, it resets unless a durable budget store is configured. The README recommends using a budget file for mainnet or explicitly acknowledging an ephemeral budget.

The wallet key is present in the process, so it should be dedicated and funded only with an amount acceptable to lose. Spending caps are mandatory, but they do not make the key safe if it is exposed elsewhere. The server does not pay without limits, and it does not support protocols it does not recognize. Base plus USDC is the shipped default; other EVM networks require custom configuration in the underlying library.

_Full upstream README: https://allmcps.com/mcp/x402-trinity/readme_

