satgate-mcp
v0.2.1
Published
MCP wallet for agents: pay HTTP 402 APIs per request in sats with Cashu or Lightning L402. No accounts, no API keys.
Maintainers
Readme
satgate-mcp
An MCP server with a built-in bitcoin wallet, so AI agents can pay for APIs per request.
When an API answers 402 Payment Required, the agent pays it in sats with Cashu ecash or a Lightning L402 invoice and gets the response. No accounts, no API keys, no sign-up.
Install
Add this to your MCP client's configuration (Claude Desktop, Cursor, Claude Code, and others):
{
"mcpServers": {
"satgate": {
"command": "npx",
"args": ["-y", "satgate-mcp"]
}
}
}Node 22 or newer is required.
Fund the wallet
Ask the agent to call wallet_status. With an empty wallet it returns a top-up link. Open the link, pay the Lightning invoice with any wallet, and the sats arrive in the agent's wallet within a few seconds. To choose the amount, call wallet_status with topup_sats.
You can also paste a Cashu token (cashuA... or cashuB...) and have the agent call wallet_import_cashu. Tokens from a real mint are swapped at the mint on import, so nobody else who saw the token can spend it.
Tools
| Tool | What it does | Cost |
| --- | --- | --- |
| wallet_status | Balance, plus a Lightning top-up link when the balance is low | free |
| wallet_import_cashu | Import a Cashu token | free |
| satgate_fetch | Fetch any URL and pay its HTTP 402 within max_sats_budget | the API's price |
| scrape_url_to_markdown | Any public web page as clean Markdown | 2 sats |
| run_isolated_code | Run JavaScript in an isolated QuickJS VM | 5 sats |
| bitcoin_fee_and_utxo_advisor | Live fee rates and the cost to spend or consolidate UTXOs | 1 sat |
| discover_paid_apis | List the paid APIs published on Satgate | free |
Every paid call states its price up front and refuses to pay more than the budget you give it.
How payment works
- The tool calls the API without payment and gets
402with a Cashu payment request and an L402 Lightning challenge. - By default it pays with Cashu: it sends exact ecash, splitting proofs at the mint the API advertised when needed, and keeps the change.
- With
prefer: "l402", or when the API only takes Lightning, the wallet pays the invoice by melting its ecash at the mint and retries with the L402 credential.
Configuration
| Variable | Default | Purpose |
| --- | --- | --- |
| SATGATE_GATEWAY_URL | https://satgate.dev | Gateway used for top-ups and the built-in API tools |
| SATGATE_WALLET_PATH | ~/.satgate/wallet.json | Where the wallet's ecash is stored |
The wallet file holds bearer ecash. Anyone with a copy can spend it, so treat it like cash. If you used the earlier tollgate-mcp package, its wallet at ~/.tollgate/wallet.json is moved to ~/.satgate/wallet.json on first start, and the old file is kept as wallet.json.migrated-to-satgate.
Sell your own API
Put any HTTPS endpoint behind Satgate at satgate.dev/publish, set a price per call, and get paid to your Lightning address.
