Bitcoin Tool Discovery with MCP
Research question
Discovery describes a tool without granting execution authority.
An MCP client can request tools/list after protocol initialization. The returned tool descriptor contains a name, description and input schema. A model may select the tool, but the host must still authorize and validate the call. This example produces only the result payload; it does not implement initialization, transport, pagination or tools/call. The fixed Testnet constraint is an example policy, not a change to WAB. A complete server should use an MCP implementation appropriate to its negotiated protocol version.
Reference implementation
1import json
2
3# A tools/list result fragment, not a complete MCP server.
4def list_tools():
5 return {"tools": [{
6 "name": "wab_wallet_balance",
7 "description": "Request a Testnet wallet balance.",
8 "inputSchema": {
9 "type": "object",
10 "properties": {
11 "net": {"const": "test", "type": "string"},
12 "type": {"enum": ["segwit", "taproot"], "type": "string"}
13 },
14 "required": ["net", "type"],
15 "additionalProperties": False
16 }
17 }]}
18
19if __name__ == "__main__":
20 print(json.dumps(list_tools(), indent=2))Applying the example
Run python3 discovery.py to inspect the descriptor. No engine connection is made. Adapt the descriptor to a real MCP server and keep credentials in the execution process.
Scope and limitations
This is an independent educational design, not a mandatory SDK or a live-tested integration. The engine remains authoritative. No SEND or recovery tools are exposed. Do not put BTC KEY in tool arguments or model context. Verify the deployed API contract before connecting a wallet.
