bitcoin-mcp
Author: AbdelStark
Description: Model Context Protocol server that lets AI agents interact with the Bitcoin & Lightning networks (key-gen, address validation, tx/block queries, invoice decode, LNBits payments, etc.).
Stars: 54
Forks: 12
License: MIT License
Category: Specialized
Overview
Installation
git clone https://github.com/AbdelStark/bitcoin-mcp.git
cd bitcoin-mcpnpm installnpm run build
# or for hot-reload during development
npm run dev# ==== Bitcoin RPC ====
BITCOIN_RPC_HOST=127.0.0.1
BITCOIN_RPC_PORT=8332 # 18332 for testnet
BITCOIN_RPC_USER=<user>
BITCOIN_RPC_PASSWORD=<password>
# ==== Lightning (optional) ====
LND_GRPC_HOST=127.0.0.1:10009
LND_CERT_PATH=/home/user/.lnd/tls.cert
LND_MACAROON_PATH=/home/user/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
# ==== Server ====
MCP_PORT=3030npm start # production build (uses dist/)
# or
npm run dev # ts-node + nodemon (development)curl http://localhost:3030/health # → { "status": "ok" }
Docker (alternative)
docker build -t bitcoin-mcp .
docker run -d -p 3030:3030 \
The server will expose REST endpoints under /api and register itself as an MCP tool once running.Key Generation
Create new Bitcoin key pairs — including address, public key, and private key (WIF).
Address Validation
Validate the correctness of a Bitcoin address.
Transaction Decoding
Parse a raw Bitcoin transaction and display its details in a human-readable format.
Latest Block
Retrieve details about the most recent Bitcoin block (hash, height, timestamp, transaction count, etc.).
Transaction Details
Fetch detailed information about a Bitcoin transaction using its TXID.
Invoice Decoding
Parse a BOLT11 Lightning invoice and present the information in a human-readable format.
Payment
Pay a Lightning invoice directly from your LNBits wallet.