Tutorials
MCP: Interact with Bitcoin via an LLM
15min
the model context protocol (mcp) https //modelcontextprotocol io/introduction 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 https //claude ai , read more from the creators, anthropic https //www anthropic com/news/model context protocol the maestro mcp server https //github com/maestro org/maestro mcp 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 https //github com/resources/articles/ai/what are ai agents in this tutorial, we will use claude ai's https //claude ai 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 https //www gomaestro org/pricing for more information installation requirements python >=3 10 python mcp sdk >= 1 2 0 uv install uv curl lssf https //astral sh/uv/install sh | sh setup virual environment \# create a virtual environment uv venv \# activate virtual environment \# linux/macos source venv/bin/activate \# windows \# venv\scripts\activate \# install dependencies uv pip install configure claude (desktop) download claude desktop here https //claude ai/download steps open claude desktop settings select edit config 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 absolute path to uv ; ie, which uv absolute path to maestro mcp repo a maestro api key { "mcpservers" { "maestro mcp" { "command" "/absolute/path/to/uv", "args" \[ " directory", "/absolute/path/to/maestro mcp", "run", "maestro py" ], "env" { "maestro base url" "https //xbt mainnet gomaestro api org/v0", "maestro api key" "\<maestro api key>" } } } } usage restart claude after any change to either the claude desktop config json or the source code launch claude desktop locate hammer icon view available mcp tools prompt claude examples "fetch the latest bitcoin block" "get the blockchain info for bitcoin" "fetch all utxos for this address bc1prqpwzqqcfzlrtjz3at5kuz4zevqsmvxc5xjuzvg58y48leu67x0q0kvy85 " see usage https //docs gomaestro org/bitcoin/mcp interact with bitcoin via an llm#jmoe2 for viewing all the available mcp tools you will need to approve the request within claude debugging cli inspector tool mcp cli https //github com/wong2/mcp cli logs tail n 20 f /library/logs/claude/mcp server maestro mcp log support if you are experiencing any trouble with the above, open an issue https //github com/maestro org/maestro mcp/issues/new or reach out on discord https //discord gg/es2rdhbjt3