Skip to main content
Glama
Bitcoin-MCP-Server

Bitcoin-MCP-Server

by teamssUTXO

Bitcoin MCP Server

A comprehensive Model Context Protocol (MCP) server that brings Bitcoin data and functionality directly to AI assistants like Claude, ChatGPT, and other MCP-compatible platforms.

Bitcoin Bitcoin MCP License: MIT Python 3.12


📋 Table of Contents


Related MCP server: Desk3 MCP Server

🤖 What is MCP?

The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external data sources and tools. Think of it as a universal adapter that lets AI models interact with your applications, databases, and APIs in a standardized way.

Key Benefits of MCP

  • Plug-and-Play Integration: Connect AI assistants to external tools without custom code

  • Secure: Controlled access to data and operations

  • Universal: Works across different AI platforms (Claude, ChatGPT, etc.)

  • Modular: Easy to add, remove, or update capabilities

Learn more at modelcontextprotocol.io


💡 Why Use Bitcoin MCP Server?

The Bitcoin MCP Server empowers AI assistants with real-time Bitcoin data and analysis capabilities:

  • Real-time Data: Access current Bitcoin prices, market data, and network statistics

  • Blockchain Analysis: Query blocks, transactions, and addresses directly

  • Mining Insights: Get hashrate, difficulty, and mining pool information

  • Market Intelligence: Track price movements, volume, and market capitalization

  • Network Health: Monitor mempool status, fee estimates, and node statistics

No Bitcoin expertise required - just ask questions in natural language, and the AI handles the technical queries for you!


✨ Features

  • Network Overview: Real-time Bitcoin network statistics including hashrate, difficulty, block production, and transaction volume

  • Transaction Analysis: Detailed transaction information with input/output breakdown, fee analysis, and confirmation status

  • Address Intelligence: Complete address analytics including balance, transaction history and UTXO management

  • Block Explorer: Access to block data with mining pool information, transaction counts, fees, and timestamps

  • Market Data: Real-time Bitcoin price, market capitalization, trading volume, and multi-timeframe performance analysis

  • Mining Insights: Top mining pools ranking, hashrate distribution, network dominance statistics, and 3-month historical trends

  • Fee Recommendations: Dynamic fee estimates for different confirmation speeds (fastest, half-hour, standard, economy)

  • Market Sentiment: Community sentiment tracking and Fear & Greed Index with 7-day historical data

  • Trending Analytics: Discover trending cryptocurrencies, NFT collections, and categories


💼 Use Cases

For Investors & Traders

img

For Developers & Analysts

img

For Researchers & Educators

img

For Business Intelligence

img

You can use these examples :

  • Transaction : a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d

  • Address : 1Ay8vMC7R1UbyCCZRVULMV7iQpHSAbguJP

  • Block (height) : 933135


🚀 Installation

Prerequisites

  • Python 3.12 installed on your system

  • UV package manager (obligatory)

  • An MCP-compatible AI client (e.g., Claude Desktop)

  1. Install UV (if not already installed) UV is a fast Python package installer and resolver.

  • Linux :

curl -LsSf https://astral.sh/uv/install.sh | sh
  • Windows :

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Restart your command-line window after installing this.

  1. Clone the repository:

git clone https://github.com/teamssUTXO/bitcoin_mcp.git
cd bitcoin_mcp
  1. Install dependencies:

uv venv
uv pip install -e .
  1. Install to Claude Desktop:

uv run mcp install src/main.py

Check How to configure MCP Server

Option 2: Using Python/Pip

  1. Clone the repository:

git clone https://github.com/teamssutxo/bitcoin_mcp.git
cd bitcoin_mcp
  1. Create a virtual environment (recommended):

python -m venv venv
source venv/bin/activate  # On Windows: .\venv\Scripts\activate
  1. Install dependencies:

pip install -r requirements.txt
  1. Run the server with Claude Desktop:

Follow the Claude configuration guide: : Config.README.md

Option 3: Using Docker

See README.Docker.md for detailed Docker deployment instructions.

Check server health

To check that the server is working correctly, use the endpoint /health.

