Interact with Bitcoin and Lightning Network
## Bitcoin & Lightning MCP Server: Bitcoin Network Integration The **Bitcoin & Lightning MCP Server** integrates Bitcoin and Lightning Network capabilities into Google Antigravity, enabling developers to query blockchain data, manage wallets, and interact with the Lightning payment network. ### Why Bitcoin MCP? - **Blockchain queries** - Query Bitcoin transaction and block data - **Wallet management** - Create and manage Bitcoin wallets - **Lightning Network** - Fast, low-cost Lightning payments - **Address monitoring** - Watch addresses for transactions - **Fee estimation** - Get current network fee estimates ### Key Features #### 1. Blockchain Queries ```python # Get block information block = await mcp.call("bitcoin", "get_block", { "block_hash": "00000000000000000002..." }) print(f"Block height: {block[\"height\"]}") print(f"Transactions: {len(block[\"tx\"])}") # Get transaction tx = await mcp.call("bitcoin", "get_transaction", { "txid": "abc123..." }) print(f"Confirmations: {tx[\"confirmations\"]}") ``` #### 2. Wallet Operations ```python # Create wallet wallet = await mcp.call("bitcoin", "create_wallet", { "name": "project-wallet", "type": "segwit" }) # Get new address address = await mcp.call("bitcoin", "get_new_address", { "wallet": "project-wallet", "label": "donations" }) print(f"New address: {address}") # Get balance balance = await mcp.call("bitcoin", "get_balance", { "wallet": "project-wallet" }) print(f"Balance: {balance[\"confirmed\"]} BTC") ``` #### 3. Lightning Network ```python # Open Lightning channel channel = await mcp.call("bitcoin", "open_channel", { "node_pubkey": "03abc...", "amount_sat": 1000000 }) # Create invoice invoice = await mcp.call("bitcoin", "create_invoice", { "amount_sat": 10000, "memo": "Payment for service" }) print(f"Invoice: {invoice[\"payment_request\"]}") # Pay invoice payment = await mcp.call("bitcoin", "pay_invoice", { "payment_request": "lnbc..." }) ``` #### 4. Fee Estimation ```python # Get fee estimates fees = await mcp.call("bitcoin", "estimate_fee", { "target_blocks": [1, 6, 144] }) print(f"Next block: {fees[\"1\"]} sat/vB") print(f"1 hour: {fees[\"6\"]} sat/vB") print(f"1 day: {fees[\"144\"]} sat/vB") ``` ### Configuration ```json { "mcpServers": { "bitcoin": { "command": "npx", "args": ["-y", "@anthropic/mcp-bitcoin"], "env": { "BITCOIN_RPC_URL": "http://localhost:8332", "BITCOIN_RPC_USER": "user", "BITCOIN_RPC_PASS": "password", "LND_REST_URL": "https://localhost:8080" } } } } ``` ### Use Cases **Payment Integration**: Accept Bitcoin payments. **Blockchain Analysis**: Query and analyze transactions. **Lightning Payments**: Fast micropayments. **Wallet Services**: Build wallet applications. The Bitcoin MCP Server enables Bitcoin and Lightning integration.
{
"mcpServers": {
"bitcoin": {
"mcpServers": {
"bitcoin": {
"env": {
"BITCOIN_RPC_URL": "http://localhost:8332",
"BITCOIN_RPC_USER": "user",
"BITCOIN_RPC_PASSWORD": "password"
},
"args": [
"-y",
"bitcoin-mcp"
],
"command": "npx"
}
}
}
}
}