Provides real-time Bitcoin blockchain data through the mempool.space API, offering tools to query address statistics, transaction histories, UTXOs, transaction details, and block information.
Used for schema validation of tool parameters, ensuring proper data validation for Bitcoin-related queries.
Bitcoin MCP Server
A Model Context Protocol (MCP) server that provides real-time Bitcoin blockchain data by querying the mempool.space API.
Features
This MCP server offers five specialized tools for querying Bitcoin blockchain data:
🔍 Address Tools
get-address-stats
Get basic statistics for any Bitcoin address.
Input:
address
(string): Bitcoin address to query
Output:
- Chain statistics (funded/spent amounts, transaction counts)
- Mempool statistics (pending transactions)
Example:
get-address-transactions
Get transaction history for a Bitcoin address.
Input:
address
(string): Bitcoin address to querylimit
(optional, number): Number of transactions to return (1-50, default: 10)
Output:
- List of recent transactions with status, dates, fees, and sizes
get-address-utxos
Get current UTXOs (unspent transaction outputs) for a Bitcoin address.
Input:
address
(string): Bitcoin address to querylimit
(optional, number): Number of UTXOs to return (1-50, default: 10)
Output:
- List of current UTXOs with amounts, confirmation status, and dates
🔗 Transaction Tools
get-transaction
Get detailed information about a specific Bitcoin transaction.
Input:
txid
(string): Transaction ID (hash) to query
Output:
- Complete transaction details including:
- Basic info (version, size, weight, fee)
- Confirmation status and block information
- Input and output details with amounts and addresses
🧱 Block Tools
get-block
Get information about a specific Bitcoin block.
Input:
block_height
(number): Block height to query
Output:
- Block details including:
- Hash, version, merkle root
- Previous block hash and timestamp
- Size, weight, and transaction count
- Fee statistics
Installation
- Clone this repository:
- Install dependencies:
- Build the project:
Usage
Running the Server
Start the MCP server:
The server runs on stdio and can be connected to any MCP-compatible client.
Example Queries
Here are some example queries you can make with this MCP server:
Get Address Statistics
Get Recent Transactions
Get Transaction Details
Get Block Information
API Endpoints
This MCP server uses the following mempool.space API endpoints:
GET /api/address/{address}
- Address statisticsGET /api/address/{address}/txs
- Address transaction historyGET /api/address/{address}/utxo
- Address UTXOsGET /api/tx/{txid}
- Transaction detailsGET /api/block/{height}
- Block information
Data Format
All amounts are displayed in BTC (converted from satoshis) for better readability. Timestamps are converted to ISO format for easy parsing.
Error Handling
The server includes comprehensive error handling:
- Network errors are caught and reported with descriptive messages
- Invalid addresses or transaction IDs return appropriate error messages
- Rate limiting and API errors are handled gracefully
Dependencies
@modelcontextprotocol/sdk
- MCP SDK for server implementationsuperagent
- HTTP client for API requestszod
- Schema validation for tool parameters
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Provides real-time Bitcoin blockchain data by querying the mempool.space API, offering tools to get address statistics, transaction history, UTXOs, transaction details, and block information.
Related MCP Servers
- AsecurityAlicenseAqualityProvides real-time and historical cryptocurrency market data through integration with major exchanges. This server enables LLMs like Claude to fetch current prices, analyze market trends, and access detailed trading information.Last updated -752PythonMIT License
- AsecurityAlicenseAqualityFacilitates interaction with Ethereum blockchain data via Etherscan's API, providing real-time access to balances, transactions, token transfers, contract ABIs, gas prices, and ENS name resolutions.Last updated -61021TypeScriptMIT License
- AsecurityAlicenseAqualityA server implementation that streams real-time Binance market data (spot and futures) via WebSockets, enabling applications to receive and process cryptocurrency market information through the Model Context Protocol.Last updated -636116TypeScriptMIT License
- AsecurityAlicenseAqualityProvides Ethereum blockchain data tools via Etherscan's API, enabling users to check ETH balances, view transactions, track token transfers, fetch contract ABIs, monitor gas prices, and resolve ENS names.Last updated -6101TypeScriptMIT License