Mempool MCP Server — 88 tools via DADL
contains code
The Mempool DADL turns Mempool's API into an MCP server that Claude, GPT or any MCP-compatible agent can consume directly. One YAML file declares all 88 tools — block, lightning, address, mining, acceleration, mempool — and ToolMesh serves them at runtime. No Python boilerplate, no per-endpoint code, no separate MCP server process.
Below: the endpoint coverage matrix, a two-block ToolMesh setup, the full tool reference grouped by Mempool feature area.
Source: mempool.space REST API
Which Mempool endpoints are covered?
93% (79 of ~85 endpoints)
Focus: general (difficulty, prices), addresses, blocks, mining (pools, hashrate, rewards), fees, mempool, transactions (incl. broadcast), Lightning (nodes, channels, geo), Accelerator (public + authenticated)
Missing: block audit endpoints (predictions/score/summary — undocumented response shapes), Liquid sidechain endpoints
How do you configure the Mempool DADL?
- Most endpoints are PUBLIC — no credential is required to use general, address, block, mining, fee, mempool, transaction, and Lightning endpoints
- For Accelerator (Pro) endpoints only:
- 1. Create an account at https://mempool.space and sign in
- 2. Navigate to the Accelerator page: https://mempool.space/accelerator
- 3. Top up your balance with Bitcoin or Lightning to enable Pro acceleration
- 4. Generate or copy your X-Mempool-Auth API token from your account settings
- 5. Store it as CREDENTIAL_MEMPOOL_AUTH_TOKEN in ToolMesh
Environment variable: CREDENTIAL_MEMPOOL_AUTH_TOKEN
mempool.space is a fully public Bitcoin explorer; no auth is needed for the vast majority of endpoints. The X-Mempool-Auth header is only used by accelerator endpoints and personalizes acceleration estimates. For self-hosted mempool instances (Umbrel, RaspiBlitz, Start9), override base_url in backends.yaml to your local instance URL (e.g. http://umbrel.local:3006/api). Set credential to "none" if you only need public endpoints.
How do you install the Mempool MCP server with ToolMesh?
Add to your backends.yaml:
- name: mempool
transport: rest
dadl: mempool.dadl
url: "https://mempool.space/api"
Set the credential:
CREDENTIAL_MEMPOOL_AUTH_TOKEN=your-token-here What 88 tools does the Mempool DADL expose?
GET get_difficulty_adjustment Get details on the next mining difficulty adjustment. Returns progressPercent, difficultyChange, estimatedRetargetDate, remainingBlocks, remainingTime, previousRetarget, nextRetargetHeight, timeAvg, timeOffset, and expectedBlocks. Updated each block.
GET get_prices Get current bitcoin spot price denominated in main currencies (USD, EUR, GBP, CAD, CHF, AUD, JPY). Returns { time, USD, EUR, GBP, CAD, CHF, AUD, JPY } with the timestamp of the price snapshot.
GET get_historical_price Get bitcoin historical price denominated in the main currencies. When no parameters are provided the full price history for all currencies is returned (can be large). Filter with `currency` and anchor a single point in time with `timestamp` (Unix epoch seconds).
GET get_address Get details about a Bitcoin address including chain_stats (confirmed funded/spent tx counts and sums in sats) and mempool_stats (unconfirmed activity). Supports legacy, P2SH, bech32, and taproot.
GET get_address_txs Get transaction history for an address, newest first. Returns the 50 most recent mempool transactions plus the first 25 confirmed transactions. To paginate further into history, use after_txid with the last txid from the previous page (returns up to 25 confirmed txs/call).
GET get_address_txs_chain Get only confirmed (mined) transactions for an address, newest first, up to 25 per page. Use after_txid to paginate.
GET get_address_txs_mempool Get only unconfirmed (mempool) transactions for an address. Returns up to 50 mempool entries. No pagination — mempool depth is bounded.
GET get_address_utxo Get the unspent transaction outputs (UTXOs) controlled by an address. Each entry has txid, vout, value (sats), and status (confirmed flag + block_height/block_hash/block_time).
GET validate_address Validate a Bitcoin address string. Returns { isvalid, address, scriptPubKey, isscript, iswitness, witness_version, witness_program }. Use to detect typos before broadcasting or to identify the script type.
GET get_block Get a block by hash. Returns id (hash), height, version, timestamp, tx_count, size (bytes), weight (WU), merkle_root, previousblockhash, mediantime, nonce, bits, difficulty, and extras.
GET get_block_extended Get an extended block by hash including mempool-derived fields: pool (mining pool slug+name+id), avgFee, avgFeeRate, totalFees, medianFee, feeRange, reward, and mining metadata. Prefer this over get_block for analytical use cases.
GET get_block_header Get the raw 80-byte block header as a hex string. Useful for SPV proofs and external chain validation.
GET get_block_height Get the hash of the block at a specific height. Returns the block hash as plain text. Useful for converting a height into a hash that other endpoints accept.
GET get_block_timestamp Get the block nearest to a given Unix epoch SECONDS timestamp. Returns { height, hash, timestamp }. Helpful for "what was the chain tip when X happened" lookups.
GET get_block_raw Get the raw serialized block as binary data. Use sparingly — blocks can be up to ~4 MB. Response type is application/octet-stream.
GET get_block_status Get a block's confirmation status. Returns { in_best_chain, height, next_best }. A block may be "orphaned" (in_best_chain=false) after a reorg.
GET get_block_tip_height Get the height of the current chain tip as plain text integer. Cheap, frequently used as a liveness/sync check.
GET get_block_tip_hash Get the hash of the current chain tip as plain text. Pair with get_block to fetch latest block details.
GET get_block_txid Get the txid at a specific index within a block. Index 0 is the coinbase transaction. Returns the txid as plain text.
GET get_block_txids Get all txids in a block as an ordered array of strings. Useful when you need every transaction but want to avoid downloading full tx bodies.
GET get_block_txs Get up to 25 full transaction objects from a block starting at start_index. Step by 25 to paginate (0, 25, 50, ...). Each tx includes vin, vout, fee, status, and weight.
GET get_blocks Get summaries for the 10 most recent blocks ending at startHeight (descending). Omit startHeight via get_blocks_latest to start from the chain tip. Each block summary has id, height, version, timestamp, tx_count, size, weight, and merkle_root.
GET get_blocks_latest Get summaries for the 10 most recent blocks from the chain tip (descending). Convenience endpoint — same response shape as get_blocks.
GET get_blocks_extended Get extended summaries for the 15 most recent blocks ending at startHeight, including mining pool, avgFee, avgFeeRate, totalFees, medianFee, and feeRange per block.
GET get_blocks_extended_latest Get extended summaries for the 15 most recent blocks from the chain tip. Same shape as get_blocks_extended.
GET get_blocks_bulk Get extended block data for an inclusive height range. Returns extended summaries for every block from minHeight to maxHeight. Limited to 10,000 blocks per request on hosted instance — enterprise sponsorship required for larger ranges.
GET get_mining_pools Get a list of all mining pools ranked by blocks found during the time period. Returns each pool with name, slug, link, blockCount, rank, and emptyBlocks. timePeriod is one of: 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y.
GET get_mining_pool Get detailed stats for one mining pool: name, slug, regexes, addresses, recent block history, and basic activity metrics.
GET get_mining_pool_hashrates Get average hashrate and share of the network for each mining pool over a time period. timePeriod values match get_mining_pools.
GET get_mining_pool_hashrate Get historical hashrate timeseries for a single mining pool. Each point has timestamp, avgHashrate, and share.
GET get_mining_pool_blocks Get blocks mined by a specific pool, descending from blockHeight. Returns up to 10 blocks per call.
GET get_hashrate Get network-wide hashrate and difficulty timeseries over the period. Returns { hashrates, difficulty, currentHashrate, currentDifficulty }.
GET get_difficulty_adjustments Get the record of past difficulty adjustments over a trailing interval. Each entry has timestamp, height, difficulty, adjustment (factor change). interval uses the same vocabulary as timePeriod.
GET get_reward_stats Get aggregated reward statistics across the last N blocks: startBlock, endBlock, totalReward, totalFee, totalTx (count of transactions across those blocks).
GET get_block_fees Get average block-fee timeseries over the period. Each datapoint has timestamp, avgHeight, avgFees (sats).
GET get_block_rewards Get average block-reward (subsidy + fees) timeseries over the period.
GET get_block_feerates Get block fee-rate percentile timeseries (sat/vB at p10, p25, p50, p75, p90) over the period. Useful for historical fee analysis.
GET get_block_sizes_weights Get block size (bytes) and weight (WU) timeseries over the period. Each point pairs avgSize and avgWeight.
GET get_block_predictions Get block "health" predictions (template vs. actual deltas) timeseries over the period. Returns audit deviation indicators useful for spotting unusual mining behavior.
GET get_block_audit_score Get the audit score for a specific block hash. Audit scores reflect how well the block's contents matched mempool.space's predicted template at the moment of mining.
GET get_blocks_audit_scores Get audit scores for the most recent 16 blocks. Each entry has hash, height, and score.
GET get_block_audit_summary Get a detailed audit summary for a block: which expected txs were missing, which surprises were included, fee delta, and template-vs-actual differences.
GET get_mempool_blocks_fees Get the projected next 8 mempool blocks (template projections). Each entry has blockSize, blockVSize, nTx, totalFees (sats), medianFee, and feeRange (sat/vB percentiles). Useful for "when will my tx confirm".
GET get_recommended_fees Get recommended fee rates (sat/vB) for confirmation targets: fastestFee, halfHourFee, hourFee, economyFee, and minimumFee. The most popular endpoint for wallets/apps to suggest a fee.
GET get_precise_fees Get precise (sub-sat/vB resolution) recommended fee rates. Same fields as get_recommended_fees but reported as floats for high-precision applications.
GET get_mempool Get mempool backlog overview: { count, vsize, total_fee, fee_histogram }. fee_histogram is an array of [feeRate, vsize] buckets showing the fee-rate distribution of unconfirmed transactions.
GET get_mempool_txids Get every unconfirmed txid currently in the mempool. Response can be very large (tens of thousands of strings) — prefer get_mempool for summary stats.
GET get_mempool_recent Get the latest mempool transactions, up to ~10. Each entry has txid, fee, vsize, and value (sats). Use as a live feed of recently broadcast transactions.
GET get_replacements Get current RBF (Replace-By-Fee) replacements in the mempool. Returns a tree of replacements with each node's txid, fee, and replacing/replaced relationships. Includes opt-in RBF only.
GET get_fullrbf_replacements Get full-RBF replacements (including non-opt-in transactions replaced under Full-RBF policy). Same shape as get_replacements but covers a broader replacement set.
GET get_cpfp Get the ancestors and best descendant fees for a transaction (Children-Pay-For-Parent context). Returns { ancestors, bestDescendant, effectiveFeePerVsize, sigops } to understand the effective confirmation priority of a tx considering its package.
GET get_tx Get a transaction by txid. Returns txid, version, locktime, vin (inputs), vout (outputs), size, weight, fee (sats), and status (confirmed flag + block info). Inputs include the prevout being spent and witness data for SegWit.
GET get_tx_hex Get the raw transaction as a hex string. Use for re-broadcasting, offline signing, or external verification.
GET get_tx_merkleblock_proof Get a Merkle block (SPV) proof for a confirmed transaction. Returns hex-encoded proof suitable for verifying the tx is part of its block without downloading the full block.
GET get_tx_merkle_proof Get a JSON Merkle inclusion proof: { block_height, merkle, pos }. Lighter than merkleblock-proof and easier to consume programmatically.
GET get_tx_outspend Get the spending status of one specific output (vout index). Returns { spent, txid, vin, status } where status.confirmed indicates whether the spend is mined.
GET get_tx_outspends Get the spending status of all outputs in a transaction as an array (one entry per vout). Cheaper than calling get_tx_outspend per output.
GET get_tx_raw Get the raw transaction as binary (application/octet-stream). For hex-string output prefer get_tx_hex.
GET get_tx_rbf Get the full RBF history/timeline for a transaction — every replacement that has occurred, with fee progression and timestamps.
GET get_tx_status Get a transaction's confirmation status. Returns { confirmed, block_height, block_hash, block_time }. Cheap polling endpoint to wait for a tx to confirm.
GET get_transaction_times Get the timestamps at which a list of unconfirmed transactions was first observed in the mempool. Pass each txid via repeated txId[] query param. Returns an array of Unix epoch seconds in input order.
POST broadcast_tx Broadcast a raw transaction to the Bitcoin network. The request body is the raw transaction as a HEX STRING (not JSON). On success returns the txid as plain text. On failure returns an error string (e.g. "sendrawtransaction RPC error: ..."). The tx is rejected if it fails policy (insufficient fee, conflicts with mempool, invalid script, etc.).
GET get_lightning_statistics Get Lightning Network statistics timeseries over the interval. Returns datapoints with channel_count, node_count, total_capacity (sats), tor_nodes, clearnet_nodes, unannounced_nodes, avg_capacity, avg_fee_rate, avg_base_fee_mtokens, med_capacity, med_fee_rate, med_base_fee_mtokens. interval values: latest, 24h, 3d, 1w, 1m, 3m, 6m, 1y, 2y, 3y.
GET search_lightning Full-text, case-insensitive search across Lightning nodes and channels. Returns { nodes, channels } with matches on alias, pubkey, channel ID, etc.
GET get_lightning_nodes_in_country Get Lightning nodes in a specific country. country is an ISO 3166-1 alpha-2 code (lowercase, e.g. "us", "de"). Returns country info plus an array of nodes with public_key, alias, channels, capacity, etc.
GET get_lightning_node_stats_per_country Get per-country aggregate Lightning statistics: each entry has name (country), iso_code, count (nodes), share (% of network), capacity, channels.
GET get_lightning_isp_nodes Get Lightning nodes hosted on a specific ISP (by ASN). isp is the AS number (e.g. "16509" for AWS).
GET get_lightning_isp_ranking Get the ranked list of ISPs hosting Lightning nodes by node count, capacity, and channel count.
GET get_lightning_top_nodes Get top 100 Lightning nodes overall — includes topByCapacity and topByChannels arrays each with publicKey, alias, capacity, and channels.
GET get_lightning_top_nodes_by_liquidity Get top 100 Lightning nodes by total channel capacity (descending).
GET get_lightning_top_nodes_by_connectivity Get top 100 Lightning nodes by number of channels (descending).
GET get_lightning_oldest_nodes Get top 100 oldest Lightning nodes by first-seen timestamp (ascending — oldest first).
GET get_lightning_node Get detailed stats for a Lightning node by public key. Returns alias, channels, capacity, first_seen, updated_at, color, sockets, country, city, asn (ISP), opened_channel_count, closed_channel_count, active_channel_count.
GET get_lightning_node_statistics Get historical capacity and channel count timeseries for a Lightning node.
GET get_lightning_channel Get details for a Lightning channel by its short channel ID. Returns node1/node2 pubkeys, capacity, status, transaction_id (funding tx), and policy info per side.
GET get_lightning_channels_from_txids Get Lightning channels whose funding transaction matches the given txid(s). Pass each via repeated txId[] query param. Useful for tracing on-chain → channel mappings.
GET get_lightning_channels_from_node Get Lightning channels for a node, filtered by status. status is one of: open, active, closed. Returns an array of channels with capacity, transaction_id, status, fee policies, and counterparty.
GET get_lightning_channel_geodata Get geographic data for ALL Lightning channels (large response). Each entry is a tuple [pubKey1, alias1, lon1, lat1, pubKey2, alias2, lon2, lat2] for drawing the global channel map.
GET get_lightning_channel_geodata_for_node Get geographic data only for channels of a specific node. Same tuple shape as the global endpoint.
POST estimate_acceleration Estimate the cost of accelerating a stuck transaction via the mempool.space Accelerator service. Request body { txInput: "<txid>" }. Returns available fee-rate targets, per-target costs (sats), nextBlockFee, and recommendedFee. The X-Mempool-Auth header (if set) personalizes the estimate against your prepaid balance.
POST generate_acceleration_invoice Generate a Lightning invoice (or on-chain payment request) to pay for a one-shot transaction acceleration. Request body { product: "accelerator", amount: <sats>, ... }. Returns the BOLT11 invoice and a paymentId to poll for settlement.
GET get_pending_accelerations Get the list of currently pending accelerations across the service (public view). Each entry includes txid, status, added_at, feeDelta.
GET get_acceleration_history_public Get the public history of completed/failed accelerations. Useful as an audit feed.
GET get_top_up_history Get the prepaid-balance top-up history for your account. Requires X-Mempool-Auth credential.
GET get_available_balance Get your available prepaid Accelerator balance in sats. Requires X-Mempool-Auth credential. Returns { balance, ... }.
POST accelerate_transaction Submit an acceleration request for a stuck transaction (Pro). Requires X-Mempool-Auth credential and sufficient prepaid balance. Body { txInput: "<txid>", targetFeeRate: <sat/vB> }. Deducts the appropriate sat amount from your balance and submits the acceleration to participating miners.
GET get_acceleration_history Get YOUR account's acceleration history filtered by status. Requires X-Mempool-Auth credential. status values: all | requested | accelerating | mined | completed | failed. Pass details=true for full per-acceleration details.
POST cancel_acceleration Cancel a pending acceleration (Pro). Requires X-Mempool-Auth credential. Cancellation is only possible while the acceleration is still in "requested" status; once it has been picked up by miners it cannot be revoked. Body { txInput: "<txid>" }.
What composite workflows does the Mempool DADL provide? ⚠ contains code
FN get_chain_tip Get the latest block's full details in one call: fetches the tip hash then resolves it to an extended block object (with pool, fees, reward).
FN get_address_full_history Get a Bitcoin address with all of its UTXOs and its most recent confirmed transactions in a single payload — { address, utxos, recent_txs }. recent_txs is capped at the limit.
FN wait_for_tx_confirmation Poll a transaction's status up to max_attempts times, returning the status object as soon as the tx is confirmed or all attempts are exhausted. Sleeps between calls are NOT possible in the sandbox — this composite simply calls get_tx_status repeatedly (back-to-back) and is intended for short-burst checks (e.g. just after broadcast). For long waits use Temporal workflows.
FN get_fee_dashboard Get a complete fee dashboard in one call: recommended fees, projected next mempool blocks, and current mempool stats. Returns { recommended, projected_blocks, mempool }.
FN get_block_with_first_txs Get a block and its first N transactions in one call. Useful for inspecting the coinbase plus early transactions in a block. Capped at 50 transactions (2 paginated calls).