x402 Stellar MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
x402 Stellar MCP Server
Local MCP server (stdio) that can call x402-protected HTTP resources and automatically pay in Stellar USDC.
Features
Payment flow (
stellar:testnetorstellar:pubnet)Default testnet configuration
Mainnet-ready via env switch
Optional OpenZeppelin facilitator auth via env
No resource whitelist: URL is provided at tool call time
Related MCP server: x402 Stellar MCP Server
Tools Exposed
x402_wallet_info: shows active wallet address/network/configx402_facilitator_supported: checks configured facilitator/supportedendpointfetch_paid_resource: generic paid fetch (url,method, optional body/headers)
Prerequisites
Node.js 20+
A Stellar wallet funded with testnet XLM + testnet USDC
x402 resource server running (your
app/index.jsdemo)x402 facilitator running on
http://localhost:4022
Setup
npm install
cp .env.example .envTestnet
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:testnetPubnet
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).
Run
npm run devThe MCP server runs over stdio for Claude/Codex integrations.
Add To Claude / Codex
Use an MCP entry like (don't forget to change the path/):
Codex
codex mcp add x402-stellar -- npm --silent --prefix /absolute/path/to/x402-mcp-stellar run devClaude Code
claude mcp add x402-stellar -- npm --silent --prefix /absolute/path/to/x402-mcp-stellar run devClaude Desktop (untested)
{
"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).
Claude Usage
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.
Notes
@x402/stellaris not currently published on npm, so this repo vendors the Stellar mechanism undersrc/stellar.Default testnet Soroban RPC is used automatically.
Mainnet requires
STELLAR_RPC_URL.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Pay for APIs with USDC. Read-only x402 payment discovery, verification, evidence, and status.
Discover machine-payable APIs, probe x402 payment terms, and run seller operations. Non-custodial.
Pay-per-action access to APIs and MCP tools over Lightning L402 and Base USDC x402.
Paid Crypto Payments API via x402. Unpaid tool calls return 402.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables fetching data from web URLs with automatic X402 payment handling using Solana, including payment tracking, balance checking, and configurable spending limits.413 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to pay for protected HTTP resources using Stellar USDC via the x402 protocol, facilitating automated payments and access to paid APIs.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to discover and pay for x402-gated HTTP APIs, handling 402 Payment Required flows with local signing. Supports EVM and Solana with non-custodial wallet management.3324 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables HTTP 402 payment protocol interactions on Stellar, allowing payment intent probing, guarded paid fetches, and budget status queries.12 npmApache 2.0