Tutorials
MCP: Interact with Bitcoin via an LLM
12 min
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 https //github com/maestro org/maestro mcp server https //github com/maestro org/maestro mcp server maestro mcp server allows for interacting with bitcoin through the interface of an llm client maestro mcp transforms how llms engage with the bitcoin network, turning them into powerful, on chain agents bridging claude (or any llm client) with our mcp server enables the llm to query blocks, inspect transactions, analyze addresses, and even take action on behalf of the user 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 https //claude ai/download https //claude ai/download claude desktop client alongside the hosted maestro mcp server to communicate with the bitcoin network and start making intelligent, on chain requests for more client examples, see our https //github com/maestro org/maestro mcp client examples https //github com/maestro org/maestro mcp client examples maestro mcp client examples repo and refer to our https //github com/maestro org/maestro mcp client examples/tree/main/examples/claude#local https //github com/maestro org/maestro mcp client examples/tree/main/examples/claude#local local setup if you'd like to understand how to connect claude desktop to a locally running mcp server 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 requirements obtain a maestro https //dashboard gomaestro org https //dashboard gomaestro org api key configuration download claude desktop here https //claude ai/download open claude desktop settings select edit config open the claude desktop app configuration file located at macos /library/application support/claude/claude desktop config json windows %appdata%\claude\claude desktop config json copy the below contents into this config file be sure to replace the \<maestro api key> with your generated api and that the key you generate matches the network you are looking to connect with hosted mainnet https //xbt mainnet gomaestro api org/v0/mcp https //xbt mainnet gomaestro api org/v0/mcp hosted testnet4 https //xbt testnet gomaestro api org/v0/mcp claude desktop config json { "mcpservers" { "maestro mcp server" { "command" "npx", "args" \[ " y", "mcp remote", "https //xbt mainnet gomaestro api org/v0/mcp", " header", "authorization ${auth header}", " transport", "http only" ], "env" { "auth header" "bearer \<maestro api key>" } } } } usage restart claude after any change to either the claude desktop config json or the source code launch claude desktop locate the tools icon select maestro mcp server 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 " "fetch metaprotocol activity for this address bc1qcx7ys0ahvtfqcc63sfn6axls0qrhkadnslpd94 " you may need to approve the request within claude 🎉 you’re done! you now have communicated with the bitcoin network via the maestro mcp this is just the beginning of a new development frontier one where creativity reigns and the only limitation to building new applications leveraging bitcoin data is your imagination be sure to review maestro's rate limits and pricing tiers https //www gomaestro org/pricing to select the plan that best fits your application's needs debugging the following tools are useful for debugging a locally running mcp server inspector https //github com/modelcontextprotocol/inspectormcp cli https //github com/wong2/mcp cli 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