x402 Trinity MCP Server
by devmsterio.github.devmster/x402-trinityv0.2.4
Give an agent a wallet. Pays for x402 resources within hard limits. Base + USDC, gasless.
context tax
queued
security
queued
cold start
queued
freshness
Active12d ago
Install x402 Trinity MCP server
Install in Claude Code
claude mcp add x402-trinity -e X402_PRIVATE_KEY='<x402-private-key>' -e X402_MAX_PER_REQUEST='<x402-max-per-request>' -e X402_TOTAL_BUDGET='<x402-total-budget>' -- npx -y x402-trinityInstall in Cursor
{
"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>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"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>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"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>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"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>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| X402_PRIVATE_KEY | yes | yes | Private key of the wallet that pays. Use a dedicated wallet holding only what you would accept losing. The server refuses to start without it. |
| X402_MAX_PER_REQUEST | yes | — | Hard ceiling for a single payment, in atomic units (USDC has 6 decimals, so 50000 is $0.05). Required: a model decides when payments happen, so the cap cannot come from the model. |
| X402_TOTAL_BUDGET | yes | — | Lifetime ceiling across all payments, in atomic units. Required for the same reason as the per-request cap. |
| X402_BUDGET_FILE | — | — | Path to a file that makes the lifetime budget survive restarts. Without it the total resets every time the server starts. |
| X402_ALLOW_HOSTS | — | — | Comma-separated hosts that may be paid. Anything else is refused however convincing the challenge looks. |
| X402_NETWORKS | — | — | Networks to accept. Defaults to base. |
Freshness
Active — last maintenance signal 12d ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-09-27 · 12d ago · GitHub
Latest release
2026-08-25 · 46d ago · GitHub · v0.1.1
Package published
no data · npm/PyPI
Registry entry updated
2026-09-27 · 12d ago · official registry · v0.2.4
FAQ
›How do I install the x402 Trinity MCP server in Claude Code?
Run: claude mcp add x402-trinity -e X402_PRIVATE_KEY='<x402-private-key>' -e X402_MAX_PER_REQUEST='<x402-max-per-request>' -e X402_TOTAL_BUDGET='<x402-total-budget>' -- npx -y x402-trinity. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does x402 Trinity require an API key?
Yes. It expects X402_PRIVATE_KEY, X402_MAX_PER_REQUEST, X402_TOTAL_BUDGET, of which 1 is a secret.
›Can I use x402 Trinity as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is x402 Trinity in the official MCP registry?
Yes, as io.github.devmster/x402-trinity.
Alternatives to x402 Trinity
Other finance & fintech MCP servers.