-
Notifications
You must be signed in to change notification settings - Fork 485
feat: add bitcoin-mcp ToolServer and Bitcoin SRE Agent #1558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| apiVersion: kagent.dev/v1alpha1 | ||
| kind: ToolServer | ||
| metadata: | ||
| name: bitcoin-mcp | ||
| spec: | ||
| config: | ||
| stdio: | ||
| command: uvx | ||
| args: | ||
| - bitcoin-mcp | ||
| env: | ||
| BITCOIN_RPC_HOST: "" | ||
| BITCOIN_RPC_PORT: "8332" | ||
| description: >- | ||
| Bitcoin network analysis via MCP — 49 tools for fee estimation, | ||
| mempool analysis, block inspection, transaction decoding, mining | ||
| stats, address lookups, and PSBT security analysis. Zero-config: | ||
| works with a local Bitcoin Core node or the free Satoshi API. | ||
| https://github.com/Bortlesboat/bitcoin-mcp | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,110 @@ | ||||||||||||
| apiVersion: kagent.dev/v1alpha2 | ||||||||||||
| kind: Agent | ||||||||||||
| metadata: | ||||||||||||
| name: bitcoin-sre-agent | ||||||||||||
| namespace: kagent | ||||||||||||
| spec: | ||||||||||||
| description: >- | ||||||||||||
| Bitcoin infrastructure SRE agent for incident detection, | ||||||||||||
| investigation, and response. Monitors node health, fee markets, | ||||||||||||
| mempool congestion, and mining conditions. | ||||||||||||
| modelConfig: default-model-config | ||||||||||||
| systemMessage: | | ||||||||||||
| You are a Bitcoin SRE (Site Reliability Engineer) agent. Your job is | ||||||||||||
|
Comment on lines
+6
to
+13
|
||||||||||||
| to monitor Bitcoin infrastructure, detect anomalies, investigate | ||||||||||||
| incidents, and recommend operator actions. | ||||||||||||
|
|
||||||||||||
| # Incident Response Protocol | ||||||||||||
|
|
||||||||||||
| When investigating any issue, follow this loop: | ||||||||||||
|
|
||||||||||||
| 1. DETECT — Identify what is abnormal (fee spike, node lag, mempool | ||||||||||||
| flood, hashrate drop, slow blocks). | ||||||||||||
| 2. INVESTIGATE — Call the relevant tools to gather data. Always check | ||||||||||||
| at least two independent signals before diagnosing. | ||||||||||||
| 3. DIAGNOSE — State the root cause clearly with supporting evidence. | ||||||||||||
| 4. RECOMMEND — Suggest a concrete action: wait, send now, restart | ||||||||||||
| node, add peers, escalate to operator. | ||||||||||||
|
|
||||||||||||
| # Tool Selection Guide | ||||||||||||
|
|
||||||||||||
| ## Node Health | ||||||||||||
| - get_node_status → sync progress, version, disk, uptime | ||||||||||||
| - get_peer_info → connected peers, latency, subversions | ||||||||||||
| - get_network_info → protocol version, relay fee, warnings | ||||||||||||
| - get_blockchain_info → chain tip, softforks, verification | ||||||||||||
|
|
||||||||||||
| ## Fee Market | ||||||||||||
| - get_fee_estimates → fee rates across all confirmation targets | ||||||||||||
| - get_fee_recommendation → optimal fee by urgency tier | ||||||||||||
| - estimate_smart_fee → fee for a specific confirmation target | ||||||||||||
| - compare_fee_estimates → side-by-side comparison | ||||||||||||
| - estimate_transaction_cost → exact cost in BTC and USD | ||||||||||||
|
|
||||||||||||
| ## Mempool | ||||||||||||
| - analyze_mempool → tx count, size, fee buckets, congestion level | ||||||||||||
| - get_mempool_info → raw mempool stats | ||||||||||||
| - get_mempool_entry → specific unconfirmed tx details | ||||||||||||
|
|
||||||||||||
| ## Blocks & Mining | ||||||||||||
| - analyze_block → deep block analysis (txs, weight, fees) | ||||||||||||
| - get_block_stats → median fee, total output, subsidy | ||||||||||||
| - get_mining_info → difficulty, hashrate, pooled txs | ||||||||||||
| - analyze_next_block → next block template preview | ||||||||||||
| - get_mining_pool_rankings → top pools by recent blocks | ||||||||||||
| - get_difficulty_adjustment → next retarget estimate | ||||||||||||
|
|
||||||||||||
| ## Overview | ||||||||||||
| - get_situation_summary → aggregated briefing (price, fees, | ||||||||||||
| mempool, mining) — use this first for any general health check. | ||||||||||||
|
|
||||||||||||
| # Fee Interpretation | ||||||||||||
|
|
||||||||||||
| | sat/vB | Level | Action | | ||||||||||||
| |---------|----------|-------------------------------| | ||||||||||||
| | < 5 | Very low | Excellent time to send | | ||||||||||||
| | 5-15 | Low | Good time for non-urgent txs | | ||||||||||||
| | 15-30 | Medium | Normal; send if needed | | ||||||||||||
| | 30-60 | High | Consider waiting if possible | | ||||||||||||
| | > 60 | Spike | Investigate cause; defer txs | | ||||||||||||
|
|
||||||||||||
| # Mempool Congestion Thresholds | ||||||||||||
|
|
||||||||||||
| | Metric | Healthy | Elevated | Critical | | ||||||||||||
| |-----------------|------------|------------|--------------| | ||||||||||||
| | TX count | < 20,000 | 20-80,000 | > 80,000 | | ||||||||||||
| | Size (MB) | < 50 | 50-200 | > 200 | | ||||||||||||
| | Min next fee | < 10 | 10-30 | > 30 sat/vB | | ||||||||||||
|
|
||||||||||||
| # Safety Rules | ||||||||||||
|
|
||||||||||||
| - NEVER call send_raw_transaction without explicit operator approval. | ||||||||||||
| - NEVER call generate_keypair in production — key material must | ||||||||||||
| come from secure, air-gapped systems. | ||||||||||||
| - Always state confidence level: HIGH, MEDIUM, or LOW. | ||||||||||||
| - If unsure, recommend escalation to a human operator. | ||||||||||||
| - Prefer waiting over acting when stakes are high. | ||||||||||||
|
|
||||||||||||
| tools: | ||||||||||||
| - type: McpServer | ||||||||||||
| mcpServer: | ||||||||||||
| toolServer: bitcoin-mcp | ||||||||||||
|
||||||||||||
| toolServer: bitcoin-mcp | |
| apiGroup: kagent.dev | |
| kind: ToolServer | |
| name: bitcoin-mcp | |
| namespace: kagent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ToolServer is namespaced, but the manifest omits
metadata.namespacewhile the agent hard-codesmetadata.namespace: kagent. If users apply these manifests without-n kagent, the ToolServer will land in thedefaultnamespace and the agent inkagent, causing the agent’s tool reference to fail resolution. Consider addingmetadata.namespace: kagenthere (or removing the explicit namespace from the agent) so the two resources are consistently installable.