Mempool MCP Server — 88 tools
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, mempool, acceleration, and more — 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-hereWhat 88 tools does the Mempool DADL expose?
GETget_difficulty_adjustmentGet details on the next mining difficulty adjustment. Returns progressPercent, difficultyChange, estimatedRetargetDate, remainingBlocks, remainingTime, previousRetarget, nextRetargetHeight, timeAvg, timeOffset, and expectedBlocks. Updated each block.
GETget_pricesGet 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.
GETget_historical_priceGet 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).
GETget_addressGet 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.
GETget_address_txsGet 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).
GETget_address_txs_chainGet only confirmed (mined) transactions for an address, newest first, up to 25 per page. Use after_txid to paginate.
GETget_address_txs_mempoolGet only unconfirmed (mempool) transactions for an address. Returns up to 50 mempool entries. No pagination — mempool depth is bounded.
GETget_address_utxoGet 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).
GETvalidate_addressValidate 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.
GETget_blockGet 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.
GETget_block_extendedGet 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.
GETget_block_headerGet the raw 80-byte block header as a hex string. Useful for SPV proofs and external chain validation.
GETget_block_heightGet 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.
GETget_block_timestampGet 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.
GETget_block_rawGet the raw serialized block as binary data. Use sparingly — blocks can be up to ~4 MB. Response type is application/octet-stream.
GETget_block_statusGet a block's confirmation status. Returns { in_best_chain, height, next_best }. A block may be "orphaned" (in_best_chain=false) after a reorg.
GETget_block_tip_heightGet the height of the current chain tip as plain text integer. Cheap, frequently used as a liveness/sync check.
GETget_block_tip_hashGet the hash of the current chain tip as plain text. Pair with get_block to fetch latest block details.
GETget_block_txidGet the txid at a specific index within a block. Index 0 is the coinbase transaction. Returns the txid as plain text.
GETget_block_txidsGet 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.
GETget_block_txsGet 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.
GETget_blocksGet 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.
GETget_blocks_latestGet summaries for the 10 most recent blocks from the chain tip (descending). Convenience endpoint — same response shape as get_blocks.
GETget_blocks_extendedGet extended summaries for the 15 most recent blocks ending at startHeight, including mining pool, avgFee, avgFeeRate, totalFees, medianFee, and feeRange per block.
GETget_blocks_extended_latestGet extended summaries for the 15 most recent blocks from the chain tip. Same shape as get_blocks_extended.
GETget_blocks_bulkGet 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.
GETget_mining_poolsGet 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.
GETget_mining_poolGet detailed stats for one mining pool: name, slug, regexes, addresses, recent block history, and basic activity metrics.
GETget_mining_pool_hashratesGet average hashrate and share of the network for each mining pool over a time period. timePeriod values match get_mining_pools.
GETget_mining_pool_hashrateGet historical hashrate timeseries for a single mining pool. Each point has timestamp, avgHashrate, and share.
GETget_mining_pool_blocksGet blocks mined by a specific pool, descending from blockHeight. Returns up to 10 blocks per call.
GETget_hashrateGet network-wide hashrate and difficulty timeseries over the period. Returns { hashrates, difficulty, currentHashrate, currentDifficulty }.
GETget_difficulty_adjustmentsGet 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.
GETget_reward_statsGet aggregated reward statistics across the last N blocks: startBlock, endBlock, totalReward, totalFee, totalTx (count of transactions across those blocks).
GETget_block_feesGet average block-fee timeseries over the period. Each datapoint has timestamp, avgHeight, avgFees (sats).
GETget_block_rewardsGet average block-reward (subsidy + fees) timeseries over the period.
GETget_block_feeratesGet block fee-rate percentile timeseries (sat/vB at p10, p25, p50, p75, p90) over the period. Useful for historical fee analysis.
GETget_block_sizes_weightsGet block size (bytes) and weight (WU) timeseries over the period. Each point pairs avgSize and avgWeight.
GETget_block_predictionsGet block "health" predictions (template vs. actual deltas) timeseries over the period. Returns audit deviation indicators useful for spotting unusual mining behavior.
GETget_block_audit_scoreGet 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.
GETget_blocks_audit_scoresGet audit scores for the most recent 16 blocks. Each entry has hash, height, and score.
GETget_block_audit_summaryGet a detailed audit summary for a block: which expected txs were missing, which surprises were included, fee delta, and template-vs-actual differences.
GETget_mempool_blocks_feesGet 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".
GETget_recommended_feesGet 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.
GETget_precise_feesGet precise (sub-sat/vB resolution) recommended fee rates. Same fields as get_recommended_fees but reported as floats for high-precision applications.
GETget_mempoolGet 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.
GETget_mempool_txidsGet every unconfirmed txid currently in the mempool. Response can be very large (tens of thousands of strings) — prefer get_mempool for summary stats.
GETget_mempool_recentGet 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.
GETget_replacementsGet 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.
GETget_fullrbf_replacementsGet full-RBF replacements (including non-opt-in transactions replaced under Full-RBF policy). Same shape as get_replacements but covers a broader replacement set.
GETget_cpfpGet 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.
GETget_txGet 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.
GETget_tx_hexGet the raw transaction as a hex string. Use for re-broadcasting, offline signing, or external verification.
GETget_tx_merkleblock_proofGet 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.
GETget_tx_merkle_proofGet a JSON Merkle inclusion proof: { block_height, merkle, pos }. Lighter than merkleblock-proof and easier to consume programmatically.
GETget_tx_outspendGet the spending status of one specific output (vout index). Returns { spent, txid, vin, status } where status.confirmed indicates whether the spend is mined.
GETget_tx_outspendsGet the spending status of all outputs in a transaction as an array (one entry per vout). Cheaper than calling get_tx_outspend per output.
GETget_tx_rawGet the raw transaction as binary (application/octet-stream). For hex-string output prefer get_tx_hex.
GETget_tx_rbfGet the full RBF history/timeline for a transaction — every replacement that has occurred, with fee progression and timestamps.
GETget_tx_statusGet a transaction's confirmation status. Returns { confirmed, block_height, block_hash, block_time }. Cheap polling endpoint to wait for a tx to confirm.
GETget_transaction_timesGet 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.
POSTbroadcast_txBroadcast 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.).
GETget_lightning_statisticsGet 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.
GETsearch_lightningFull-text, case-insensitive search across Lightning nodes and channels. Returns { nodes, channels } with matches on alias, pubkey, channel ID, etc.
GETget_lightning_nodes_in_countryGet 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.
GETget_lightning_node_stats_per_countryGet per-country aggregate Lightning statistics: each entry has name (country), iso_code, count (nodes), share (% of network), capacity, channels.
GETget_lightning_isp_nodesGet Lightning nodes hosted on a specific ISP (by ASN). isp is the AS number (e.g. "16509" for AWS).
GETget_lightning_isp_rankingGet the ranked list of ISPs hosting Lightning nodes by node count, capacity, and channel count.
GETget_lightning_top_nodesGet top 100 Lightning nodes overall — includes topByCapacity and topByChannels arrays each with publicKey, alias, capacity, and channels.
GETget_lightning_top_nodes_by_liquidityGet top 100 Lightning nodes by total channel capacity (descending).
GETget_lightning_top_nodes_by_connectivityGet top 100 Lightning nodes by number of channels (descending).
GETget_lightning_oldest_nodesGet top 100 oldest Lightning nodes by first-seen timestamp (ascending — oldest first).
GETget_lightning_nodeGet 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.
GETget_lightning_node_statisticsGet historical capacity and channel count timeseries for a Lightning node.
GETget_lightning_channelGet 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.
GETget_lightning_channels_from_txidsGet Lightning channels whose funding transaction matches the given txid(s). Pass each via repeated txId[] query param. Useful for tracing on-chain → channel mappings.
GETget_lightning_channels_from_nodeGet 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.
GETget_lightning_channel_geodataGet 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.
GETget_lightning_channel_geodata_for_nodeGet geographic data only for channels of a specific node. Same tuple shape as the global endpoint.
POSTestimate_accelerationEstimate 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.
POSTgenerate_acceleration_invoiceGenerate 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.
GETget_pending_accelerationsGet the list of currently pending accelerations across the service (public view). Each entry includes txid, status, added_at, feeDelta.
GETget_acceleration_history_publicGet the public history of completed/failed accelerations. Useful as an audit feed.
GETget_top_up_historyGet the prepaid-balance top-up history for your account. Requires X-Mempool-Auth credential.
GETget_available_balanceGet your available prepaid Accelerator balance in sats. Requires X-Mempool-Auth credential. Returns { balance, ... }.
POSTaccelerate_transactionSubmit 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.
GETget_acceleration_historyGet 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.
POSTcancel_accelerationCancel 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
FNget_chain_tipGet 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).
FNget_address_full_historyGet 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.
FNwait_for_tx_confirmationPoll 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.
FNget_fee_dashboardGet a complete fee dashboard in one call: recommended fees, projected next mempool blocks, and current mempool stats. Returns { recommended, projected_blocks, mempool }.
FNget_block_with_first_txsGet 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).