Bitcoin MCP

io.github.Bortlesboat由 GitHub 账号 Bortlesboat 发布v0.5.1更新于 Oct 24, 2026

49 Bitcoin tools for AI agents: fees, mempool, blocks, mining, price. Zero config.

已验证STDIO仅桌面金融数据与分析

概览

AI 生成的概览

一个本地 MCP 服务器,为 AI 助手提供约 50 个比特币工具,涵盖手续费、内存池、区块、挖矿、地址和价格数据。

可以做什么
提供约 50 个比特币工具,包括手续费建议与比较、内存池拥堵分析、区块与交易分析、挖矿与难度统计、网络与节点状态、地址与 UTXO 查询,以及市场价格与情绪指标。还提供用于手续费、内存池和网络健康工作流的提示与资源。数据来自本地 Bitcoin Core 或 Knots 节点,或来自显式配置的兼容 API。
适用场景
当助手需要回答比特币问题时适用,例如发送交易最便宜的时机、当前内存池拥堵情况、区块或交易详情,以及挖矿和供应量统计。适合已经运行比特币节点或拥有可指向的兼容 API 端点的用户。
运行要求
以 Python 包(pip 或 uvx)或 Docker 方式在本地运行。需要数据后端:通过 BITCOIN_RPC_HOST、BITCOIN_RPC_PORT 和 BITCOIN_NETWORK 配置可访问的 Bitcoin Core 或 Knots 节点,或通过 SATOSHI_API_URL 指定兼容 API,必要时配合 SATOSHI_API_KEY。README 说明公共托管 API 已暂停,不应作为默认依赖。
安装前请注意
该服务器可通过 send_raw_transaction 广播已签名交易,并可生成新的比特币密钥对,因此助手可能转移资金或创建密钥。SATOSHI_API_KEY 是机密,应通过环境变量提供,不要硬编码。将 SATOSHI_API_URL 指向第三方端点会把查询发送给该运营方。部分地址历史工具需要额外的区块链索引器。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Bitcoin MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

bitcoin-mcp

Give any AI agent Bitcoin superpowers — fee intelligence, mempool analysis, and 50 tools backed by your Bitcoin node or compatible API.

[PyPI] [Downloads] [Tests] [License: MIT] [Python 3.10+] [GitHub Sponsors]

50 standard tools · 6 prompts · 8 resources · Bitcoin Core or compatible API backend · MIT licensed

If bitcoin-mcp is useful to you, consider giving it a star — it helps others discover the project.

bash
pip install "bitcoin-mcp>=0.5.2"

bitcoin-mcp needs a Bitcoin data backend. It auto-detects a local Bitcoin Core/Knots node from its cookie or RPC settings. Without a local node, set SATOSHI_API_URL to a compatible deployment.

Service status: the public Satoshi API previously hosted at bitcoinsapi.com is paused and should not be treated as a working default. Use a local node or an explicitly configured compatible API.

Install status

Version 0.5.2 includes the MCP SDK 1.x compatibility constraint and explicit backend selection. Upgrade older installations to receive these fixes.

Quick Start

Claude Desktop

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "bitcoin": {      "command": "uvx",      "args": ["--from", "bitcoin-mcp>=0.5.2", "bitcoin-mcp"]    }  }}

Claude Code

bash
claude mcp add bitcoin -- uvx --from "bitcoin-mcp>=0.5.2" bitcoin-mcp

Cursor

Add to .cursor/mcp.json:

json
{  "mcpServers": {    "bitcoin": {      "command": "uvx",      "args": ["--from", "bitcoin-mcp>=0.5.2", "bitcoin-mcp"]    }  }}

VS Code

Add to .vscode/mcp.json:

json
{  "servers": {    "bitcoin": {      "command": "uvx",      "args": ["--from", "bitcoin-mcp>=0.5.2", "bitcoin-mcp"]    }  }}

Zed

Add to your Zed settings.json under context_servers:

json
{  "context_servers": {    "bitcoin": {      "command": "uvx",      "args": ["--from", "bitcoin-mcp>=0.5.2", "bitcoin-mcp"]    }  }}

See the Zed MCP docs for the current settings location and custom server flow.

Docker

bash
docker build -t bitcoin-mcp .docker run -i bitcoin-mcp

