home / mcp / bitcoin mcp server

Bitcoin MCP Server

Bitcoin & Lightning Network MCP Server.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "abdelstark-bitcoin-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "bitcoin-mcp@latest"
      ],
      "env": {
        "LNbitsUrl": "https://demo.lnbits.com"
      }
    }
  }
}

You can use the Bitcoin and Lightning Network MCP Server to let AI models interact with the Bitcoin blockchain and Lightning Network. It supports key generation, address validation, transaction decoding, blockchain queries, and Lightning tools like invoice decoding and payments, enabling rich, programmatic access for your AI workflows.

How to use

To use the Bitcoin MCP Server with an MCP client, start the local MCP server process and configure your client to connect via the standard MCP transport. You can run the server as a local process and then have your MCP client issue requests to the server for operations such as creating keys, validating addresses, decoding transactions, fetching the latest block, retrieving transaction details, decoding Lightning invoices, and paying Lightning invoices.

How to install

Prerequisites: Node.js and an MCP client you intend to use (Claude Desktop, Goose, or another MCP-enabled client). Install Node.js from your operating systemโ€™s package manager or website, and ensure you can run npm or npx from the command line.

# Start the Bitcoin MCP Server via npx as a local stdio extension
npx -y bitcoin-mcp@latest

Configuration and usage notes

If you plan to integrate with Claude Desktop, Goose, or another MCP client, you can configure the server as a local stdio MCP extension. The recommended startup command uses npx to fetch and run the latest Bitcoin MCP server package.

Lightning Network configuration (optional)

To enable Lightning Network features, provide LNBits connection details. These settings are optional and only needed if you plan to use LN-related tools such as decoding invoices or paying invoices.

{
  "lnbitsUrl": "https://demo.lnbits.com",
  "lnbitsAdminKey": "YOUR_ADMIN_KEY",
  "lnbitsReadKey": "YOUR_READ_KEY"
}

Server configuration (example)

Below is a complete MCP server configuration using a local stdio transport. This starts the server via npx and uses the latest bitcoin-mcp package.

{
  "mcpServers": [
    {
      "name": "bitcoin",
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "bitcoin-mcp@latest"]
    }
  ],
  "envVars": [
    {
      "name": "LNbitsUrl",
      "description": "LNBits API base URL for Lightning Network features",
      "required": false,
      "example": "https://demo.lnbits.com"
    }
  ]
}

Security and troubleshooting

Keep the MCP server up to date and restrict access to the local host or trusted networks. If you encounter connection issues, verify the MCP server process is running and that your MCP client is configured to use the correct stdio transport endpoint.

Development and tooling notes

The server supports a range of Bitcoin and Lightning Network tools exposed through the MCP interface. You can extend or customize your setup by integrating with your preferred MCP client and adding LNBits configuration as needed.

Contributing and licensing

Contributions are welcome. The project is licensed under the MIT License, and you should follow standard open-source contribution practices when submitting changes.

Available tools

Key Generation

Create new Bitcoin key pairs including address, public key, and private key in WIF format.

Address Validation

Validate the correctness of a Bitcoin address.

Transaction Decoding

Decode a raw Bitcoin transaction into a human-readable structure.

Latest Block

Fetch details about the most recent block on the Bitcoin network.

Transaction Details

Retrieve detailed information for a given TXID.

Invoice Decoding

Decode a BOLT11 Lightning invoice into readable fields.

Lightning Payment

Pay a Lightning invoice directly from your LNBits wallet.