================== /// MCP /// /// BIT /// ================== [server:online] [protocol:ready]
bitcoin-mcp
by AbdelStark
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.).
54
12
Specialized01
Key Generation
Create new Bitcoin key pairs — including address, public key, and private key (WIF).
02
Address Validation
Validate the correctness of a Bitcoin address.
03
Transaction Decoding
Parse a raw Bitcoin transaction and display its details in a human-readable format.
04
Latest Block
Retrieve details about the most recent Bitcoin block (hash, height, timestamp, transaction count, etc.).
05
Transaction Details
Fetch detailed information about a Bitcoin transaction using its TXID.
06
Invoice Decoding
Parse a BOLT11 Lightning invoice and present the information in a human-readable format.
07
Payment
Pay a Lightning invoice directly from your LNBits wallet.
Installation
Prerequisites
- Node.js ≥ 20 and npm ≥ 9
- A running Bitcoin Core node with RPC enabled (testnet or mainnet)
- (Optional) A running LND or Core-Lightning instance if you want Lightning support
Steps
1. Clone the repo
git clone https://github.com/AbdelStark/bitcoin-mcp.git
cd bitcoin-mcp
2. Install dependencies
npm install
3. Build the TypeScript source
npm run build
# or for hot-reload during development
npm run dev
4. Configure environment (create .env at project root)
# ==== 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=3030
5. Start the MCP server
npm start # production build (uses dist/)
# or
npm run dev # ts-node + nodemon (development)
6. Verify
-e BITCOIN_RPC_HOST=bitcoin-node \
-e BITCOIN_RPC_USER=... \
-e BITCOIN_RPC_PASSWORD=... \
--name bitcoin-mcp bitcoin-mcp
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.
Documentation
License: MIT License
Updated 7/30/2025