btc-explorer-mcp
# btc-explorer-mcp
> An **unofficial** MCP server that wraps Bitcoin.com's free, keyless, read-only Explorer API — with local caching, rate-limit handling, and stdio transport.
[](LICENSE)
[](https://modelcontextprotocol.io)
[](#authentication)
## Why
Bitcoin.com launched a free public Explorer API and remote MCP server in November 2026 — no API key, no signup, 60 uncached requests/min/IP. This project gives you a **local stdio server** over that data, so clients that only speak stdio (Claude Desktop, Cursor, Cline, older Codex setups) can use it too.
It is a **derivative work** built on the official Model Context Protocol TypeScript SDK. Attribution is in [NOTICE](NOTICE). This project is **not affiliated with Bitcoin.com**.
## What it adds over calling the API directly
- **stdio transport** — works with any MCP client that launches local processes.
- **TTL cache (60s)** — repeated lookups of the same block/tx/address don't burn the 60 req/min quota.
- **Rate-limit handling** — a clear 429 message with `Retry-After` instead of an opaque failure.
- **Complete toolset** — the three JSON endpoints plus `get_chain_tip` and `search`, which only exist on the official remote MCP; this server forwards those transparently.
- **Enriched output** — every result carries the plain-English `explanation`, the source `url`, an `asOf` timestamp, and an attribution field.
- **No credentials required** — fully keyless by default. An optional env var exists for a future authenticated tier; nothing is hardcoded.
## Tools
| Tool | Input | Data source |
|------|-------|-------------|
| `get_block` | `id` (height or 64-hex hash) | Bitcoin.com JSON API |
| `get_transaction` | `txid` (64 hex) | Bitcoin.com JSON API |
| `get_address` | `address` (mainnet) | Bitcoin.com JSON API |
| `get_chain_tip` | none | Bitcoin.com remote MCP |
| `search` | `query` (height/hash/txid/address/xpub) | Bitcoin.com remote MCP |
All tools are read-only (`readOnlyHint: true`).
## Install
```bash
npm install
npm run build
```
Requires Node.js 20+ (tested on v22).
## Configure your MCP client
Claude Desktop / Cursor / Windsurf (`claude_desktop_config.json` or `.cursor/mcp.json`):
```json
{
"mcpServers": {
"btc-explorer": {
"command": "node",
"args": ["/absolute/path/to/btc-explorer-mcp/dist/index.js"]
}
}
}
```
Claude Code / Codex:
```bash
claude mcp add btc-explorer -- node /absolute/path/to/btc-explorer-mcp/dist/index.js
# or: codex mcp add btc-explorer -- node /absolute/path/to/btc-explorer-mcp/dist/index.js
```
## Authentication
None required. Bitcoin.com's free tier is keyless (`no key is needed`, per their API docs).
If Bitcoin.com later exposes an authenticated tier, set:
```bash
export BITCOIN_COM_API_KEY="your-own-key-here"
```
The key is read from the environment at runtime and sent as a Bearer token. It is **never** stored in this repository, config files, or logs. Never paste keys into agent chat.
## Test
```bash
node scripts/smoke-test.mjs
```
This spawns the server over stdio, performs the MCP handshake, lists tools, and calls all five tools with real network requests. Verified output on 2026-11-29: all 5 tools pass against live Bitcoin mainnet data.
## Rate limits
Bitcoin.com allows **60 uncached requests per minute per IP**. Over the limit the API returns 429 with `Retry-After`. This server caches responses for 60s to reduce quota use; if you still hit the limit, wait for the `Retry-After` interval or supply your own key.
## Scope and disclaimer
- **Read-only Bitcoin mainnet data.** No wallet, no signing, no transactions, no keys.
- **Unofficial.** Not affiliated with, endorsed by, or operated by Bitcoin.com. Trademarks belong to their owners.
- **Derivative work.** Built on the Apache-2.0/MIT MCP TypeScript SDK (Copyright Anthropic) and Zod (MIT). See [NOTICE](NOTICE).
- **Free tier terms** are set by Bitcoin.com and may change. Check their [API docs](https://www.bitcoin.com/explorer/api/) before relying on it.
## License
Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE) for upstream attribution.
TDQS
Scored across 5 tools
The four get_* tools each target a clearly distinct Bitcoin resource (block, transaction, address, chain tip), so misselection between them is unlikely. The only soft overlap is `search`, which can resolve block/txid/address/xpub and thus partially duplicates the getters; its description frames it as a lightweight resolver, which mitigates but does not eliminate the ambiguity.
Four of five tools follow a clean verb_noun pattern (get_block, get_transaction, get_address, get_chain_tip), which reads as a coherent explorer vocabulary. `search` breaks the pattern by being a bare verb with no noun, a minor deviation in an otherwise predictable set.
Five tools is a tight, focused surface for a Bitcoin explorer, and each tool clearly earns its place with no filler. It sits at the lean end for the domain—single-resource lookups only—but is not thin enough to be a problem.
Core lifecycle coverage for an explorer is present: block, transaction, address, chain tip, and a type-agnostic resolver for when the input type is unknown. Gaps exist around richer history (per-address transaction lists, xpub detail beyond resolution, mempool/fee data), but agents can route most queries through search plus the getters.