MCP server to enable x402 payments on the Stellar network
x402-mcp-stellar is an early-stage TypeScript project in the AI payments / x402 ecosystem. It currently has 2 GitHub stars and 3 forks.
Local MCP server (stdio) that can call x402-protected HTTP resources and automatically pay in Stellar USDC.
stellar:testnet or stellar:pubnet)x402_wallet_info: shows active wallet address/network/configx402_facilitator_supported: checks configured facilitator /supported endpointfetch_paid_resource: generic paid fetch (url, method, optional body/headers)app/index.js demo)http://localhost:4022npm install
cp .env.example .env
For testnet you'll need to run a facilitator locally on port 4022. I'd recommend using the one included in the coinbase x402 repo: https://github.com/coinbase/x402/tree/main/examples/typescript/facilitator/advanced
Update .env with your wallet key:
STELLAR_SECRET_KEY=S...
STELLAR_NETWORK=stellar:testnet
For mainnet you'll just need an OpenZeppelin API Key for the relayer. You can get one here (Thank you for making this easy): https://channels.openzeppelin.com/gen
STELLAR_NETWORK=stellar:pubnet
STELLAR_RPC_URL=https://rpc.lightsail.network/
X402_FACILITATOR_URL=https://channels.openzeppelin.com/x402
X402_FACILITATOR_API_KEY=<your-openzeppelin-api-key>
X402_FACILITATOR_API_KEY is optional in general, but required for OpenZeppelin channels.
When set, fetch_paid_resource auto-adds Authorization: Bearer <key> for requests under X402_FACILITATOR_URL (unless you provide Authorization explicitly).
npm run dev
The MCP server runs over stdio for Claude/Codex integrations.
Use an MCP entry like (don't forget to change the path/):
codex mcp add x402-stellar -- npm --silent --prefix /absolute/path/to/x402-mcp-stellar run dev
claude mcp add x402-stellar -- npm --silent --prefix /absolute/path/to/x402-mcp-stellar run dev
{
"mcpServers": {
"x402-stellar": {
"command": "npm",
"args": ["--silent", "--prefix", "/absolute/path/to/x402-mcp-stellar", "run", "dev"]
}
}
}
This server loads .env from the project directory (/absolute/path/to/x402-mcp-stellar/.env).
After loading the MCP server, you can ask:
Can you fetch the resource at http://localhost:3000/my-service, use the x402-stellar MCP server to pay for it, and print the response?
The tool call will pass that full URL at runtime; no URL allowlist or hardcoded endpoint is required in this MCP server.
@x402/stellar is not currently published on npm, so this repo vendors the Stellar mechanism under src/stellar.STELLAR_RPC_URL.MIT
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
Daydreams is a set of tools for building agents for commerce
The first agentic payment network: policy-controlled, gasless, and real money-ready. OmniClaw CLI + Financial Policy Engine let autonomous agents pay and earn safely at machine speed.
Agent behavior that compiles
The A2A x402 Extension brings cryptocurrency payments to the Agent-to-Agent (A2A) protocol, enabling agents to monetize their services through on-chain payments. This extension revives the spirit of HTTP 402 "Payment Required" for the decentralized agent ecosystem.
Live data for AI agents — search, research, markets, crypto, X/Twitter. Pay-per-call via x402 micropayments.