lightningprox-mcp
Use LightningProx to make pay-per-request AI chat calls paid in Bitcoin Lightning, discover available models, check spend-token balances, and top up/retrieve spend tokens via Lightning invoices.
Chat with supported AI models (
chat) by sending amodel,message,spend_token, and optionalmax_tokens; the schema lists 19 models across Anthropic, OpenAI, Together.ai, Mistral, and Google.List available models, providers, and pricing (
list_models).Check a spend token's remaining balance in sats (
get_balance).Generate a Lightning invoice/BOLT11 payment request and charge ID to top up sats (
generate_invoice).Poll a charge ID after payment to confirm it and retrieve the spend token (
check_payment).
Enables pay-per-request AI querying via the Bitcoin Lightning Network, allowing users to generate invoices, pay for requests in satoshis, and manage prepaid spend tokens without requiring accounts.
lightningprox-mcp
MCP server for LightningProx. It gives Claude Desktop, Cursor, Claude Code and other MCP clients pay-per-request AI paid in Bitcoin Lightning. No account and no provider API keys: you load a prepaid spend token, and each request is deducted from its balance in sats.
24 models across 5 providers: Anthropic (Claude 5.5 and 4.x), OpenAI (GPT-6, GPT-4.1, GPT-4o), Google (Gemini 4 Argon, 3.8 Flash, 2.5), Together.ai (DeepSeek V4, gpt-oss-120b, GLM 5.3, MiniMax M3.1) and Mistral. The live list comes from the
list_modelstool.Tool / function calling passthrough, for every model except
gpt-6-astra.Failed or empty calls are never charged. Requests are priced from the actual prompt size. Top-ups last 30 days.
Pure Node.js (18 or newer), with no native binaries. It runs on Linux, macOS and Windows.
Setup
You need Node.js 18 or newer. npx downloads and runs the server.
Claude Desktop
Edit claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"lightningprox": {
"command": "npx",
"args": ["-y", "lightningprox-mcp"],
"env": {
"LIGHTNINGPROX_SPEND_TOKEN": "lnpx_your_token_here"
}
}
}
}Restart Claude Desktop afterwards.
Cursor
Add the same block to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project):
{
"mcpServers": {
"lightningprox": {
"command": "npx",
"args": ["-y", "lightningprox-mcp"],
"env": { "LIGHTNINGPROX_SPEND_TOKEN": "lnpx_your_token_here" }
}
}
}Claude Code
claude mcp add lightningprox -e LIGHTNINGPROX_SPEND_TOKEN=lnpx_your_token_here -- npx -y lightningprox-mcpThe token is optional. Without one, ask_ai returns a Lightning invoice for each request, and create_topup / get_token let you buy a token from inside the chat.
Related MCP server: Sats4AI
Environment variables
Variable | Required | Default | Purpose |
| no | none | Your |
| no |
| API base URL |
Tools
Tool | What it does |
| Sends |
| Lists the served models: ID, provider and tool support ( |
| Shows the configured token's balance, expiry and status ( |
| Creates a Lightning invoice for 10 to 100,000 sats ( |
| After you pay, exchanges the |
Example: ask Claude "Use ask_ai with model claude-haiku-5-5 to summarize this paragraph", or "list the LightningProx models that support tools".
Buying a spend token without leaving the chat
create_topupwithamount_sats: 1000returns an invoice and acharge_id.Pay the invoice with any Lightning wallet.
get_tokenwith thatcharge_idreturnslnpx_.... Put it in your config asLIGHTNINGPROX_SPEND_TOKENand restart the client.
You can also buy one in the browser at lightningprox.com/topup.
Errors
Errors come back as plain messages that say what to do next:
Unknown or retired model: the message points you to
list_modelsor to the replacement model.Prompt too long (
context_length_exceeded) or model without tool support (tools_not_supported).Balance too low: the message tells you how to top up.
Rate limits: the message includes the retry time.
Provider outages (
provider_unavailable): these are never charged.
Nothing is charged when a request is rejected.
Development
npm install
npm test # unit tests with a mocked HTTP layer
npm run smoke # live checks against lightningprox.com, free endpoints only
node bin/lightningprox-mcp.js # run the server on stdioLinks
Gateway: lightningprox.com
API docs: lightningprox.com/docs
AIProx agent registry: aiprox.dev
Built by LPX Digital Group LLC. MIT licensed.
Available Tools
5 toolsask_aiA
Send a prompt or a conversation to an AI model through LightningProx (24 models: Claude, GPT, Gemini, DeepSeek, Mistral and more), paid in sats from your spend token. Returns the reply text, any tool_use blocks, the model used and your remaining balance. Without a spend token it returns a Lightning invoice (L402) for this exact request.
Inputs: model (required), l402, tools, prompt, +4 more.
check_balanceA
Check the balance (sats), expiry and status of the configured spend token (LIGHTNINGPROX_SPEND_TOKEN).
Inputs: no named parameters.
create_topupA
Create a Lightning invoice to buy a LightningProx spend token (10 to 100,000 sats). After paying it, call get_token with the returned charge_id. Tokens last 30 days.
Inputs: amount_sats (required).
get_tokenA
After paying a create_topup invoice, exchange its charge_id for the lnpx_ spend token. Safe to call again: it returns the same token.
Inputs: charge_id (required).
list_modelsA
List the models LightningProx currently serves: ID, provider, whether it supports tool use, and the per-token price when available.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a distinct role: listing models, running inference, checking balance, creating a top-up invoice, and exchanging a charge_id for a token. The only potentially adjacent pair (create_topup and get_token) is explicitly distinguished by the descriptions, which describe them as sequential steps in a payment flow.
All five tools follow a consistent snake_case verb_noun pattern (ask_ai, list_models, check_balance, create_topup, get_token). The convention is predictable and readable throughout.
Five tools is well-scoped for a pay-per-use AI proxy: each tool covers a necessary step in the discover-pay-query workflow. No tool feels redundant or missing from a count perspective.
The surface covers the full lifecycle: discover models, top up, obtain a token, ask a model, and check balance, with ask_ai accepting conversations and surfacing tool_use blocks. Minor gaps remain, such as no token revocation or usage/history inspection, but agents can work around these.
Maintenance
Related MCP Connectors
Pay-per-call LLM chat plus data tools: DNS, crypto, Base gas, Wikipedia. x402 USDC or Lightning.
Pay-per-action access to APIs and MCP tools over Lightning L402 and Base USDC x402.
Pay-per-token Claude & Grok inference, settled in Bitcoin BSV. npm package or hosted remote.
Bitcoin intelligence API. Pay per call via L402 Lightning (10-200 sats). No accounts needed.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI models to interact with the Lightning Network by providing an MCP-compliant API to pay invoices.6MIT
- AlicenseAqualityCmaintenanceBitcoin-powered AI tools via Lightning Network micropayments (L402). Image generation, text generation, video, music, speech, 3D models, file conversion, and SMS — no signup or API keys required.49209 npm2MIT
- AlicenseAqualityDmaintenanceDescription: AI-powered Polymarket prediction market analysis via Bitcoin Lightning. Get edge opportunities, analyze specific markets, and find ranked signals. Pay per analysis in sats.414 npm1MIT
- AlicenseAqualityBmaintenancePay-per-call Claude and GPT models with prepaid USDC on Solana. Sign in once with your wallet and use a capped solx_ token. You only pay for successful calls.528 npmMIT