bitcoin-mcp
by: AbdelStark
Bitcoin & Lightning Network MCP Server.
📌Overview
Purpose: The Bitcoin & Lightning Network MCP Server serves to facilitate interaction between AI models and the Bitcoin blockchain, enabling various cryptocurrency operations.
Overview: This Model Context Protocol (MCP) server allows AI models to perform essential Bitcoin functions such as generating keys, validating addresses, decoding transactions, and querying blockchain data. It is designed to seamlessly integrate with AI systems for enhanced cryptocurrency operations.
Key Features:
-
Key Generation: Enables the creation of Bitcoin key pairs, allowing for secure transactions and user identification.
-
Address Validation: Validates Bitcoin addresses to ensure correctness, reducing transaction errors.
-
Transaction Decoding: Parses raw Bitcoin transactions and converts them into a human-readable format to facilitate understanding and verification.
-
Blockchain Queries: Provides information about the latest blocks and transaction details, enabling users to keep track of the Bitcoin network activity.
-
Lightning Network Support: Includes functionality for parsing and paying Lightning invoices, enhancing transaction flexibility.
₿itcoin & Lightning Network MCP Server
Overview
A Model Context Protocol (MCP) server that enables AI models to interact with Bitcoin and the Lightning Network, allowing them to generate keys, validate addresses, decode transactions, query the blockchain, and more.
🎮 Demo
Claude Demo Video | Goose Demo Video |
---|
🔧 Features
- 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 raw Bitcoin transactions and display their details in a human-readable format.
- Blockchain Queries:
- Latest Block: Retrieve details about the most recent block (hash, height, timestamp, etc.).
- Transaction Details: Fetch detailed info about a transaction using its TXID.
- Lightning Network:
- Invoice Decoding: Parse BOLT11 Lightning invoices and display readable information.
- Payment: Pay a Lightning invoice directly from your LNBits wallet.
🔑 Claude Desktop Integration
To use the Bitcoin MCP server with Claude Desktop (Anthropic's desktop app):
-
Download and install Claude Desktop from the official source.
-
Configure Claude Desktop by editing the configuration file to add the Bitcoin MCP server:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
Add this JSON snippet under
"mcpServers"
:{ "mcpServers": { "bitcoin-mcp": { "command": "npx", "args": ["-y", "bitcoin-mcp@latest"] } } }
- macOS:
-
Restart Claude Desktop to apply changes.
Testing Claude Desktop Integration
- Ask Claude Bitcoin-related questions like:
- "What's the latest block on the Bitcoin network?"
- "Give me information about the transaction with TXID abcdef1234567890..."
- Verify the response includes blockchain data instead of generic answers.
- Check logs for troubleshooting (macOS:
~/Library/Logs/Claude/
; Windows:%APPDATA%\Claude\logs\
).
🦆 Goose Integration
Goose is an open-source AI agent framework that supports MCP servers as extensions. The Bitcoin MCP server can be integrated with Goose either as a local process (STDIO) or a remote service via Server-Sent Events (SSE).
Using STDIO (Local Extension)
-
Add an extension in Goose configuration (
goose configure
or Goose Desktop app). -
Choose Command-Line Extension.
-
For the extension:
-
Name: e.g., "bitcoin"
-
Command:
npx -y bitcoin-mcp@latest
-
-
Enable the extension.
-
Start Goose session with:
goose session --with-extension "bitcoin"
Using SSE (Remote Extension)
- Run the Bitcoin MCP server as a standalone service accessible via HTTP (e.g.,
http://localhost:9000
). - Add a Remote Extension in Goose configuration and provide the server URL.
- Enable the extension.
- Use Goose chats or sessions to query Bitcoin data through the MCP extension.
If Goose does not respond properly, ensure the extension is enabled and the server is running.
📦 Development Setup
See the development instructions in the Development Setup guide.
Lightning Network Configuration (Optional)
To use Lightning features, configure LNBits connection details:
{
"lnbitsUrl": "https://demo.lnbits.com",
"lnbitsAdminKey": "your_admin_key",
"lnbitsReadKey": "your_read_key"
}
Get these keys by creating an account at LNBits, creating a wallet, and obtaining API info.
📦 Available Tools
See the API Reference guide for available tools and APIs.
🚨 Error Handling
The server uses custom error types for Bitcoin operations and blockchain queries. Errors are logged and included in client responses for debugging.
🤝 Contributing
Contributions and feature requests are welcome via pull requests or issues on GitHub.
📝 License
This project is licensed under the MIT License.