Or with docker compose:

bash
docker compose up

Pass environment variables to connect to a local Bitcoin Core node or a compatible API:

bash
docker run -i -e BITCOIN_RPC_HOST=host.docker.internal -e BITCOIN_RPC_PORT=8332 bitcoin-mcp# ordocker run -i -e SATOSHI_API_URL=https://your-api.example bitcoin-mcp

Ask whether to send Bitcoin now

Use this as the first useful activation path after install:

"I need to send a Bitcoin transaction today. Use bitcoin-mcp to decide whether to send now or wait, and show the fee rate you used."

Expected path:

  1. The agent calls get_fee_recommendation.
  2. The answer gives a clear send now or wait recommendation with fee rates in sat/vB.
  3. If the backend is unavailable, configure a local node or set SATOSHI_API_URL before retrying.

After it works, Star this repo and share a short showcase with the prompt, tool call, and outcome so other Bitcoin agent builders can see the path.

Agent Integration

For repos that need Bitcoin tools, add bitcoin-mcp to the agent's MCP config and configure one of its supported backends:

Generated HTTP examples should use canonical Satoshi API /api/v1 paths.

Why bitcoin-mcp?

  • Fee intelligence that saves real money — know the cheapest time to send, compare fee tiers, estimate exact costs before broadcasting
  • Backend choice — use your own Bitcoin Core/Knots node or an explicitly configured compatible API
  • Open source MCP tooling — tool definitions, tests, and client configuration examples are available in this repository

Top Use Cases

Ask your AI agent:

PromptWhat it does
"What's the cheapest time to send Bitcoin today?"Fee recommendation with savings breakdown
"Analyze the current mempool congestion"Real-time mempool depth, fee tiers, pending tx count
"How much would I save waiting 6 blocks vs next block?"Side-by-side fee comparison across confirmation targets
"Search for this transaction: abc123..."Full transaction decode with inscription detection
"Give me a situation summary of Bitcoin right now"Price, fees, mempool, mining, difficulty — one call

Full Tool Reference

All 50 standard tools by category

Fee Intelligence

ToolDescription
get_fee_recommendationOptimal fee rate with urgency tiers and savings tips
get_fee_estimatesFee estimates across all confirmation targets
estimate_smart_feeFee estimate for a specific confirmation target
compare_fee_estimatesSide-by-side comparison of fee sources
estimate_transaction_costExact cost estimate for a transaction before sending

Blocks & Transactions

ToolDescription
analyze_blockDeep analysis of any block by height or hash
get_block_statsStatistical breakdown of a block
get_block_countCurrent chain height
compare_blocksCompare two blocks side by side
search_blocksSearch a range of blocks
analyze_transactionFull transaction analysis with inscription detection
decode_raw_transactionDecode a raw transaction hex
send_raw_transactionBroadcast a signed transaction
check_utxoCheck if a UTXO is spent or unspent

Mempool

ToolDescription
analyze_mempoolFull mempool analysis — depth, fees, congestion
get_mempool_infoMempool size, bytes, fee floor
get_mempool_entryDetails for a specific unconfirmed transaction
get_mempool_ancestorsAncestor chain for a mempool transaction

Mining

ToolDescription
get_mining_infoCurrent mining difficulty, hashrate, block reward
analyze_next_blockPreview of the next block template
get_mining_pool_rankingsTop mining pools by recent blocks
get_difficulty_adjustmentTime and percentage of next difficulty change
get_halving_countdownBlocks and estimated time until next halving

Network & Status

ToolDescription
get_blockchain_infoChain state, verification progress, softfork status
get_network_infoNode version, connections, relay info
get_node_statusConnection status and node health
get_peer_infoConnected peer details
get_chain_tipsActive and stale chain tips
get_chain_tx_statsTransaction throughput over N blocks
get_utxo_set_infoUTXO set size and total supply
get_supply_infoCirculating supply, inflation rate, percent mined
get_situation_summaryAggregated overview — price, fees, mempool, mining
get_btc_priceCurrent BTC/USD price
get_market_sentimentFear/greed index and market indicators

Address & UTXO

ToolDescription
get_address_utxosUTXOs for an address
validate_addressValidate and classify a Bitcoin address

Indexed Address (requires blockchain indexer)

