Tutorials

MCP: Interact with Bitcoin via an LLM

15min

The Model Context Protocol (MCP) is an open standard that enables developers to build secure, two-way connections between their data sources and AI-powered tools.

For additional information about MCP, its origins, and Claude, read more from the creators, Anthropic.



The Maestro MCP server allows for interacting with Bitcoin through the interface of an LLM client.

This server functionality provides the LLM with a set of tools for exploring blocks, transactions, addresses, and other aspects of the Bitcoin blockchain, allowing the LLM to not only retrieve and make infereances on on-chain data, but also to take action on behalf of the user; ie, serve as an agent.

In this tutorial, we will use Claude AI's Desktop client alongside the Maestro MCP server to communicate with the Bitcoin network via Maestro.

Some of the MCP server functionality will not work if you are using the Artist tier; a Composer-level subscription or higher will be needed to access the more advanced MCP features, such as those related to Mempool API activities.

Consult the pricing page for more information.



Installation

Requirements

  • Python >=3.10
  • Python MCP SDK >= 1.2.0
  • uv

Install UV

Bash


Setup Virual Environment

Bash


Configure Claude (Desktop)

Download Claude Desktop here.

Steps

  1. Open Claude Desktop settings

    Document image
    
  2. Select Edit Config

    Document image
    
  3. Open the Claude App configuration file located at: ~/Library/Application Support/Claude/claude_desktop_config.json and copy the below contents into this file

You will need the following to continue:

  1. Absolute path to uv; ie, which uv
  2. Absolute path to maestro-mcp repo
  3. A Maestro API key
JSON


Usage

  • Restart Claude after any change to either the claude_desktop_config.json or the source code.
  1. Launch Claude Desktop
  2. Locate hammer icon

    Document image
    
  3. View available MCP tools

    Document image
    
  4. Prompt Claude

Examples:

  • "Fetch the latest Bitcoin block"
  • "Get the blockchain info for Bitcoin"
  • "Fetch all UTXOs for this address: bc1prqpwzqqcfzlrtjz3at5kuz4zevqsmvxc5xjuzvg58y48leu67x0q0kvy85"

See usage for viewing all the available MCP tools.

Document image


You will need to approve the request within Claude.

Debugging

CLI inspector tool

Logs

Bash


Support

If you are experiencing any trouble with the above, open an issue or reach out on Discord.