Skip to main content

Bitcoin MCP server for blockchain data access via Model Context Protocol

Project description

bitcoin-mcp

bitcoin-mcp extends AI utilities with accurate Bitcoin blockchain data based on MCP. bitcoin-mcp is a streamlined Model Context Protocol (MCP) server implementation that interfaces with Bitcoin Core (full-node) through bitcoin-cli. This bitcoin-mcp server provides Claude Desktop (or other mcp clients) with READ access to Bitcoin blockchain data WITHOUT wallet functionality.

screenshot-btc-mcp0

Features

AI agent meets the most secure data ledger - Bitcoin.

  • Query real-time Bitcoin blockchain information (via bitcoin-cli, but WITHOUT any wallet calls)

  • Access mempool, blocks, and transaction data

  • Generate custom 3D visualization of BTC blocks based on TX output values and BitFeed representation (i.e., those beautiful rectangles on mempool.space)

    image

Prerequisites

  • Claude Desktop (or other mcp clients)
  • Python 3.10+
  • Bitcoin full-node (w. bitcoin-cli)
  • (Windows)

Installation

  1. Clone the repo to your up-to-date btc full node machine (required for bitcoin-mcp to work)

  2. Install dependencies:

pip install -r requirements.txt
  1. Make sure Bitcoin Core is up-to-date and running. Configure .env and add BITCOIN_CLI_PATH so that MCP server can find bitcoin-cli
  • Have this line BITCOIN_CLI_PATH=C:\\Program Files\\Bitcoin\\daemon\\bitcoin-cli in .env
  1. Claude Desktop Configuration (standard setup for any mcp servers)
  • update path\\to\\ to your local bitcoin-mcp folder
{
  "mcpServers": {
    "bitcoin-mcp": {
      "command": "python",
      "args": ["path\\to\\bitcoin-mcp\\bitcoin_mcp_server.py"],
      "env": {}
    }
  }
}

Test the server:

You can test the python server to see if it loads your btc full node.

python bitcoin_mcp_server.py

Available Tools

Mainly for mcp clients like Claude Desktop to utilize Bitcoin blockchain info, so NO WALLET FUNCTIONS ARE INCLUDED.

Blockchain Information

Tool Description
get_blockchain_info Get current blockchain state
get_block_hash Get block hash for a specific height
get_block Get block data by hash
get_block_stats Get block statistics
get_chain_tips Get information about chain tips
get_chain_tx_stats Get chain transaction statistics
get_difficulty Get current difficulty
get_network_info Get network information
get_blockchain_status Get comprehensive blockchain status
get_detailed_block_info Get detailed block information
search_blocks Search for blocks meeting criteria
get_bitfeed_3d_representation Get 3D representation of a BTC block based on TX data

Transaction Information

Tool Description
get_mempool_info Get mempool information
get_tx_out Get UTXO information
get_tx_out_set_info Get UTXO set statistics
get_raw_transaction Get raw transaction data
decode_raw_transaction Decode raw transaction
estimate_smart_fee Estimate transaction fee
analyze_transaction Analyze transaction details

Analytics

Tool Description
get_difficulty_history Get difficulty adjustment history
get_fee_history Get transaction fee history
get_hashrate_estimate Estimate network hashrate
get_block_time_distribution Analyze block time distribution
analyze_blockchain Comprehensive blockchain analysis

Configuration

Tool Description
configure_bitcoin_cli Configure bitcoin-cli settings
get_config_info Get current server configuration
update_server_config Update server configuration

Code Structure

  • bitcoin_mcp_server.py: Main server entry point
  • bitcoin_connection.py: Bitcoin Core connection utilities
  • bitcoin_config.py: Configuration management
  • bitcoin_transactions.py: Transaction analysis utilities
  • bitcoin_utils.py: Blockchain utilities
  • bitcoin_analytics.py: Advanced blockchain analytics
  • bitfeed.py: 3D representations of BTC blocks

Security Notes

  • This mcp server does not include wallet functionality in Bitcoin Core (u can add those urself)
  • By default, the server only binds to localhost (127.0.0.1)
  • Enables read-only access to blockchain data

Example Usage

Get current blockchain information:

Tell me about the current state of the Bitcoin blockchain

Analyze a specific block:

Show me detailed information about block 800000

Get transaction fee history:

What have transaction fees been like over the past 24 hours?

Estimate hashrate:

What is the current estimated hashrate of the Bitcoin network?

Generate 3D representation (note that context length may not fit all TXs, try blocks where TX number < 20 ):

Build a react threejs viewer for btc block 111111

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_runeape_sats_bitcoin_mcp-0.1.0.tar.gz (128.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_runeape_sats_bitcoin_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_runeape_sats_bitcoin_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 128.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_runeape_sats_bitcoin_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e5396994734e5ddcc270ae6025313e78e439ede1fb073a3f8b4bbe7bd6d7680f
MD5 37dfa6ed85be7a06fed6e68cfb38f237
BLAKE2b-256 9509232d6a3a1d9768ed8c6d11cb6363d5c84c6c7a85047a175bf24a9466cd2a

See more details on using hashes here.

File details

Details for the file iflow_mcp_runeape_sats_bitcoin_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_runeape_sats_bitcoin_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_runeape_sats_bitcoin_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a83ea8c4014a21160317006e80617a0ddc70f51098d3439e8dc88ddede6d32d0
MD5 8f51e9313e9729ea5818aae429f14cce
BLAKE2b-256 90b8745c438b2e87ec77d783cb7b4afc9da1e6915886f18d61f1ba23aaf0d0f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page