ToolDescription
get_address_balanceTotal received/sent/balance, tx count, first/last seen
get_address_historyPaginated transaction history with net value change
get_address_transactionsTransaction history with per-transaction value details
get_indexed_transactionEnriched tx with resolved input addresses + spent status
get_indexer_statusSync progress, ETA, blocks/sec

Security

ToolDescription
analyze_psbt_securitySecurity analysis of a Partially Signed Bitcoin Transaction
explain_inscription_listing_securitySecurity guide for ordinal inscription listings

Utility

ToolDescription
search_blockchainUniversal search — address, txid, block hash, or height
generate_keypairGenerate a new Bitcoin keypair
explain_scriptDecode and explain a Bitcoin script
decode_bolt11_invoiceDecode a Lightning Network BOLT11 invoice
describe_rpc_commandHelp text for any Bitcoin Core RPC command
list_rpc_commandsList all available RPC commands
decode_xpubDecode and inspect an extended public key

Optional Remote API Tool

query_remote_api is registered only when SATOSHI_API_URL is set and the l402 extra is installed. It queries canonical /api/v1 routes on that explicitly configured endpoint.

Configuration

Configure either a local Bitcoin Core/Knots node or a compatible remote API. If neither is available, bitcoin-mcp exits its connection check with a setup error instead of silently selecting an unavailable public service.

CLI Flags

bitcoin-mcp supports the following runtime flags:

FlagValuesDefaultDescription
--transportstdio, sse, streamable-httpstdioMCP transport to run
--hosthostname / IP127.0.0.1 for HTTP transportsBind host for sse and streamable-http
--portinteger8000 for HTTP transportsBind port for sse and streamable-http
--log-levelDEBUG, INFO, WARNING, ERRORINFOServer log verbosity

Example:

bash
bitcoin-mcp --transport sse --host 127.0.0.1 --port 8000 --log-level DEBUG
VariableDescriptionDefault
BITCOIN_RPC_HOSTBitcoin Core RPC host127.0.0.1
BITCOIN_RPC_PORTBitcoin Core RPC portAuto by network
BITCOIN_NETWORKmainnet, testnet, signet, or regtestmainnet
SATOSHI_API_URLCompatible Satoshi API base URLNone
SATOSHI_API_KEYAPI key for authenticated accessNone

To connect to a local Bitcoin Core node:

json
{  "mcpServers": {    "bitcoin": {      "command": "uvx",      "args": ["--from", "bitcoin-mcp>=0.5.2", "bitcoin-mcp"],      "env": {        "BITCOIN_RPC_HOST": "127.0.0.1",        "BITCOIN_RPC_PORT": "8332"      }    }  }}

Prompts & Resources

6 built-in prompts for common workflows: analyze_fee_environment, investigate_transaction, monitor_mempool_fees, taproot_adoption_report, network_health_report, track_transaction

8 resources for context injection: bitcoin://connection/status, bitcoin://node/status, bitcoin://fees/current, bitcoin://fees/history, bitcoin://mempool/snapshot, bitcoin://protocol/script-opcodes, bitcoin://protocol/address-types, bitcoin://protocol/sighash-types

Links

Examples

See the examples/ folder for documented usage patterns:

Support This Project

bitcoin-mcp is free, open-source Bitcoin infrastructure. Support development through GitHub Sponsors, reproducible issue reports, documentation improvements, and tested patches.

Contributing

Run the unit suite with python -m pytest tests/. For the optional Core/Knots checks over the MCP interface, see real-node integration tests.

Contributions are welcome. See CONTRIBUTING.md for guidelines, including how to add new tools and the PR checklist.

Please report security vulnerabilities privately — see SECURITY.md.

About

bitcoin-mcp is created and maintained by Andrew Barnes, bridging AI agents and Bitcoin infrastructure through the Model Context Protocol.

Related projects:

  • Satoshi API — Bitcoin fee intelligence API, 108 endpoints, usable as a self-hosted compatible backend
  • ChainPulse — AI-powered Bitcoin network intelligence CLI
  • BAIP-1 — Bitcoin Agent Identity Protocol
  • bitcoin-fee-observatory — Fee market analytics dashboard

License

MIT

来源:README.md,提交 50de748

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.5.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分