Port Configuration

Customize the port with --port 8000 or -p 8000. Default: 3000.


🛠️ Available Tools

The Bitcoin MCP Server provides the following tools organized by category:

📬 Address Tools

  • get_address_overview

  • get_info_about_address

📦 Block Tools

  • get_10_latest_blocks_informations

  • get_block_hash_with_height

  • get_summary_of_latest_block

💸 Transaction Tools

  • get_bitcoin_transaction_infos

  • get_transaction_input_output

  • get_transactions_of_address

💰 Market Tools

  • get_bitcoin_price_usd

  • get_bitcoin_market_data

  • get_cryptomarket_overview

  • get_bitcoin_market_sentiment

  • get_trending_coins

  • get_trending_categories

  • get_trending_nfts

⛏️ Mining Tools

  • get_mining_pools_hashrates_3month

  • get_top_10_mining_pools_rank

  • get_bitcoin_network_mining_pools_statistics

  • get_top1_mining_pool

  • get_mining_pool_by_slugl

🌐 Network Tools

  • get_bitcoin_network_overview

  • get_bitcoin_network_recommended_fees

  • get_bitcoin_network_health

Total: 20+ tools and growing!

For detailed tool documentation, see the inline help in each tool module or use the MCP Inspector.


⚙️ Configuration

Quick Setup for Claude Desktop

After installation, configure Claude Desktop to use the Bitcoin MCP Server:

uv run mcp install src/main.py

This command automatically:

  • Detects your Claude Desktop installation

  • Creates the necessary configuration

  • Registers all Bitcoin tools

Then restart Claude Desktop to activate the server.

Manual Configuration for Claude Desktop

For detailed manual configuration instructions for Claude Desktop and other platforms, see how to configure MCP Server.

Configure the Server

You can customize the server behavior by editing the configuration file located at src/config.py.

Available Configuration Options

