@purplesquirrel/goat-network-mcp
v0.4.4
Published
MCP server for GOAT Network — the Bitcoin L2. EVM-compatible JSON-RPC access (blocks, txs, balances, contract reads, logs) for any AI agent.
Maintainers
Readme
goat-network-mcp
MCP server for GOAT Network — the BitVM-based Bitcoin L2. 91+ tools (up to 128 with optional services): 43 native (JSON-RPC reads, ABI-aware tx builders, native L1↔L2 bridge, ERC-8004 identity) plus 48+ wrapped from @goatnetwork/agentkit (DEX, BitVM2, OFT, wgBTC, full agentkit surface). Optional services add 37 more tools (faucet, X402 payments, merchant portal). All build-only — the MCP never holds keys; unsigned txs are returned for external signing.
Note:
@goatnetwork/[email protected]ships with a broken ESM build (upstream issue); we ship apostinstallpatch that fixes it. No action required from users —npm installruns the patcher automatically.
Networks
| Network | Chain ID | RPC | Explorer | | ----------------------------- | -------- | ---------------------------------- | ------------------------------------- | | GOAT Network Alpha Mainnet | 2345 | https://rpc.goat.network | https://explorer.goat.network | | GOAT Network Testnet3 | 48816 | https://rpc.testnet3.goat.network | https://explorer.testnet3.goat.network|
Native token: BTC (18 decimals, wei-style).
Install
npm install -g @purplesquirrel/goat-network-mcpOr run from source:
git clone https://github.com/ExpertVagabond/goat-network-mcp
cd goat-network-mcp
npm install
npm run build
node dist/index.jsClaude Desktop / Claude Code config
{
"mcpServers": {
"goat-network": {
"command": "npx",
"args": ["-y", "@purplesquirrel/goat-network-mcp"],
"env": {
"GOAT_NETWORK": "mainnet"
}
}
}
}Environment
| Variable | Default | Description |
| ----------------- | --------- | ---------------------------------------------------------- |
| GOAT_NETWORK | mainnet | mainnet or testnet3 |
| GOAT_RPC_URL | — | Override the RPC endpoint (e.g. a private/paid node) |
| GOAT_FAUCET_URL | — | Faucet API base URL (enables faucet tools) |
| GOAT_X402_URL | — | X402 merchant portal API URL (enables merchant/payment tools) |
| GOAT_X402_TOKEN | — | X402 access token (optional, for authenticated requests) |
Tools
Chain
get_chain_info— chain ID, latest block, gas price, network metadataget_block— block by number or tag (latest,safe,finalized, …)get_block_by_hash— block by hashget_gas_price— current gas price in weiget_fee_history— EIP-1559 base fees and reward percentiles
Accounts
get_balance— native BTC balance (returns decimal and wei)get_transaction_count— nonceget_code— contract bytecodeget_storage_at— read a storage slot
Transactions
get_transaction— tx by hashget_transaction_receipt— receipt with status + logssend_raw_transaction— broadcast a pre-signed raw tx (MCP does not sign)
Contracts
eth_call— read-only contract callestimate_gas— gas estimate for a callget_logs— event log filter
Explorer
explorer_link— build an explorer URL for a tx, address, or block
Bridge (v0.3.0 — GOAT-native BTC L1↔L2)
The bridge contract lives at 0xBC10000000000000000000000000000000000003 on both mainnet and testnet3.
system_contracts— return the full predeployed system contract table (bridge, wgBTC, goatToken, btcBlock relay, …)bridge_deposit_op_return— generate the OP_RETURN payload for a BTC L1 deposit (network-aware:GOATon mainnet,GT3Von testnet3)bridge_deposit_status— callisDeposited(txHash, txout)to verify a BTC deposit has been creditedbridge_withdrawal_status— read a withdrawal by id; returns status (Pending/Canceling/Canceled/Refunded/Paid), amount, tax, BTC fee ratebridge_params— live deposit/withdrawal limits, tax rates, confirmation requirementsbuild_bridge_withdraw— build unsigned L2 tx callingwithdraw(btcReceiver, maxTxPriceSatPerVbyte)with the BTC amount as msg.valuebuild_bridge_rbf— bump fee rate on a pending withdrawalbuild_bridge_cancel— request cancellation (cancel1)build_bridge_refund— claim refund after relayer-approved cancellation
Build / Write (v0.2.0 — no key custody)
build_transaction— auto-fill an unsigned EIP-1559 tx (nonce, gas, fees, chainId) ready for an external wallet to signencode_function_data— ABI-encode a function call (accepts JSON ABI or human-readable signature)decode_function_data— decode calldata back to{functionName, args}decode_event_log— decode a raw event log into the event name + named argumentssimulate_transaction— dry-run viaeth_call; returns success or a decoded revert reasonbuild_erc20_transfer— one-shot ERC-20 transfer builder (accepts decimal amount + decimals)build_erc20_approve— ERC-20 approve builder; pass"max"for unlimited allowancebuild_contract_write— generic write builder for any contract function
Sign the returned tx in your wallet (MetaMask/Phantom/Ledger/etc), then broadcast the signed hex via send_raw_transaction. The MCP never holds keys.
Security
This MCP is read-mostly. The only write surface is send_raw_transaction, which broadcasts a transaction you already signed elsewhere — the server never holds keys. Run it under whatever sandbox your MCP host provides.
License
MIT © Purple Squirrel Media
