bitcoinjs-mcp-server
v1.0.6
Published
MCP (Model Context Protocol) server for Bitcoin development using bitcoinjs-lib
Maintainers
Readme
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-serverStep 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)
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.
git clone https://github.com/Odyssey98/bitcoinjs-mcp-server.git
cd bitcoinjs-mcp-server
npm install && npm run buildThen 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 startAvailable Tools
Address Tools
generate_address: Generate Bitcoin addresses of various typesvalidate_address: Validate Bitcoin address format and networkdecode_address: Decode address to script and other details
Transaction Tools
create_transaction: Create new Bitcoin transactionssign_transaction: Sign transactions with private keysdecode_transaction: Decode raw transaction hexestimate_tx_size: Estimate transaction size and fees
PSBT Tools
create_psbt: Create Partially Signed Bitcoin Transactionupdate_psbt: Add inputs/outputs to existing PSBTsign_psbt: Sign PSBT with keysfinalize_psbt: Finalize and extract transaction
Utility Tools
generate_keypair: Generate new key pairscreate_multisig: Create multisignature addressescompile_script: Compile Bitcoin scriptshash_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 formatLicense
MIT
