Skip to main content
Glama
bjunjo

treasury-mcp

by bjunjo

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
BITCOIN_NETWORKNoBitcoin network to use: mainnet, testnet, signet, or regtestmainnet
SATOSHI_API_KEYNoAPI key for authenticated access to Satoshi API. Visit bitcoinsapi.com to register for a free key.
SATOSHI_API_URLNoOverride hosted API URLhttps://bitcoinsapi.com
BITCOIN_RPC_HOSTNoBitcoin Core RPC host127.0.0.1
BITCOIN_RPC_PORTNoBitcoin Core RPC port (automatically determined by network if not provided)

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_node_statusA

Get Bitcoin network status: chain, height, sync progress, disk usage, connections, version. In hosted API mode, reflects the API server's node.

get_peer_infoA

Get connected peer details: addresses, latency, services, version. In hosted API mode, shows the API server's peers.

get_network_infoA

Get network info: protocol version, relay fee, connections, warnings. In hosted API mode, reflects the API server's network view.

get_blockchain_infoB

Get blockchain info: chain, difficulty, softfork statuses, chain work, pruning.

analyze_blockB

Analyze a block: mining pool, SegWit/Taproot adoption, fee distribution, revenue.

Args: height_or_hash: Block height (e.g. "939290") or block hash

get_block_statsB

Get raw block statistics: median fee, total output, subsidy, weight, tx count.

Args: height: Block height

get_chain_tx_statsB

Get transaction rate statistics over N blocks.

Args: nblocks: Number of blocks to average over (default 2016 = ~2 weeks)

get_chain_tipsB

Get chain tips: active chain, forks, and stale branches. Useful for detecting chain splits.

search_blocksB

Get block statistics for a range of heights. Max 10 blocks.

Args: start_height: Starting block height (inclusive) end_height: Ending block height (inclusive)

analyze_mempoolB

Analyze the mempool: tx count, fee buckets, congestion level, next-block minimum fee.

get_mempool_entryA

Get details of a specific unconfirmed transaction in the mempool.

Args: txid: Transaction hash (64 hex characters)

get_mempool_infoA

Get quick mempool stats: transaction count, size in bytes, min relay fee.

get_mempool_ancestorsA

Get all unconfirmed ancestor transactions of a mempool transaction. Useful for CPFP analysis.

Args: txid: Transaction hash (64 hex characters)

analyze_transactionA

Decode and analyze a transaction: inputs, outputs, fee rate, SegWit/Taproot flags, inscription detection.

Args: txid: Transaction hash (64 hex characters). Local nodes need txindex=1 for confirmed txs; the hosted API handles this automatically.

decode_raw_transactionB

Decode a raw transaction hex without looking up inputs.

Args: hex_string: Raw transaction in hex format

check_utxoA

Check if a specific transaction output is unspent (UTXO lookup).

Args: txid: Transaction hash vout: Output index

send_raw_transactionA

Broadcast a signed raw transaction to the Bitcoin network.

WARNING: This sends a REAL transaction. Once broadcast, it cannot be reversed. Ensure the transaction is correctly signed and you understand the fee implications. In hosted API mode, the transaction is broadcast through the Satoshi API's node.

Args: hex_string: Signed raw transaction in hex format max_fee_rate: Maximum fee rate in BTC/kvB to prevent accidental overpayment (default 0.10)

get_fee_estimatesA

Get fee rate estimates for 1/3/6/25/144 block confirmation targets in sat/vB.

get_fee_recommendationB

Get a plain-English fee recommendation based on current estimates, with raw rate data.

estimate_smart_feeC

Get fee estimate for a specific confirmation target.

Args: conf_target: Number of blocks for confirmation (1-1008)

compare_fee_estimatesB

Compare fee estimates side-by-side with urgency labels and cost for a typical 140 vB transaction.

estimate_transaction_costA

Estimate Bitcoin transaction cost in sats AND USD at different urgency levels. Supports address types: p2pkh (legacy), p2sh-p2wpkh (nested segwit), p2wpkh (native segwit), p2tr (taproot). Shows how much you save by waiting.

get_mining_infoB

Get mining info: difficulty, network hashrate, current block size.

analyze_next_blockB

Predict next block: transactions, weight utilization, miner revenue, fee percentiles, top-fee txs.

get_mining_pool_rankingsA

