bitcoinjs-mcp-server

Odyssey98/bitcoinjs-mcp-server

3.2

If you are the rightful owner of bitcoinjs-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The BitcoinJS MCP Server is a Model Context Protocol server that provides Bitcoin development tools using the bitcoinjs-lib library.

Tools
15
Resources
0
Prompts
0

BitcoinJS MCP Server

A Model Context Protocol (MCP) server that provides Bitcoin development tools using the bitcoinjs-lib library. This server enables Claude Code and other MCP clients to perform Bitcoin-related operations like address generation, transaction creation, and script compilation.

Features

  • Address Generation: Generate all types of Bitcoin addresses (P2PKH, P2SH, P2WPKH, P2WSH, P2TR)
  • Transaction Processing: Create, sign, and analyze Bitcoin transactions
  • PSBT Support: Handle Partially Signed Bitcoin Transactions
  • Script Operations: Compile and analyze Bitcoin scripts
  • Network Support: Mainnet, Testnet, and Regtest configurations
  • Validation: Comprehensive input validation and error handling

Installation & Usage

For MCP Clients (Claude Code, etc.)

Step 1: Install globally (Required)

npm install -g bitcoinjs-mcp-server

Step 2: Add to your MCP settings (.claude.json or .mcp.json)

{
  "mcpServers": {
    "bitcoinjs": {
      "command": "bitcoinjs-mcp-server"
    }
  }
}

That's it! The server is now ready for use with your MCP client.

Alternative: Using npx (Auto-install)

If you prefer not to install globally

Add to your MCP settings:

{
  "mcpServers": {
    "bitcoinjs": {
      "command": "npx",
      "args": ["-y", "bitcoinjs-mcp-server"]
    }
  }
}

Note: This method may have slower startup times as it downloads the package on each use.

Development Setup
git clone https://github.com/Odyssey98/bitcoinjs-mcp-server.git
cd bitcoinjs-mcp-server
npm install && npm run build

Then use:

{
  "mcpServers": {
    "bitcoinjs": {
      "command": "node",
      "args": ["dist/index.js"],
      "cwd": "/path/to/bitcoinjs-mcp-server"
    }
  }
}

For Development

# Clone and install
git clone https://github.com/Odyssey98/bitcoinjs-mcp-server.git
cd bitcoinjs-mcp-server
npm install
npm run build

# Start the server
npm start

Available Tools

Address Tools

  • generate_address: Generate Bitcoin addresses of various types
  • validate_address: Validate Bitcoin address format and network
  • decode_address: Decode address to script and other details

Transaction Tools

  • create_transaction: Create new Bitcoin transactions
  • sign_transaction: Sign transactions with private keys
  • decode_transaction: Decode raw transaction hex
  • estimate_tx_size: Estimate transaction size and fees

PSBT Tools

  • create_psbt: Create Partially Signed Bitcoin Transaction
  • update_psbt: Add inputs/outputs to existing PSBT
  • sign_psbt: Sign PSBT with keys
  • finalize_psbt: Finalize and extract transaction

Utility Tools

  • generate_keypair: Generate new key pairs
  • create_multisig: Create multisignature addresses
  • compile_script: Compile Bitcoin scripts
  • hash_message: Hash messages for signing

Example Usage

Once configured in your MCP client, you can use these tools:

  • Generate a new Bitcoin address: "Generate a P2WPKH testnet address"
  • Create a transaction: "Create a transaction sending 0.001 BTC from [address] to [address]"
  • Work with multisig: "Create a 2-of-3 multisig address with these public keys: [...]"
  • Sign transactions: "Sign this transaction hex with the private key"

Development

# Development mode with hot reload
npm run dev

# Run tests
npm test

# Lint code
npm run lint

# Format code
npm run format

License

MIT