Skip to main content
Glama
mcp-python-bitcoinlib

mcp-python-bitcoinlib

by daedalus

mcp-python-bitcoinlib

An MCP server that exposes the python-bitcoinlib API

PyPI Python Coverage Ruff

Install

pip install mcp-python-bitcoinlib

Related MCP server: Bitcoin-MCP-Server

Usage

mcp-python-bitcoinlib

MCP Configuration

mcp-name: io.github.daedalus/mcp-python-bitcoinlib

For Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-python-bitcoinlib": {
      "command": "mcp-python-bitcoinlib",
      "env": {}
    }
  }
}

Tools

The server exposes the following Bitcoin tools:

  • Key Management: Generate private keys, convert between WIF and hex

  • Address Generation: P2PKH, P2SH, P2WPKH, P2WSH addresses

  • Transaction Building: Create and sign transactions

  • Script Operations: Parse and create Bitcoin scripts

  • Cryptography: SHA256, RIPEMD160, Hash160, Hash256, ECDSA signing/verification

Development

git clone https://github.com/daedalus/mcp-python-bitcoinlib.git
cd mcp-python-bitcoinlib
pip install -e ".[test]"

# run tests
pytest

# format
ruff format src/ tests/

# lint
ruff check src/ tests/

# type check
mcp-python-bitcoinlib src/

Available Tools

20 tools
address_to_scriptC

Get the script from an address.

Inputs: address (required). Returns: result

create_p2pkh_scriptB

Create a P2PKH script from a public key hash.

Inputs: pubkey_hash (required). Returns: result

create_p2wpkh_scriptB

Create a P2WPKH script from a public key hash.

Inputs: pubkey_hash (required). Returns: result

create_transactionB

Create an unsigned Bitcoin transaction.

Inputs: outputs (required), fee, version. Returns: object

generate_private_keyA

Generate a random private key and return it as a 32-byte hex string.

Inputs: no named parameters. Returns: result

hash160_hexA

Compute Hash160 (SHA256 then RIPEMD160).

Inputs: data (required). Returns: result

hash256_hexB

Compute double SHA256.

Inputs: data (required). Returns: result

parse_scriptA

Parse a script into its opcodes.

Inputs: script_hex (required). Returns: result

privkey_to_pubkeyB

Get the public key from a private key.

Inputs: privkey (required), compressed. Returns: result

privkey_to_wifB

Convert a private key (hex) to WIF format.

Inputs: privkey (required), compressed. Returns: result

pubkey_to_addressC

Convert a public key to an address.

Inputs: pubkey (required), address_type. Returns: result

pubkey_to_p2sh_p2wpkh_redeemscriptC

Get the P2SH-P2WPKH redeemScript for a public key.

Inputs: pubkey (required). Returns: result

ripemd160_hexA

Compute RIPEMD160 hash.

Inputs: data (required). Returns: result

serialize_transactionC

Serialize and deserialize a transaction.

Inputs: tx_hex (required). Returns: object

sha256_hexC

Compute SHA256 hash.

Inputs: data (required). Returns: result

sign_messageC

Sign a message with a private key.

Inputs: message (required), privkey (required). Returns: result

sign_transactionC

Sign a transaction input with a private key.

Inputs: tx_hex (required), privkey (required), sighash_type. Returns: result

validate_addressB

Validate a Bitcoin address for a given network.

Inputs: address (required), network. Returns: object

verify_signatureB

Verify an ECDSA signature.

Inputs: signature (required), pubkey (required), message (required). Returns: result

wif_to_privkeyA

Convert a WIF-encoded private key back to hex.

Inputs: wif (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 20 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: hashing functions target specific algorithms, key operations are separated, address and script creation focus on different types, and transaction operations are distinct from signing. No two tools overlap in functionality.

    Naming Consistency5/5

    All tools use consistent snake_case naming with a verb-noun pattern (e.g., create_p2pkh_script, sign_transaction). Hash functions follow a uniform 'algorithm_hex' pattern. No mixing of conventions or ambiguous names.

    Tool Count5/5

    With 20 tools, the server covers essential Bitcoin operations without being bloated. Each tool serves a specific need, from key generation and address conversion to transaction creation and signing. The count is appropriate for a comprehensive Bitcoin library.

    Completeness4/5

    The tool set covers major Bitcoin workflows: key management, address generation (P2PKH, P2WPKH, P2SH-P2WPKH), transaction creation and signing, message signing, hashing, and validation. Minor gaps like explicit bech32 address or multisig script creation are absent but non-critical for most use cases.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A comprehensive Model Context Protocol (MCP) server for BTCPayServer integration, providing tools for payment processing, store management, user administration, webhook handling and more with full API coverage.
      3
      27 npm
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server for Bitcoin block explorer and mempool/fee statistics, providing tools to query fees, mempool stats, blocks, transactions, addresses, hashrate, and mining pools.
      300 npm
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      A Python-based MCP server that provides mathematical tools like addition and random number generation, plus server metadata.
      -