API Endpoints

  • MEMPOOL_API_URL: Mempool.space API endpoint (default: https://mempool.space/api)

  • COINGECKO_API_URL: CoinGecko API endpoint (default: https://api.coingecko.com/api/v3)

  • BLOCKCHAIN_INFO_API_URL: Blockchain.info API endpoint (default: https://blockchain.info)

  • HIRO_API_URL: Hiro API endpoint (default: https://api.hiro.so)

  • ALTERNATIVE_API_URL: Alternative.me API endpoint (default: https://api.alternative.me)

Bitcoin Constants

  • SATOSHI: Satoshi conversion factor (default: 100_000_000)

Performance & Reliability

  • ENABLE_CACHE: Enable response caching (default: True)

  • ENABLE_RETRY: Enable automatic retries on failures (default: True)

  • CACHE_TTL_TIME: Cache time-to-live in seconds (default: 60)

  • MAX_RETRIES: Maximum retry attempts for failed requests (default: 3)

Timeout Settings

  • API_CONNECT_TIMEOUT: Connection timeout in seconds (default: 5.0)

  • API_READ_TIMEOUT: Read timeout in seconds (default: 30.0)

  • API_WRITE_TIMEOUT: Write timeout in seconds (default: 10.0)

  • API_POOL_TIMEOUT: Connection pool timeout in seconds (default: 5.0)

Logging Configuration

  • LOGGER_NAME: Logger name (default: "bitcoin_mcp_server")

  • LOG_DIR: Directory for log files (default: "../logs")

  • LOG_LEVEL: Logging level - DEBUG, INFO, WARNING, ERROR (default: "INFO")

  • LOGGER_BACKUP_COUNT: Number of log files to retain (default: 30)

  • LOGGER_CONSOLE_OUTPUT: Enable console logging (default: True)

How to Modify

Edit src/config.py and change the values:

# Example: Increase cache time and reduce retries
CACHE_TTL_TIME: int = 300  # 5 minutes instead of 1
MAX_RETRIES: int = 2       # 2 retries instead of 3

# Example: Enable debug logging
LOG_LEVEL: str = "DEBUG"

Note: Restart the server after making configuration changes for them to take effect.


🔑 API Information

No API Keys Required!

The Bitcoin MCP Server uses free, public APIs that don't require authentication or API keys. This makes setup incredibly simple - just install and go!

Data Sources

The server aggregates data from multiple reliable sources:

Fair Use Policy

While these APIs are free and don't require keys, please use them responsibly:

  • Avoid excessive requests: Don't spam the APIs with rapid-fire queries

  • Rate limiting: The server implements reasonable delays between requests

  • Be respectful: These services are provided free of charge to the community

  • Cache when possible: Results are cached to minimize redundant requests

Note: If you plan to use this server at high volume or in a production environment, consider using API keys or self-hosting Bitcoin Core nodes for data access.


⚠️ Usage Considerations

Message Limits

Using MCP servers will consume more tokens from your AI assistant's message allowance because:

  • Each tool call requires additional context to be sent

  • Results from APIs add to the total token count

  • Complex queries may require multiple tool calls

Impact: You may reach your daily message limit faster when using Bitcoin MCP tools extensively.

Rate Limiting

While the APIs are free, rate limits apply. Intensive usage may result in temporary blocks. Please refer to the client website for specific API usage limits.

CORS

The current configuration allows requests from any origin, which is acceptable for local development but should be explicitly restricted before any production deployment.

Note also that combining allow_origins=["*"] with allow_credentials=True is technically invalid per the CORS spec — browsers will reject credentialed cross-origin requests when the origin is a wildcard. Consider either disabling credentials or explicitly listing allowed origins.


🤝 Contributing

We welcome contributions from the community! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated ❤️.

How to Contribute

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Test with MCP Inspector

  5. Commit your changes

  6. Push to your branch

  7. Open a Pull Request

See CONTRIBUTING.md for detailed guidelines.


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🔒 Security

For security concerns or vulnerability reports, please see our Security Policy.


This project was not vibe-coded.

bitcoin love

Available Tools

23 tools
get_10_latest_blocks_informationsA
Use this to get detailed information and statistics about the 10 most recently mined Bitcoin blocks.

Returns comprehensive metrics in string format for each of the last 10 blocks:
- Block height and unique identifier (hash)
- Mining timestamp
- Transaction count
- Block size (in MB) and weight
- Total fees collected and average fee rate (sat/vB)
- Block reward (in satoshis)
- Mining pool that found the block
- Nonce value

Also includes aggregate statistics across all 10 blocks:
- Total number of transactions
- Average transactions per block
- Average block size
- Average time between blocks (in minutes)

Use cases: When you need to analyze recent blockchain activity trends, compare mining pool performance, or monitor network congestion.

Inputs: no named parameters. Returns: result

get_address_overviewB
Use this to get a simplified overview of a Bitcoin address focusing on balance and cumulative transaction totals.

Returns detailed metrics in string format:
- Current balance (in BTC)
- Total amount ever received (in BTC)
- Total amount ever sent (in BTC)
- Total number of transactions

Accepted Bitcoin address format : base58 or hash160.

Use cases: When you need a quick financial summary without granular details.

Inputs: address (required). Returns: result

get_bitcoin_market_dataA
Use this to get a comprehensive technical and financial report on Bitcoin with extensive historical data and market analysis.

Returns an extensive report in string format including:

**Core Metrics:**
- Current price (USD) and market cap rank
- Total market capitalization
- Genesis date (blockchain creation date)

**Tokenomics & Supply:**
- Total supply and max supply
- Fully Diluted Valuation (FDV)
- Hashing algorithm and block time

**24-Hour Volatility:**
- Highest and lowest prices in last 24h
- Volatility percentage and price gap

**Historical Performance:**
- All-Time High (ATH) price, date, and percentage drop from ATH
- All-Time Low (ATL) price, date, and percentage rise from ATL

**Multi-Timeframe Price Analysis:**
- Price changes over 1 hour, 24 hours, 7 days, 30 days, 60 days, and 1 year
- Previous prices for each timeframe for trend comparison

**Additional Information:**
- GitHub repository link
- Whitepaper link
- Detailed project description

Use cases: When you need in-depth Bitcoin market analysis, historical performance tracking, or comprehensive investment research data. For quick price checks, use `get_bitcoin_price_usd`.

Inputs: no named parameters. Returns: result

get_bitcoin_market_sentimentA
Use this to get a comprehensive sentiment analysis of the Bitcoin market based on community voting and the Fear & Greed Index.

Returns detailed psychological metrics in string format:

**Community Sentiment (CoinGecko):**
- Overall market trend label (bullish/bearish/neutral)
- Percentage of optimistic votes (thumbs up)
- Percentage of pessimistic votes (thumbs down)

**Fear & Greed Index History (7 days):**
- Daily Fear & Greed Index values from Alternative.me
- Historical trend showing market emotion evolution over the past week
- Index ranges from 0 (Extreme Fear) to 100 (Extreme Greed)

Use cases: When you need to gauge overall market sentiment, understand investor psychology, or determine if the market is in fear or greed mode.

Inputs: no named parameters. Returns: result

get_bitcoin_network_healthA
Use this to get a simplified health assessment of the Bitcoin network with a single score and status label.

Returns a concise health summary in string format:
- Network status label (e.g., "Healthy", "Degraded", "Critical")
- Numerical health score out of 100 (0-100 scale)

The health score is a composite metric that considers factors like block production consistency, hashrate stability and transactions volume.

Inputs: no named parameters. Returns: result

get_bitcoin_network_mining_pools_statisticsA
Use this to get aggregate statistics and analysis of the Bitcoin mining pool ecosystem.

Returns comprehensive metrics in string format about the entire mining landscape:

**Global Statistics:**
- Total number of active mining pools tracked
- Total blocks mined across all pools
- Average blocks mined per pool

**Network Dominance Analysis:**
- Name of the current leading pool
- Number of blocks mined by the leader
- Leader's dominance percentage (share of total network)

**Power Distribution Insights:**
- Smallest pool's block count (weakest actor)
- Ratio of leader's performance compared to average (centralization indicator)

This tool provides a macro view of mining centralization and competition in the Bitcoin network.

Use cases: When you need to understand the overall mining landscape, assess centralization risk, or compare the gap between dominant and small pools.

Inputs: no named parameters. Returns: result

get_bitcoin_network_overviewA
Use this for general Bitcoin blockchain questions about current state, health, or status.

Provides comprehensive network overview across five key areas:

**Network Statistics:**
- Current market price in USD
- Network hashrate in TH/s (total mining power)
- Current mining difficulty
- Next difficulty adjustment block height

**Block Metrics:**
- Blocks mined in the last 24 hours
- Total blocks in the blockchain
- Average time between blocks (target: 10 minutes)
- Average block size in bytes

**Transaction Activity:**
- Total transactions in the last 24 hours
- Estimated BTC sent in 24h
- Estimated transaction volume in USD

**Mining Economics:**
- BTC mined in the last 24 hours (new supply)
- Total transaction fees collected in 24h (in BTC)
- Total miner revenue in BTC and USD

**Supply Information:**
- Total BTC in circulation

Inputs: no named parameters. Returns: result

get_bitcoin_price_usdA
Use this to get Bitcoin's current USD price and essential market indicators.

Returns key metrics in string format:
- Current Bitcoin price in USD
- Estimated price 24 hours ago
- 24-hour price change percentage
- Total market capitalization in USD
- 24-hour trading volume in USD
- Volume-to-Cap ratio (liquidity indicator)
- Circulating supply (number of tokens)

Use cases: When you need a quick Bitcoin price check with essential market context.

Inputs: no named parameters. Returns: result

get_bitcoin_transaction_infosA
Use this to get comprehensive information about a specific Bitcoin transaction using its transaction ID (txid).

Returns detailed metrics in string format across four categories:

**Transaction Status:**
- Current status (Confirmed/Unconfirmed with visual indicator)
- Transaction date and time

**Economics & Flow:**
- Total amount transferred in BTC
- Transaction fees paid in BTC
- Fee rate in sat/vB (satoshis per virtual byte)

**Technical Structure:**
- Transaction size in bytes
- Number of inputs (sources of funds)
- Number of outputs (destinations)

**Block Information (if confirmed):**
- Block height where transaction was included
- Block hash containing the transaction

The txid is a unique 64-character hexadecimal identifier for each Bitcoin transaction.

Use cases: When you need to verify a payment, check transaction status, analyze fees paid, or investigate transaction details.

Inputs: txid (required). Returns: result

get_block_hash_with_heightA
Use this to retrieve the unique hash identifier of a Bitcoin block by specifying its height (position in the blockchain).

Returns the block hash in string format for the given height.

Block height represents the block's position in the blockchain (e.g., height 0 is the Genesis block, height 875000 is the 875,000th block).

Use cases: When you need to identify a specific block by its position, to verify block integrity, or to look up historical blocks.

Inputs: height (required). Returns: result

get_cryptomarket_overviewA
Use this to get a comprehensive overview of the global cryptocurrency market conditions and metrics.

Returns detailed metrics in string format:
- Total number of active cryptocurrencies
- Total number of trading markets
- Overall market cap percentage change
- ICO status breakdown (upcoming, ongoing, ended)
- Total market capitalization (formatted by currency)
- Total trading volume (formatted by currency)
- Top 5 cryptocurrencies by market dominance percentage

Use cases: When you need a broad view of the entire crypto ecosystem health, to understand market trends, or to see which cryptocurrencies dominate the market.

Inputs: no named parameters. Returns: result

get_info_about_addressA
Use this to get comprehensive information about a Bitcoin address including balance, transaction activity, and spending patterns.

Returns detailed metrics in string format:
- Current confirmed and unconfirmed balance (in BTC and satoshis)
- Address category and status
- Total transaction count (confirmed + mempool)
- Received outputs count and total amount
- Spent outputs count and total amount

Accepts any Bitcoin address format (Legacy, SegWit, Bech32).

Use cases: When you need a complete snapshot of an address's financial activity and current state.

Inputs: address (required). Returns: result

get_mining_pool_by_slugA
Use this to get comprehensive information about a specific Bitcoin mining pool using its unique slug identifier.

Returns detailed metrics in string format for the requested mining pool:
- Pool name
- Official website link
- Current hashrate (mining power)
- Number of blocks found/mined
- Network share percentage (portion of total Bitcoin blocks)
- Pool's Bitcoin addresses used for receiving block rewards

The slug is a unique identifier for each mining pool (e.g., "foundry-usa", "antpool", "f2pool"). You can obtain slugs from `get_top1_mining_pool` or `get_top_10_mining_pools_rank`.

Use cases: When you need detailed information about a specific mining pool that you already know by name or slug, to investigate a pool's addresses, or to verify a pool's technical specifications.

Inputs: slug (required). Returns: result

get_mining_pools_hashrates_3monthA
Use this to get the top 10 Bitcoin mining pools ranked by their average hashrate over the last 3 months.

Returns detailed metrics in string format for each of the 10 leading mining pools:
- Pool rank position (1-10)
- Pool name
- Average hashrate in EH/s (Exahashes per second) over the 3-month period
- Network share percentage (portion of total Bitcoin network hashrate)

This data shows the historical performance and consistency of mining pools over a 3-month timeframe, providing a more stable view than current block count alone.

Use cases: When you need to analyze mining pool trends over time, understand hashrate distribution patterns, or identify consistently dominant pools.

Inputs: no named parameters. Returns: result

get_summary_of_latest_blockA
Use this to get a summary of the most recently mined block on the Bitcoin blockchain.

Returns detailed metrics in string format:
- Block height (current blockchain tip)
- Block hash
- Timestamp of when the block was mined
- Block Index

Use cases: When you need current blockchain state information, to verify the latest block, or to check recent mining activity.

Inputs: no named parameters. Returns: result

get_top_10_mining_pools_rankA
Use this to get the ranking of the top 10 Bitcoin mining pools based on the number of blocks mined.

Returns detailed metrics in string format for each of the 10 leading mining pools:
- Pool name and rank position (1-10)
- Total number of blocks mined by the pool
- Percentage of total blocks mined (pool's share of network hashrate)
- Grand total of blocks across all pools

This ranking represents the current distribution of Bitcoin mining power and shows which pools control the most hashrate.

Use cases: When you need to understand mining centralization, identify the dominant mining pools, or analyze the distribution of network hashrate.

Inputs: no named parameters. Returns: result

get_top1_mining_poolA
Use this to get information about the current #1 ranked Bitcoin mining pool based on blocks mined over the last 3 months.

Returns detailed metrics in string format for the leading mining pool only:
- Pool name
- Pool slug identifier (used for searching specific pool details)
- Total number of blocks mined in the last 3 months
- Dominance percentage (share of all blocks mined in the 3-month period)
- Link to pool information page

This provides quick access to the most dominant mining pool without needing to retrieve data for all top pools.

Use cases: When you only need to know who currently dominates Bitcoin mining, to check if mining centralization is concerning, or to quickly identify the market leader.

Inputs: no named parameters. Returns: result

get_transaction_input_outputA
Use this to get detailed input and output breakdown of a Bitcoin transaction, including all addresses and amounts involved.

Returns comprehensive flow analysis in string format across four sections:

**Accounting Summary:**
- Total incoming volume (sum of all inputs) in BTC
- Total outgoing volume (sum of all outputs) in BTC
- Network fees paid (difference between inputs and outputs) in BTC

**Detailed UTXO Flow:**
- List of all incoming movements (inputs) with:
  - Source address
  - Amount in BTC
  - Previous transaction reference (prev_out)
- List of all outgoing movements (outputs) with:
  - Destination address
  - Amount in BTC
  - Output index

**Participant Registry:**
- Complete list of sender addresses (count included)
- Complete list of recipient addresses (count included)

This provides full transparency into the transaction's inputs (where funds came from) and outputs (where funds went), essential for tracking fund flow and identifying all parties involved.

Use cases: When you need to trace Bitcoin flow, identify sender/recipient addresses, analyze UTXO structure, or investigate complex multi-party transactions.

Inputs: txid (required). Returns: result

get_transactions_of_addressA
Use this to get the complete transaction history of a Bitcoin address.

Returns a chronological list of all transactions in string format, with each transaction showing:
- Transaction ID (txid) - unique identifier for the transaction
- Transaction date and time
- Amount sent in satoshis

This provides the full transaction history for an address, allowing you to see all incoming and outgoing payments over time. Each transaction can be further investigated using `get_bitcoin_transaction_infos` or `get_transaction_input_output` with the returned txid.

Accepts any Bitcoin address format (Legacy, SegWit, Bech32).

Use cases: When you need to audit an address's activity, track payment history, verify specific transactions, or investigate suspicious activity.

Inputs: address (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 23 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is overlap between get_address_overview and get_info_about_address, as well as between get_10_latest_blocks_informations and get_summary_of_latest_block. Descriptions help differentiate, but some ambiguity remains.

    Naming Consistency4/5

    Tools consistently use snake_case with a 'get_' prefix, but naming patterns vary in specificity and style (e.g., 'get_10_latest_blocks_informations' vs 'get_summary_of_latest_block'). Minor inconsistencies like 'informations' (grammatical error) and varying verbosity.

    Tool Count4/5

    23 tools is a reasonable number for a comprehensive Bitcoin information server. The scope is broad, covering network, transactions, mining, and market data, and each tool serves a clear purpose.

    Completeness5/5

    The tool set thoroughly covers Bitcoin-related queries: network stats, addresses, transactions, blocks, mining pools, fees, market data, sentiment, and trending crypto/NFTs. No obvious gaps for typical informational needs.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Cryptocurrency MCP Server! Free! This powerful tool is designed for blockchain enthusiasts, providing comprehensive, real-time cryptocurrency information at your fingertips. Whether you're an experienced trader or just starting your journey into the crypto world.
      16
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for Bitcoin block explorer and mempool/fee statistics, providing tools to query fees, mempool stats, blocks, transactions, addresses, hashrate, and mining pools.
      300 npm
      MIT