Get top 10 Bitcoin mining pools by hashrate share over the last week. Returns pool name, percentage of total hashrate, and block count. Use this to understand mining centralization and pool dominance.

get_utxo_set_infoA

Get UTXO set statistics: total UTXOs, total supply, disk size. Note: this is a slow operation (1-2 minutes on local nodes, may vary on hosted API).

get_block_countA

Get current block height (lightweight, fast).

get_situation_summaryA

Get a quick Bitcoin briefing: price, fees, mempool, and chain tip in one call. Use this as your first call to understand current conditions — replaces calling 5+ tools separately.

describe_rpc_commandA

Get structured help for a Bitcoin RPC command: description, arguments, examples.

Args: command: RPC command name (e.g. "getblock", "sendrawtransaction")

list_rpc_commandsB

List all available RPC commands grouped by category.

search_blockchainA

Smart search: auto-detects if query is a txid, block hash, block height, or address and returns the right data.

Args: query: A txid (64 hex), block hash (64 hex starting with 0000), block height (number), or Bitcoin address

explain_scriptB

Decode a Bitcoin Script hex and break down the opcodes.

Args: hex_script: Script in hex format

get_address_utxosA

Scan the UTXO set for all unspent outputs belonging to an address. Note: scans full UTXO set, may take minutes.

Args: address: Bitcoin address to scan

validate_addressA

Validate a Bitcoin address and return its type (legacy/segwit/taproot), network, and script info. Use this to check if an address is valid before sending, or to identify what kind of address you're looking at.

Args: address: Bitcoin address to validate (any format: P2PKH, P2SH, P2WPKH, P2WSH, P2TR)

get_difficulty_adjustmentB

Calculate difficulty adjustment progress: blocks into epoch, blocks remaining, estimated time, and projected adjustment.

compare_blocksC

Compare block statistics between two block heights side by side.

Args: height1: First block height height2: Second block height

get_btc_priceA

Get current BTC/USD price from CoinGecko (free, no API key). Returns price, 24h change, and market cap. Use this to convert sat/vB fees into dollar amounts.

get_supply_infoA

Get Bitcoin supply data: circulating supply, max supply, inflation rate, subsidy per block, and next halving estimate.

get_halving_countdownA

Get a focused countdown to the next Bitcoin halving: blocks remaining, estimated date, and subsidy change.

get_market_sentimentA

Get Bitcoin Fear & Greed Index: current value (0-100), classification (Extreme Fear/Fear/Neutral/Greed/Extreme Greed), and 7-day history. Use this to gauge market sentiment alongside price data.

decode_bolt11_invoiceA

Decode a BOLT11 Lightning invoice without external dependencies.

Parses the human-readable part to extract network, amount, and timestamp. Does NOT verify the signature or parse tagged fields beyond basic extraction.

Args: invoice: BOLT11 payment request string (starts with lnbc, lntb, or lnbcrt)

generate_keypairA

Generate a new Bitcoin address via the connected node's wallet. Requires a local node with a wallet loaded — not available when using the hosted Satoshi API.

SECURITY: Private keys are redacted by default because AI provider tool responses may be logged. Set include_private_key=True only if you understand the risk — the key will appear in your conversation history and should be considered potentially compromised for high-value use.

Args: address_type: Address type — "legacy" (P2PKH), "p2sh-segwit" (P2SH-P2WPKH), "bech32" (P2WPKH, default), or "bech32m" (P2TR taproot) include_private_key: If True, include the WIF private key in the response. Defaults to False for security.

get_address_balanceA

Get the total balance, transaction count, and first/last seen times for a Bitcoin address.

Uses the Satoshi API blockchain indexer when available, falls back to mempool.space. Returns total received, total sent, current balance, tx count, and timestamps.

Args: address: Bitcoin address (any format: legacy, P2SH, bech32, bech32m)

get_address_historyA

Get paginated transaction history for a Bitcoin address.

Uses the Satoshi API blockchain indexer when available, falls back to mempool.space. Shows each transaction with block height, timestamp, and net value change for the address. Results are ordered newest-first.

Args: address: Bitcoin address (any format) offset: Skip this many transactions (for pagination, default 0) limit: Max transactions to return (default 25, max 100)

get_indexed_transactionA

Get enriched transaction details from the blockchain indexer.

Unlike analyze_transaction (which uses raw RPC), this returns resolved input addresses, spent/unspent status for each output, and block context. Falls back to mempool.space when the indexer is unavailable.

