A small stdio MCP server for the LNbits agent_wallet extension runtime API.
This project is intentionally narrow. It is not a generic LNbits wallet MCP and it does not use LNbits invoice/admin wallet keys. It only calls the LNbits agent_wallet extension's profile-scoped runtime endpoints. The agent_wallet extension remains the security boundary: profile lookup, ACL bearer-token authentication, policy enforcement, wallet selection, payment execution, and audit logging all happen inside LNbits.
The MCP surface is intentionally small:
get_status— read profile status, policy, budget/capabilities summarycreate_invoice— request a receive invoicedry_run_payment— validate a payment/LNURL action without executing itpay_invoice— request payment of a BOLT11 invoicepay_lightning_address— request payment to a Lightning addressclaim_lnurl_withdraw— claim an LNURL-withdraw into the bound receive walletlist_activity— read recent agent activity/audit events
claim_lnurl_withdraw accepts an optional amount_sats. If omitted, the agent_wallet runtime resolves the LNURL-withdraw request and uses maxWithdrawable.
You need:
- An LNbits instance with the
agent_walletextension installed and configured. - An
agent_walletprofile ID for the agent you want this MCP server to use. - A restricted
agent_walletACL bearer token for that profile. uvinstalled on the machine running your MCP client.
Required environment variables:
LNBITS_URL— LNbits base URL, for examplehttps://lnbits.example.comLNBITS_AGENT_TOKEN— restrictedagent_walletACL bearer tokenLNBITS_AGENT_PROFILE_ID—agent_walletprofile ID to scope runtime requests
Optional environment variables:
LNBITS_AGENT_TIMEOUT— request timeout in seconds, default30LNBITS_AGENT_RUNTIME_BASE_PATH— defaults to/agent_wallet/api/v1
Authentication is always sent as:
Authorization: Bearer <LNBITS_AGENT_TOKEN>Use uvx to run the package directly from git. This keeps the project uvx-ready without requiring a manual clone or package install.
LNBITS_URL=https://your-lnbits.example \
LNBITS_AGENT_TOKEN=restricted-runtime-token \
LNBITS_AGENT_PROFILE_ID=agent-wallet-profile-id \
uvx --from git+https://github.com/talvasconcelos/lnbits-agent-wallet-mcp.git \
lnbits-agent-wallet-mcpFor a pinned revision, use:
uvx --from git+https://github.com/talvasconcelos/lnbits-agent-wallet-mcp.git@<commit-sha> \
lnbits-agent-wallet-mcpThis is a stdio MCP server. When launched directly it waits for an MCP client on stdin/stdout; it is normal for it not to print a CLI help screen.
- Open the LNbits
agent_walletextension. - Create or select the agent profile you want this MCP server to use.
- Copy the profile ID and restricted ACL bearer token from the extension's MCP/connector output.
- Open your MCP client's configuration file or MCP connector UI.
- Add a server named
lnbits_agent_walletusing the command, arguments, and environment variables below. - Restart or reload your MCP client.
- Ask the client to list MCP tools. You should see tools such as
get_status,create_invoice, andpay_invoice.
Most MCP clients need the same connector shape: a command, arguments, and environment variables.
Use this JSON shape for clients such as Claude Desktop, Codex, OpenCode/OpenClaw, and other MCP-compatible hosts when they accept JSON server configuration:
{
"mcpServers": {
"lnbits_agent_wallet": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/talvasconcelos/lnbits-agent-wallet-mcp.git",
"lnbits-agent-wallet-mcp"
],
"env": {
"LNBITS_URL": "https://your-lnbits.example",
"LNBITS_AGENT_TOKEN": "restricted-runtime-token",
"LNBITS_AGENT_PROFILE_ID": "agent-wallet-profile-id"
}
}
}
}Replace the three placeholder values with the values from your LNbits agent_wallet extension.
Paste the JSON block above into the client's MCP server configuration. For Claude Desktop, this usually means adding it under mcpServers in the Claude desktop config file, then restarting Claude.
Use the same server definition if your client supports MCP JSON configuration. If the client has a UI instead of a file, enter:
- Server name:
lnbits_agent_wallet - Command:
uvx - Arguments:
--from,git+https://github.com/talvasconcelos/lnbits-agent-wallet-mcp.git,lnbits-agent-wallet-mcp - Environment variables:
LNBITS_URL,LNBITS_AGENT_TOKEN,LNBITS_AGENT_PROFILE_ID
Hermes uses YAML configuration:
mcp_servers:
lnbits_agent_wallet:
command: uvx
args:
- --from
- git+https://github.com/talvasconcelos/lnbits-agent-wallet-mcp.git
- lnbits-agent-wallet-mcp
env:
LNBITS_URL: https://your-lnbits.example
LNBITS_AGENT_TOKEN: restricted-runtime-token
LNBITS_AGENT_PROFILE_ID: agent-wallet-profile-idUse this only while developing from a local clone:
mcp_servers:
lnbits_agent_wallet:
command: uv
args:
- --directory
- /path/to/lnbits-agent-wallet-mcp
- run
- lnbits-agent-wallet-mcp
env:
LNBITS_URL: https://your-lnbits.example
LNBITS_AGENT_TOKEN: restricted-runtime-token
LNBITS_AGENT_PROFILE_ID: agent-wallet-profile-idDefault paths are profile-scoped and intentionally narrow:
GET /agent_wallet/api/v1/profiles/{profile_id}/runtime/statusPOST /agent_wallet/api/v1/profiles/{profile_id}/runtime/invoicePOST /agent_wallet/api/v1/profiles/{profile_id}/runtime/dry-runPOST /agent_wallet/api/v1/profiles/{profile_id}/runtime/payGET /agent_wallet/api/v1/profiles/{profile_id}/activity
The wrapper never calls /api/v1/payments directly.
uv run ruff check .
uv run pytest -q
uv build