Bitcoin MCP server

Integrates with Bitcoin network and blockchain data via Blockstream API to enable transaction monitoring, wallet management, and blockchain analysis
Back to servers
Setup instructions
Provider
Abdel Stark
Release date
Feb 08, 2025
Language
TypeScript
Package
Stats
2.6K downloads
56 stars

This MCP server enables AI models to interact with Bitcoin and Lightning Network, providing capabilities for key generation, address validation, transaction decoding, blockchain queries, and Lightning Network operations. Here's how to get started with installing and using it.

Installation

Using with Claude Desktop

  1. Install Claude Desktop from the official download page

  2. Configure Claude Desktop to use the Bitcoin MCP server by editing the configuration file:

    macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    Windows: %APPDATA%\Claude\claude_desktop_config.json

  3. Add this entry in the mcpServers section:

    {
      "mcpServers": {
        "bitcoin-mcp": {
          "command": "npx",
          "args": ["-y", "bitcoin-mcp@latest"]
        }
      }
    }
    
  4. Restart Claude Desktop for the changes to take effect

Using with Goose

Method 1: Local Extension (STDIO)

  1. Open Goose's configuration interface by running goose configure or in the Goose Desktop app via Settings > Extensions

  2. Choose Add Extension and select Command-Line Extension

  3. Enter the extension details:

    • Name: "bitcoin" (or any name you prefer)
    • Command: npx -y bitcoin-mcp@latest
  4. Ensure the extension is enabled

  5. Start a Goose session that includes the extension:

    goose session --with-extension "bitcoin"
    

Method 2: Remote Extension (SSE)

  1. Start the Bitcoin MCP server separately as a standalone service that listens on a specific port

  2. In Goose, add a new Remote Extension

  3. Enter a name for the extension and provide the server's URL (e.g., http://localhost:9000)

  4. Enable the extension in Goose's settings

Lightning Network Configuration (Optional)

To use Lightning Network features, you need to configure LNBits connection details:

{
  "lnbitsUrl": "https://demo.lnbits.com",
  "lnbitsAdminKey": "your_admin_key",
  "lnbitsReadKey": "your_read_key"
}

To obtain these values:

  1. Create an account at LNBits
  2. Create a new wallet
  3. Go to API info to find your API keys

Usage Examples

Once installed, you can interact with the Bitcoin MCP server through Claude or Goose by asking questions related to Bitcoin operations. Here are some examples:

Key Generation

Ask: "Generate a new Bitcoin key pair for me"

Address Validation

Ask: "Is this Bitcoin address valid: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa?"

Transaction Decoding

Ask: "Decode this Bitcoin transaction: [raw transaction hex]"

Blockchain Queries

Ask: "What's the latest block on the Bitcoin network?"

Ask: "Give me information about the transaction with TXID abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"

Lightning Network Operations

Ask: "Decode this Lightning invoice: [BOLT11 invoice]"

Ask: "Pay this Lightning invoice: [BOLT11 invoice]" (requires proper LNBits configuration)

Troubleshooting

If you encounter issues with the MCP server connection:

  1. Check Claude's logs (if using Claude Desktop):

    • macOS: ~/Library/Logs/Claude/
    • Windows: %APPDATA%\Claude\logs\

    Look for mcp.log and mcp-server-bitcoin-mcp.log files

  2. Make sure the server is running correctly (if using as a remote extension)

  3. Verify your configuration and ensure all paths and commands are correct

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "bitcoin-mcp" '{"command":"npx","args":["-y","bitcoin-mcp@latest"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "bitcoin-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "bitcoin-mcp@latest"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "bitcoin-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "bitcoin-mcp@latest"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later