Args: txid: Transaction ID (64-character hex string)

get_indexer_statusA

Check the blockchain indexer sync progress.

Returns current indexed height, chain tip, sync percentage, blocks/sec, and ETA. Use this to check if the indexer is running and how far along the initial sync is.

analyze_psbt_securityA

Analyze a PSBT for ordinals inscription listing mempool sniping vulnerability.

Detects whether an ordinals listing PSBT is vulnerable to front-running in the mempool. A listing is VULNERABLE when it uses SIGHASH_SINGLE|ANYONECANPAY without a 2-of-2 multisig locking step — an attacker can redirect the inscription before confirmation. A listing is PROTECTED when the inscription is locked in a 2-of-2 P2WSH multisig and the marketplace co-signs with SIGHASH_ALL, preventing any transaction modification.

No Bitcoin node required — analysis is pure PSBT parsing (BIP 174).

Args: psbt_hex: Hex-encoded PSBT string (BIP 174 v0)

explain_inscription_listing_securityA

Explain in plain language whether an ordinals inscription listing is snipe-resistant.

Analyzes the PSBT and returns a human-readable explanation of:

  • Whether the listing can be front-run in the mempool

  • What sighash type each input uses and why it matters

  • Specific remediation steps if the listing is vulnerable

Use this when you need a clear explanation for a developer or marketplace operator rather than raw analysis data.

Args: psbt_hex: Hex-encoded PSBT string (BIP 174 v0)

query_remote_apiA

Query a remote Satoshi API instance, auto-paying with Lightning if needed.

Requires SATOSHI_API_URL environment variable. Supports L402 micropayments.

Args: endpoint: API path (e.g. "/api/v1/fees", "/api/v1/blocks/latest") params: Optional query parameters as key=value pairs separated by &

get_treasury_companiesA

List all Bitcoin treasury companies tracked by Treasury-MCP.

Returns a table of all tracked companies with their ticker, exchange, country, approximate BTC holdings, and last data update date.

get_treasury_holdingsA

Get detailed Bitcoin treasury holdings for a specific company.

Returns BTC holdings, average acquisition cost, total treasury value in USD and KRW, BTC-per-share, and data source information.

Args: ticker: Company ticker or key (e.g. 'MSTR', 'METAPLANET', 'SEMLER', 'MARA', 'RIOT')

calculate_mnavA

Calculate the live mNAV (Market Net Asset Value) premium or discount for a Bitcoin treasury company.

mNAV = Market Cap / Bitcoin Treasury Value. mNAV > 1.0 means the market is paying a premium for the company's Bitcoin. mNAV < 1.0 means the company is trading at a discount to its Bitcoin holdings.

Args: ticker: Company ticker or key (e.g. 'MSTR', 'METAPLANET', 'SEMLER')

parse_latest_filingA

Fetch and parse the latest Bitcoin-related corporate filing for a treasury company.

For US companies: queries SEC EDGAR for the most recent 8-K filing mentioning Bitcoin. For Metaplanet (Japan): scrapes the official IR page for the latest disclosure.

Returns a structured summary including recent filings and current baseline holdings.

Args: ticker: Company ticker or key (e.g. 'MSTR', 'METAPLANET', 'SEMLER', 'MARA', 'RIOT')

Prompts

Interactive templates invoked by user choice

NameDescription
analyze_fee_environmentAnalyze the current Bitcoin fee environment and make a send/wait recommendation.
investigate_transactionDeep-dive investigation of a specific Bitcoin transaction.
monitor_mempool_feesMonitor mempool and alert when fees drop below a threshold.
taproot_adoption_reportAnalyze Taproot (P2TR) adoption trends over recent blocks.
network_health_reportGenerate a comprehensive Bitcoin network health report.
track_transactionTrack a transaction from mempool to confirmation.

Resources

Contextual data attached and managed by the client

NameDescription
resource_connection_statusConnection status: mode (local node or hosted API), network, and whether the connection is working.
resource_node_statusCurrent status summary of the connected Bitcoin node (local or hosted API).
resource_current_feesCurrent fee estimates.
resource_mempool_snapshotCurrent mempool summary.
resource_script_opcodesCommon Bitcoin Script opcodes reference.
resource_address_typesBitcoin address types and their properties.
resource_sighash_typesBitcoin signature hash types reference.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bjunjo/treasury-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server