MCP Mempool
Access Bitcoin network data from mempool.space's API for AI agents and applications.
MCP Mempool ๐
๋นํธ์ฝ์ธ mempool.space WebSocket & REST API๋ฅผ ์ํ Model Context Protocol (MCP) ์๋ฒ
๐ ๊ฐ์
MCP Mempool์ mempool.space์ WebSocket๊ณผ REST API๋ฅผ MCP (Model Context Protocol) ํํ๋ก ๋ํํ์ฌ AI Agent์ ์ธ๋ถ ์ ํ๋ฆฌ์ผ์ด์ ์ด ๋นํธ์ฝ์ธ ๋คํธ์ํฌ ๋ฐ์ดํฐ๋ฅผ ์ฝ๊ฒ ํ์ฉํ ์ ์๋๋ก ํ๋ ์๋ฒ์ ๋๋ค.
โจ ์ฃผ์ ๊ธฐ๋ฅ
๐ WebSocket ๊ธฐ๋ฅ (์ค์๊ฐ)
- ์ค์๊ฐ ๋ธ๋ก ๋ฐ์ดํฐ: ์ ๋ธ๋ก ์์ฑ ์ ์ฆ์ ์๋ฆผ
- ๋ฉคํ ๋ธ๋ก ํ ํ๋ฆฟ: ์์๋๋ ๋ค์ ๋ธ๋ก ์ ๋ณด
- ๋คํธ์ํฌ ํต๊ณ: ๋ฉ๋ชจ๋ฆฌํ ์ํ ์ค์๊ฐ ๋ชจ๋ํฐ๋ง
- ์ฃผ์ ์ถ์ : ํน์ ๋นํธ์ฝ์ธ ์ฃผ์์ ๊ฑฐ๋ ์ค์๊ฐ ์ถ์
- ๋ผ์ด๋ธ ์ฐจํธ: ์์๋ฃ ๋ณํ ์ถ์ด ์ค์๊ฐ ๋ฐ์ดํฐ
๐ REST API ๊ธฐ๋ฅ (์ฟผ๋ฆฌ)
- ์ฃผ์ ์ ๋ณด ์กฐํ: ์์ก, ๊ฑฐ๋ ๋ด์ญ, UTXO ๋ชฉ๋ก
- ๊ฑฐ๋ ์ ๋ณด: ๊ฐ๋ณ ๊ฑฐ๋ ์์ธ ์ ๋ณด ๋ฐ ์ํ
- ๋ธ๋ก ๋ฐ์ดํฐ: ๋ธ๋ก ์ ๋ณด, ๊ฑฐ๋ ๋ชฉ๋ก, ์ต์ ๋์ด
- ์์๋ฃ ์ ๋ณด: ์ถ์ฒ ์์๋ฃ์จ, ๋ฉคํ ๋ธ๋ก๋ณ ์์๋ฃ
- ๋ฉคํ ์ํ: ํ์ฌ ๋ฉคํ ์ ๋ณด ๋ฐ ์ต๊ทผ ๊ฑฐ๋
- ์ฃผ์ ๊ฒ์ฆ: ๋นํธ์ฝ์ธ ์ฃผ์ ์ ํจ์ฑ ๊ฒ์ฌ
๐ ๋น ๋ฅธ ์์
Docker๋ก ์คํ (๊ถ์ฅ)
# ๊ฐ๋ฐ ํ๊ฒฝ
docker-compose up mcp-mempool-dev
# ํ๋ก๋์
ํ๊ฒฝ
docker-compose up mcp-mempool-prod
์๋ฒ๊ฐ ์คํ๋๋ฉด http://localhost:8000 ์์ ์ ๊ทผ ๊ฐ๋ฅํฉ๋๋ค.
๋ก์ปฌ ์ค์น
# ์์กด์ฑ ์ค์น
uv sync
# ์๋ฒ ์คํ
uv run python -m mempool_ws_mcp_server.main
๐ง ํ๊ฒฝ ๋ณ์ ์ค์
# ์๋ฒ ์ค์
MCP_HOST=0.0.0.0 # ์๋ฒ ํธ์คํธ
MCP_PORT=8000 # ์๋ฒ ํฌํธ
LOG_LEVEL=INFO # ๋ก๊ทธ ๋ ๋ฒจ
# Mempool API ์ค์
MEMPOOL_WS_URL=wss://mempool.space/api/v1/ws # WebSocket URL
MEMPOOL_API_URL=https://mempool.space/api # REST API URL
# WebSocket ์ค์
WS_RECONNECT_INTERVAL=5 # ์ฌ์ฐ๊ฒฐ ๊ฐ๊ฒฉ (์ด)
WS_MAX_RECONNECT_ATTEMPTS=10 # ์ต๋ ์ฌ์ฐ๊ฒฐ ์๋
WS_PING_INTERVAL=30 # Ping ๊ฐ๊ฒฉ (์ด)
WS_PING_TIMEOUT=10 # Ping ํ์์์ (์ด)
# HTTP ํด๋ผ์ด์ธํธ ์ค์
HTTP_TIMEOUT=30 # HTTP ์์ฒญ ํ์์์ (์ด)
HTTP_MAX_RETRIES=3 # ์ต๋ ์ฌ์๋ ํ์
# ์ฑ๋ฅ ์ค์
MAX_MESSAGE_QUEUE_SIZE=1000 # ๋ฉ์์ง ํ ์ต๋ ํฌ๊ธฐ
MESSAGE_BATCH_SIZE=10 # ๋ฉ์์ง ๋ฐฐ์น ํฌ๊ธฐ
# ๋ณด์ ์ค์
CORS_ENABLED=true # CORS ํ์ฑํ
ALLOWED_ORIGINS=* # ํ์ฉ๋ ์ค๋ฆฌ์ง (์ฝค๋ง ๊ตฌ๋ถ)
# ๊ฐ๋ฐ ๋ชจ๋
DEBUG=false # ๋๋ฒ๊ทธ ๋ชจ๋
RELOAD=false # ์๋ ์ฌ์์
๐ MCP ํด๋ผ์ด์ธํธ ์ค์
Claude Desktop
claude_desktop_config.json ํ์ผ์ ์ถ๊ฐ:
{
"mcpServers": {
"mcp-mempool": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:8000/mcp"]
}
}
}
{
"mcpServers": {
"mcp-mempool": {
"transport": "streamable-http",
"url" : "http://127.0.0.1:8000/mcp" //๋ฐฐํฌ์ ์ค์ ์๋น url
}
}
}
Amazon Q Developer
.aws/amazonq/mcp.json ํ์ผ์ ์ถ๊ฐ:
{
"mcpServers": {
"mcp-mempool": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:8000/mcp"],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR"
}
}
}
}
๐ก ์ฌ์ฉ ๊ฐ๋ฅํ ๋๊ตฌ๋ค
WebSocket ๋๊ตฌ (์ค์๊ฐ ์คํธ๋ฆฌ๋ฐ)
subscribe_blocks
์ ๋ธ๋ก ์์ฑ ์ ์ค์๊ฐ ์๋ฆผ์ ๋ฐ์ต๋๋ค.
subscribe_mempool_blocks
์์๋๋ ๋ค์ ๋ธ๋ก ํ ํ๋ฆฟ ์ ๋ณด๋ฅผ ์ค์๊ฐ์ผ๋ก ๋ฐ์ต๋๋ค.
subscribe_stats
๋คํธ์ํฌ ๋ฉ๋ชจ๋ฆฌํ ํต๊ณ๋ฅผ ์ค์๊ฐ์ผ๋ก ๋ชจ๋ํฐ๋งํฉ๋๋ค.
subscribe_live_chart
2์๊ฐ ๋ผ์ด๋ธ ์์๋ฃ ์ฐจํธ ๋ฐ์ดํฐ๋ฅผ ์ค์๊ฐ์ผ๋ก ๋ฐ์ต๋๋ค.
track_address
ํน์ ๋นํธ์ฝ์ธ ์ฃผ์์ ๊ฑฐ๋๋ฅผ ์ค์๊ฐ์ผ๋ก ์ถ์ ํฉ๋๋ค.
address: ์ถ์ ํ ๋นํธ์ฝ์ธ ์ฃผ์
get_connection_status
WebSocket ์ฐ๊ฒฐ ์ํ๋ฅผ ํ์ธํฉ๋๋ค.
unsubscribe_client
ํด๋ผ์ด์ธํธ์ ๋ชจ๋ ๊ตฌ๋ ์ ํด์ ํฉ๋๋ค.
client_id: ๊ตฌ๋ ํด์ ํ ํด๋ผ์ด์ธํธ ID
REST API ๋๊ตฌ (์ฟผ๋ฆฌ)
์ฃผ์ ๊ด๋ จ
get_address_info - ์ฃผ์์ ๋ชจ๋ ์ ๋ณด ์กฐํ
address: ๋นํธ์ฝ์ธ ์ฃผ์
get_address_balance - ์ฃผ์ ์์ก ์กฐํ
address: ๋นํธ์ฝ์ธ ์ฃผ์
get_address_utxos - ์ฃผ์์ UTXO ๋ชฉ๋ก ์กฐํ
address: ๋นํธ์ฝ์ธ ์ฃผ์
get_address_transactions - ์ฃผ์์ ๊ฑฐ๋ ๋ด์ญ ์กฐํ
address: ๋นํธ์ฝ์ธ ์ฃผ์after_txid(์ ํ): ํน์ ๊ฑฐ๋ ์ดํ์ ๊ฑฐ๋๋ค๋ง ์กฐํ
๊ฑฐ๋ ๊ด๋ จ
get_transaction_info - ๊ฑฐ๋ ์ ๋ณด ์กฐํ
txid: ๊ฑฐ๋ ID
get_block_info - ๋ธ๋ก ์ ๋ณด ์กฐํ
hash_or_height: ๋ธ๋ก ํด์ ๋๋ ๋์ด
get_block_height - ํ์ฌ ๋ธ๋ก ๋์ด ์กฐํ
์์๋ฃ & ๋ฉคํ
get_recommended_fees - ์ถ์ฒ ์์๋ฃ์จ ์กฐํ
get_mempool_info - ํ์ฌ ๋ฉคํ ์ ๋ณด ์กฐํ
์ ํธ๋ฆฌํฐ
validate_bitcoin_address - ๋นํธ์ฝ์ธ ์ฃผ์ ์ ํจ์ฑ ๊ฒ์ฌ
address: ๊ฒ์ฆํ ์ฃผ์
๐ป ์ฌ์ฉ ์์
์ฃผ์ ์์ก ์กฐํ
# MCP ํด๋ผ์ด์ธํธ์์ ์ฌ์ฉ
get_address_balance address="1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
์ค์๊ฐ ์์๋ฃ ๋ชจ๋ํฐ๋ง
# ์ค์๊ฐ ๋ฉคํ ๋ธ๋ก ๊ตฌ๋
subscribe_mempool_blocks
# ์ถ์ฒ ์์๋ฃ ์กฐํ
get_recommended_fees
์ฃผ์ ์ถ์
# ํน์ ์ฃผ์ ์ค์๊ฐ ์ถ์
track_address address="1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
๐ ๊ฐ๋ฐ
๊ฐ๋ฐ ํ๊ฒฝ ์ค์
# ํ๋ก์ ํธ ํด๋ก
git clone <repository-url>
cd mcp-mempool
# ๊ฐ๋ฐ ์์กด์ฑ ์ค์น
uv sync --dev
# ๊ฐ๋ฐ ์๋ฒ ์คํ
uv run python -m mempool_ws_mcp_server.main
ํ ์คํธ ์คํ
# ๋ชจ๋ ํ
์คํธ ์คํ
uv run pytest
# ์ปค๋ฒ๋ฆฌ์ง ํฌํจ
uv run pytest --cov=mempool_ws_mcp_server
์ฝ๋ ํ์ง ๋๊ตฌ
# ๋ฆฐํ
uv run ruff check .
# ํฌ๋งทํ
uv run ruff format .
# ํ์
์ฒดํฌ
uv run mypy src/
๐ณ Docker ๋น๋
# ์ด๋ฏธ์ง ๋น๋
docker build -t mcp-mempool .
# ๋ฉํฐ ์ํคํ
์ฒ ๋น๋
docker buildx build --platform linux/amd64,linux/arm64 -t mcp-mempool .
๐ ๋ชจ๋ํฐ๋ง
# ๋ชจ๋ํฐ๋ง ์คํ ์คํ (Prometheus + Grafana)
docker-compose --profile monitoring up
# Grafana: http://localhost:3000 (admin/admin)
# Prometheus: http://localhost:9090
๐ API ์๋ํฌ์ธํธ
- Health Check:
GET /health - Root Info:
GET / - MCP Protocol:
POST /mcp - API Docs:
GET /docs
๐ ๋ผ์ด์ ์ค
MIT License
๐ค ๊ธฐ์ฌ
์ด์ ๋ฆฌํฌํธ์ ํ ๋ฆฌํ์คํธ๋ฅผ ํ์ํฉ๋๋ค!
๐ ์ง์
- ๋ฌธ์ ๊ฐ ์์ผ์๋ฉด GitHub Issues๋ฅผ ํ์ฉํด์ฃผ์ธ์
- ๊ฐ์ ์ ์์ด๋ ์๋ก์ด ๊ธฐ๋ฅ ์์ฒญ๋ ํ์ํฉ๋๋ค
Related Servers
MCP Docker Orchestrator
A daemon to orchestrate MCP servers as Docker containers and configure AWS ALB path-based routing.
ServiceNow
An MCP server for interacting with ServiceNow instances to manage records, incidents, and other platform features.
Financial Data
Provides access to real-time and historical stock data from the Alpha Vantage API.
Novita AI
Interact with the Novita AI API for image generation and other AI tasks.
MCP Server for National Park Services Data
Retrieve data from the National Park Service (NPS) API.
OpenRouter
Access over 400 AI models from OpenRouter's collection.
Google Cloud Run
Official MCP Server to deploy to Google Cloud Run.
Authless Remote MCP Server
A remote MCP server for Cloudflare Workers that does not require authentication.
AWS MCP
Interact with your AWS environment using natural language. Requires local AWS credentials.
OpenAI MCP Server
An MCP server for integrating with the OpenAI API.