A Model Context Protocol (MCP) server that provides real-time Bitcoin blockchain data by querying the mempool.space API.
This MCP server offers five specialized tools for querying Bitcoin blockchain data:
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:
Address: 1wiz18xYmhRX6xStj2b9t1rwWX4GKUgpv
Chain Stats:
- Funded TXOs: 10
- Funded Sum: 150.07686949 BTC
- Spent TXOs: 5
- Spent Sum: 150.07599040 BTC
- Total Transactions: 12
Mempool Stats:
- Pending TXOs: 0
- Pending Sum: 0.00000000 BTC
- Pending Transactions: 0
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 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
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
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
You can install this MCP server directly in Cursor using the one-click install link:
π Install in Cursor
cursor://anysphere.cursor-deeplink/mcp/install?name=bitcoin-mcp&config=eyJiaXRjb2luLW1jcCI6eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBqYW1lc2Fuei9iaXRjb2luLW1jcCJdfX0=
This will automatically configure the MCP server using npx. No API keys are required.
- Install the package globally:
npm install -g @jamesanz/bitcoin-mcp- Run the automated setup script:
# For Claude Desktop
npx @jamesanz/bitcoin-mcp setup claude
# Or show manual instructions
npx @jamesanz/bitcoin-mcp setup manual- Restart your MCP client (e.g., Claude Desktop)
If the automated setup doesn't work, you can configure manually:
- Install the package:
npm install -g @jamesanz/bitcoin-mcp- Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"bitcoin-mcp": {
"command": "npx",
"args": ["@jamesanz/bitcoin-mcp"]
}
}
}- Restart Claude Desktop
- Install the package:
npm install -g @jamesanz/bitcoin-mcp-
Configure your MCP client to use:
- Command:
npx - Args:
["@jamesanz/bitcoin-mcp"]
- Command:
-
Restart your MCP client
If you want to run from source:
- Clone this repository:
git clone https://github.com/JamesANZ/bitcoin-mcp.git
cd bitcoin-mcp- Install dependencies:
npm install- Build the project:
npm run build- Run the setup script:
npm run setup claudeStart the MCP server:
npm startThe server runs on stdio and can be connected to any MCP-compatible client.
Here are some example queries you can make with this MCP server:
{
"tool": "get-address-stats",
"arguments": {
"address": "1wiz18xYmhRX6xStj2b9t1rwWX4GKUgpv"
}
}{
"tool": "get-address-transactions",
"arguments": {
"address": "1wiz18xYmhRX6xStj2b9t1rwWX4GKUgpv",
"limit": 5
}
}{
"tool": "get-transaction",
"arguments": {
"txid": "15e10745f15593a899cef391191bdd3d7c12412cc4696b7bcb669d0feadc8521"
}
}{
"tool": "get-block",
"arguments": {
"block_height": 857808
}
}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
All amounts are displayed in BTC (converted from satoshis) for better readability. Timestamps are converted to ISO format for easy parsing.
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
@modelcontextprotocol/sdk- MCP SDK for server implementationsuperagent- HTTP client for API requestszod- Schema validation for tool parameters
If you find this project useful, consider supporting it with Bitcoin:
β‘ Lightning Network
lnbc1pjhhsqepp5mjgwnvg0z53shm22hfe9us289lnaqkwv8rn2s0rtekg5vvj56xnqdqqcqzzsxqyz5vqsp5gu6vh9hyp94c7t3tkpqrp2r059t4vrw7ps78a4n0a2u52678c7yq9qyyssq7zcferywka50wcy75skjfrdrk930cuyx24rg55cwfuzxs49rc9c53mpz6zug5y2544pt8y9jflnq0ltlha26ed846jh0y7n4gm8jd3qqaautqa
βΏ On-Chain
bc1ptzvr93pn959xq4et6sqzpfnkk2args22ewv5u2th4ps7hshfaqrshe0xtp
Ξ Ethereum / EVM Networks
0x42ea529282DDE0AA87B42d9E83316eb23FE62c3f
Donations from any EVM-compatible network (Ethereum, Polygon, Arbitrum, Optimism, BSC, Avalanche, etc.) will work perfectly! You can also send tokens like USDT, USDC, DAI, and other ERC-20 tokens to this address.
This project is licensed under the MIT License - see the LICENSE.md file for details.


