MCP HubMCP Hub
AbdelStark

bitcoin-mcp

by: AbdelStark

Bitcoin & Lightning Network MCP Server.

31created 05/02/2025
Visit
Bitcoin
Lightning

📌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 VideoGoose 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):

  1. Download and install Claude Desktop from the official source.

  2. 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"]
        }
      }
    }
    
  3. 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)

  1. Add an extension in Goose configuration (goose configure or Goose Desktop app).

  2. Choose Command-Line Extension.

  3. For the extension:

    • Name: e.g., "bitcoin"

    • Command:

      npx -y bitcoin-mcp@latest
      
  4. Enable the extension.

  5. Start Goose session with:

    goose session --with-extension "bitcoin"
    

Using SSE (Remote Extension)

  1. Run the Bitcoin MCP server as a standalone service accessible via HTTP (e.g., http://localhost:9000).
  2. Add a Remote Extension in Goose configuration and provide the server URL.
  3. Enable the extension.
  4. 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.