MIDL MCP Server
OfficialProvides tools to interact with the Bitcoin blockchain, including balance checks, UTXO queries, transaction tracking, fee rates, and bridging BTC between L1 and EVM L2.
Enables deployment of Solidity smart contracts with built-in templates (ERC20, counter, storage) and reading contract state and event logs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MIDL MCP Server Bridge 0.5 BTC to L2"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MIDL MCP Server
Model Context Protocol server for MIDL Protocol — Bitcoin L1 + EVM L2 hybrid blockchain.
Bring AI-powered blockchain interaction to Claude Desktop, Cursor, and any MCP client.
Documentation • Main Website • GitHub
What is This?
The MIDL MCP Server brings full MIDL Protocol capabilities to your AI assistant. Install once, and Claude (or any MCP client) can:
Deploy smart contracts with Solidity templates
Check balances on both Bitcoin L1 and EVM L2
Bridge BTC between L1 and L2
Manage Bitcoin Runes (etch, transfer, bridge to ERC20)
Transfer tokens and native assets
Read contract state and event logs
Query network info and system contracts
And 20+ more operations
All through natural conversation in Claude Desktop or Cursor.
Related MCP server: Solana Web3.js MCP Server
Features
27 Tools Across 9 Categories
Category | Tools | Description |
Network | 3 tools | Get network info, system contracts, block data |
Balance | 3 tools | Query EVM balance, BTC balance, token balance |
Transfer | 3 tools | Transfer EVM, transfer tokens, send raw transactions |
Deploy | 1 tool | Compile and deploy Solidity contracts with templates |
Contract | 3 tools | Read contracts, verify contracts, get event logs |
Bridge | 2 tools | Bridge BTC↔EVM (deposit and withdrawal) |
Runes | 4 tools | Rune balance, transfer, bridge to/from ERC20 |
Bitcoin | 4 tools | UTXO queries, transaction tracking, fee rates |
Utility | 3 tools | Convert units, lookup addresses, estimate gas |
Dual Transport Architecture
stdio: For Claude Desktop and Cursor (local development)
HTTP: For remote clients and web integrations — live at
https://mcp.midl-ai.xyz/mcp
Plugin-Based Design
Each category is a self-contained plugin with its own tools. Easy to extend, easy to maintain.
MCP UI Cards
Rich visual feedback with formatted HTML cards showing:
Transaction details with syntax highlighting
Status indicators (pending/confirmed/failed)
Explorer links for transparency
Formatted addresses and amounts
Server-Side Signing
Secure transaction signing using MIDL_PRIVATE_KEY environment variable. No private keys exposed to the client.
Installation
Prerequisites
Node.js 18+
pnpm (recommended) or npm
MIDL Protocol RPC access
Private key for transaction signing
Quick Start
# Clone repository
git clone https://github.com/midl-ai/mcp-server
cd midl-mcp-server
# Install dependencies
pnpm install
# Set up environment variables
cp .env.example .env
# Edit .env and add your MIDL_PRIVATE_KEY
# Build
pnpm build
# Test (optional)
pnpm testConfiguration
Environment Variables
Create a .env file:
# Required: Private key for signing transactions
MIDL_PRIVATE_KEY=0x...
# Optional: Custom RPC endpoint (defaults to staging)
MIDL_RPC_URL=https://rpc.staging.midl.xyz
# Optional: Network selection (mainnet or testnet)
MIDL_NETWORK=testnetClaude Desktop Setup
Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"midl": {
"command": "node",
"args": [
"/absolute/path/to/midl-mcp-server/dist/index.js"
],
"env": {
"MIDL_PRIVATE_KEY": "your-private-key-here",
"MIDL_NETWORK": "testnet"
}
}
}
}Important: Use absolute paths, not relative paths like ~/.
Cursor Setup
Add to .cursor/config.json in your project:
{
"mcpServers": {
"midl": {
"command": "node",
"args": [
"/absolute/path/to/midl-mcp-server/dist/index.js"
],
"env": {
"MIDL_PRIVATE_KEY": "your-private-key-here"
}
}
}
}Restart Claude Desktop or Cursor after configuration.
Usage Examples
Once installed, you can use natural language in Claude:
Deploy a Contract
User: Deploy an ERC20 token called MyToken with symbol MTK and 1 million initial supply
Claude: I'll deploy that contract for you...
[Uses midl_deploy_contract tool]
Contract deployed at 0xabc...Check Balances
User: What's my balance on MIDL?
Claude: Let me check both layers...
[Uses midl_get_btc_balance and midl_get_evm_balance]
Bitcoin L1: 1.5 BTC
EVM L2: 0.3 BTCBridge Assets
User: Bridge 0.1 BTC from L1 to L2
Claude: I'll initiate the bridge transaction...
[Uses midl_bridge_btc_to_evm]
Bridge initiated. Transaction ID: 0x...
Waiting for confirmations...
Complete! Your L2 balance has been updated.Manage Runes
User: Transfer 50 UNCOMMON•GOODS rune to kaspa:qr...
Claude: Transferring rune...
[Uses midl_transfer_rune]
Rune transferred. TX: abc123...Read Contracts
User: Read the totalSupply from the ERC20 at 0x123...
Claude: Reading contract...
[Uses midl_read_contract]
Total Supply: 1,000,000 tokensProject Structure
midl-mcp-server/
├── src/
│ ├── plugins/ # All 9 plugin categories
│ │ ├── base/ # Base classes (PluginBase, ToolBase)
│ │ ├── network/ # 3 network tools
│ │ ├── balance/ # 3 balance tools
│ │ ├── transfer/ # 3 transfer tools
│ │ ├── deploy/ # 1 deploy tool + templates
│ │ ├── contract/ # 3 contract tools
│ │ ├── bridge/ # 2 bridge tools
│ │ ├── runes/ # 4 runes tools
│ │ ├── bitcoin/ # 4 bitcoin tools
│ │ └── utility/ # 3 utility tools
│ ├── ui/ # MCP UI card generators
│ │ ├── index.ts # Base card creators
│ │ ├── tx-cards.ts # Transaction cards
│ │ └── card-generators.ts # Maps tools to UI
│ ├── wallet.ts # EVM wallet client (viem)
│ ├── btc-wallet.ts # Bitcoin wallet client (@midl/node)
│ ├── config.ts # Constants and configuration
│ ├── types.ts # Shared TypeScript types
│ └── server.ts # MCP server entry point
├── dist/ # Built artifacts (generated)
├── tests/ # Unit tests
├── .env.example # Environment template
├── package.json # Dependencies
├── tsconfig.json # TypeScript config
└── vitest.config.ts # Test configurationDevelopment
Build
# Type check
pnpm typecheck
# Build for production
pnpm build
# Watch mode (rebuilds on changes)
pnpm build:watchTesting
# Run all tests
pnpm test
# Watch mode
pnpm test:watch
# Coverage report
pnpm test:coverageLinting
# Check for issues
pnpm lint
# Auto-fix
pnpm lint:fixTool Reference
Network Tools
midl_get_network_info- Get chain ID, block height, RPC endpointsmidl_get_system_contracts- Query system contract addressesmidl_get_block- Fetch block data by number or hash
Balance Tools
midl_get_evm_balance- Query EVM native balancemidl_get_btc_balance- Query Bitcoin UTXO balancemidl_get_token_balance- Query ERC20 token balance
Transfer Tools
midl_transfer_evm- Send native BTC on EVM L2midl_transfer_token- Send ERC20 tokensmidl_send_raw_transaction- Submit pre-signed transaction
Deploy Tools
midl_deploy_contract- Compile and deploy Solidity contracts
Templates:
erc20- Standard fungible tokencounter- Simple counter contractstorage- Key-value storage
Contract Tools
midl_read_contract- Call read-only contract methodsmidl_get_logs- Query contract event logsmidl_verify_contract- Verify contract on explorer
Bridge Tools
midl_bridge_btc_to_evm- Deposit BTC from L1 to L2midl_bridge_evm_to_btc- Withdraw BTC from L2 to L1
Runes Tools
midl_get_runes- List all runesmidl_get_rune_balance- Check rune balancemidl_transfer_rune- Transfer runesmidl_bridge_rune_to_erc20- Bridge rune to ERC20 token
Bitcoin Tools
midl_get_utxos- Query UTXOs for addressmidl_get_transaction- Get transaction detailsmidl_get_transaction_receipt- Get transaction receiptmidl_get_fee_rate- Get current fee rate
Utility Tools
midl_convert_btc_to_evm- Convert BTC units to weimidl_get_rune_erc20_address- Lookup rune's ERC20 addressmidl_estimate_gas- Estimate gas for transaction
Architecture Details
Plugin System
Each plugin extends PluginBase and uses the @Tool decorator:
export class NetworkPlugin extends PluginBase {
@Tool({
name: 'midl_get_network_info',
description: 'Get MIDL network information',
inputSchema: networkInfoSchema,
readOnlyHint: true,
destructiveHint: false
})
async getNetworkInfo(): Promise<ToolResponse<NetworkInfo>> {
// Implementation
}
}Wallet Clients
EVM Wallet (src/wallet.ts):
Uses viem for EVM operations
Custom MIDL chain configuration
Transaction signing with private key
Bitcoin Wallet (src/btc-wallet.ts):
Uses @midl/node for Bitcoin operations
UTXO selection and transaction building
KeyPair connector for signing
Error Handling
All tools return standardized responses:
type ToolResponse<T> = {
success: true;
data: T;
} | {
success: false;
error: string;
code?: ErrorCode;
};Type Safety
Full TypeScript strict mode. No any types. All inputs validated with Zod schemas.
Security
Private Key Management
Never commit
.envto version controlUse environment variables for production
Consider hardware wallets for mainnet
Rotate keys regularly
RPC Security
Use secure HTTPS endpoints only
Consider rate limiting for production
Monitor for unusual activity
Input Validation
All tool inputs are validated using Zod schemas before execution.
Troubleshooting
Server Not Starting
Issue: Claude Desktop can't connect to the MCP server
Solutions:
Check absolute paths in config (no
~/)Verify Node.js is in PATH
Check
dist/index.jsexists (runpnpm build)Review Claude Desktop logs
Private Key Issues
Issue: "Invalid private key" error
Solutions:
Ensure key starts with
0xCheck key length (64 hex characters +
0x)Verify key has testnet funds
Test key with a simple transaction
Network Connection
Issue: "Failed to connect to RPC" error
Solutions:
Check
MIDL_RPC_URLis correctVerify network connectivity
Test RPC with curl:
curl https://rpc.staging.midl.xyzCheck firewall settings
Tool Execution Failures
Issue: Tools return errors
Solutions:
Check transaction has sufficient gas
Verify address formats are correct
Ensure wallet has sufficient balance
Review error message for specifics
Contributing
We welcome contributions! Here's how:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-tool)Add your tool or fix
Write tests
Submit a pull request
Adding a New Tool
Create tool file in appropriate plugin directory
Extend
ToolBaseand use@TooldecoratorAdd Zod schema for input validation
Implement
execute()methodAdd unit tests
Update plugin's
index.ts
Related Projects
MIDL Frontend - AI chat interface
MIDL Protocol - Bitcoin+EVM hybrid chain
@midl-js - Official MIDL SDK
Resources
License
MIT License - 100% open source.
Acknowledgments
Built for MIDL VibeHack 2026 hackathon (Feb 9-28, 2026).
Special thanks to:
MIDL Protocol Team - For the hybrid chain architecture
@midl-js - For the comprehensive SDK
Anthropic - For Claude and MCP specification
Community - For feedback and testing
Website • Documentation • GitHub
MIDL MCP Server: Bring AI to Your Blockchain
Available Tools
29 toolsmidl_bridge_btc_to_evmA
Bridge BTC from the Bitcoin layer to the EVM layer. Creates a deposit transaction that sends BTC to the TSS multisig, which validators process to credit your EVM address.
Inputs: amount (required), unit.
midl_bridge_erc20_to_runeADestructive
Bridge an ERC20 token back to its native Rune on Bitcoin (withdrawal). The Runes will be credited to your Bitcoin address after validator confirmation.
Inputs: runeId (required), amount (required).
midl_bridge_evm_to_btcA
Withdraw BTC from the EVM layer back to the Bitcoin layer. Creates a withdrawal transaction that validators process to send BTC to your specified Bitcoin address.
Inputs: amount (required), btcAddress (required), unit.
midl_bridge_rune_to_erc20ADestructive
Bridge a Rune from Bitcoin layer to its ERC20 representation on EVM. The ERC20 tokens will be credited after validator confirmation (~10 minutes).
Inputs: runeId (required), amount (required).
midl_convert_btc_to_evmARead-only
Derive EVM address from Bitcoin public key (compressed 33-byte or uncompressed 65-byte hex). In MIDL, each BTC key deterministically maps to one EVM address via keccak256.
Inputs: publicKey (required).
midl_deploy_contractADestructive
Deploy a smart contract. Three options:
Template (easiest): template="erc20" + name, symbol, initialSupply
Source code: source="pragma solidity..." + contractName
Pre-compiled: abi + bytecode Templates: erc20, counter, storage
Inputs: template, name, symbol, initialSupply, +5 more.
midl_estimate_gasARead-only
Estimate gas required for an EVM transaction before sending.
Inputs: to (required), value, data.
midl_get_blockARead-only
Get block information by number or latest. Returns block hash, timestamp, transaction count, and gas details.
Inputs: blockNumber.
midl_get_bridge_statusARead-only
Track the status of a BTC→EVM bridge transaction. Shows BTC confirmations, validator processing, and EVM credit status with helpful suggestions.
Inputs: btcTxId (required).
midl_get_btc_balanceARead-only
Get the Bitcoin L1 balance. If no address provided, returns balance of connected wallet payment address. Returns confirmed and unconfirmed balances.
Inputs: address.
midl_get_evm_balanceARead-only
Get the EVM layer BTC balance. If no address provided, returns balance of connected wallet. Returns balance in wei and formatted BTC.
Inputs: address.
midl_get_fee_rateARead-only
Get current Bitcoin fee rates (sat/vB) for different confirmation targets.
Inputs: no named parameters.
midl_get_logsBRead-only
Get event logs from the blockchain. Can filter by contract address and block range. Returns raw log data.
Inputs: address, fromBlock, toBlock.
midl_get_network_infoARead-only
Get current MIDL network information including chain ID, RPC URL, explorer URLs, and current block height. Use this to verify network connectivity and configuration.
Inputs: no named parameters.
midl_get_rune_balanceARead-only
Get the balance of a specific Rune. If no address provided, uses connected wallet ordinals address.
Inputs: runeId (required), address.
midl_get_rune_erc20_addressARead-only
Get the ERC20 contract address for a Rune. Each Rune has a deterministic ERC20 address derived via CREATE2.
Inputs: runeId (required).
midl_get_runesARead-only
Get all Runes held by a Bitcoin address. If no address provided, uses connected wallet ordinals address.
Inputs: address.
midl_get_system_contractsARead-only
Get all MIDL system contract addresses. These are predeployed contracts for core protocol functionality like bridging, staking, and runes.
Inputs: no named parameters.
midl_get_token_balanceARead-only
Get ERC20 token balance for an address. Returns balance along with token metadata (symbol, name, decimals).
Inputs: tokenAddress (required), ownerAddress (required).
midl_get_transactionARead-only
Get Bitcoin transaction details by txid.
Inputs: txid (required).
midl_get_transaction_receiptARead-only
Get EVM transaction receipt including status, gas used, and logs.
Inputs: hash (required).
midl_get_utxosARead-only
Get unspent transaction outputs (UTXOs). If no address provided, uses connected wallet payment address.
Inputs: address.
midl_read_contractARead-only
Read data from a smart contract. Requires contract address, ABI, and function name. Returns the function result.
Inputs: address (required), abi (required), functionName (required), args.
midl_send_raw_transactionADestructive
Send a raw signed transaction to the network. Returns full transaction receipt.
Inputs: signedTx (required).
midl_transfer_evmBDestructive
Transfer native BTC on the EVM layer to another address.
Inputs: to (required), amount (required).
midl_transfer_runeADestructive
Transfer Runes to another Bitcoin address.
Inputs: runeId (required), amount (required), toAddress (required).
midl_transfer_tokenBDestructive
Transfer ERC20 tokens to another address.
Inputs: tokenAddress (required), to (required), amount (required).
midl_verify_contractA
Verify contract source code on Blockscout explorer. Requires contract address, source code, and compiler settings.
Inputs: address (required), sourceCode (required), contractName (required), compilerVersion, +2 more.
midl_write_contractBDestructive
Execute a state-changing function on a smart contract via MIDL intention flow. For payable functions, include value parameter (in wei).
Inputs: address (required), abi (required), functionName (required), args, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
Each tool targets a distinct operation (e.g., bridging, querying balances, deploying contracts, transferring tokens) with clear direction or resource. No two tools appear to do the same thing.
All tools follow the pattern midl_verb_noun in snake_case, e.g., midl_get_btc_balance, midl_transfer_rune. The prefix 'midl_' is consistent, and verbs like get, transfer, bridge, deploy are used appropriately.
29 tools is on the higher end but justified by the broad scope of the server (bridging, EVM, token operations, network queries). Each tool serves a specific function, and the set is well-scoped for a cross-chain hub.
The tool surface covers bridging, contract lifecycle (deploy, read, write, verify, logs, gas estimation), transfers, balance queries, and network info. Minor gaps like token approval or transaction cancellation exist but do not severely hinder core workflows.
Maintenance
Related MCP Connectors
Provide AI agents and automation tools with contextual access to blockchain data including balance…
Bitcoin RPC for AI agents. 7 read tools; x402 USDC on Base mainnet. Discovery is free.
Run all your Solana wallets from your AI: send, swap, split, consolidate and clean up.
Bitcoin and YouTube video intelligence for AI agents. Pay-per-call via x402 USDC on Base.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI applications to interact with the Base blockchain network, allowing wallet management, smart contract deployment, token transfers, NFT operations, DeFi interactions with Morpho vaults, and onramping funds via Coinbase.22 npm-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with the Solana blockchain, manage accounts and tokens, and develop and deploy smart contracts end-to-end.4MIT

Bink MCP Serverofficial
AlicenseNot gradedqualityDmaintenanceEnables AI agents to perform blockchain operations like wallet management, token info, DeFi swaps, cross-chain bridging, and price checking across Ethereum, BNB Chain, and Solana.ISC- AlicenseCqualityDmaintenanceEnables AI applications to interact with the Bitcoin Network, manage wallets, check balances, convert prices, and send transactions.451 npm6MIT