
Aibtcdev
io.github.aibtcdevPublished by GitHub account aibtcdevv1.17.0Updated Oct 27, 2026
Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg, NFTs, x402 payments.
Overview
Bitcoin and Stacks wallet server that lets an AI agent hold its own encrypted wallet, move BTC/STX/sBTC, trade DeFi, and pay x402 APIs.
- What you can do
- Create, import, unlock, switch and export agent wallets, and check balances and addresses
- Send BTC, STX, sBTC and SIP-010 tokens; manage UTXOs, fees and mempool status
- Handle NFTs, inscriptions, PSBTs, BNS .btc domains and message signing
- Swap and lend on ALEX, Zest and Bitflow; stack STX and claim sBTC rewards
- Query chain data, call or deploy Clarity contracts, and run an autonomous yield hunter
- Discover and pay x402 endpoints, send paid agent inbox messages, browse TaskMarket tasks
- When to use it
- Use it when you want an agent to actually transact on Bitcoin and Stacks rather than only read data: holding its own wallet, paying for x402 APIs, swapping or lending, or managing ordinals and BNS names. Testnet mode makes it reasonable for experimentation before touching mainnet funds.
- Requirements
- Runs locally over stdio via npx, so Node.js is needed. Optional environment variables: NETWORK (mainnet or testnet), AIBTC_TOOLS tool profile, CLIENT_MNEMONIC, HIRO_API_KEY for higher rate limits, and SPEND_LIMIT_* caps. The installer writes client config files and, in an interactive terminal, generates a wallet with a password and 24-word mnemonic.
Installation
In SourceWeft
- Open Aibtcdev in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
@aibtc/mcp-server
Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg, NFTs, and x402 payments.
Features
- Bitcoin L1 - Check balances, send BTC, manage UTXOs via mempool.space
- Agent's Own Wallet - Agents get their own wallet to perform blockchain transactions
- Secure Storage - Wallets encrypted with AES-256-GCM and stored locally
- 350+ Tools - Bitcoin L1 + comprehensive Stacks L2 operations
- sBTC Support - Native Bitcoin on Stacks operations
- Token Operations - SIP-010 fungible token transfers and queries
- NFT Support - SIP-009 NFT holdings, transfers, and metadata
- DeFi Trading - ALEX DEX swaps and Zest Protocol lending/borrowing
- Stacking/PoX-5 - Stake STX with a signer manager, extend, unstake, claim sBTC rewards
- BNS Domains - .btc domain lookups and management (V1 + V2)
- x402 Payments - Automatic payment handling for paid APIs
Quick Start
Claude Code (Terminal)
This configures Claude Code and creates the agent's wallet: it prints the Stacks and Bitcoin addresses, a generated password and the 24-word mnemonic once. Write both down. The mnemonic is stored only encrypted (AES-256-GCM) in ~/.aibtc/ on this machine, and the password is not saved anywhere; the agent asks for it to unlock, and you can change it with wallet_rotate_password. If a wallet for the network already exists it is kept. The wallet is only created when the install runs in an interactive terminal (never into a pipe or CI log). Pass --no-wallet to skip it and create or import one from the agent instead.
Restart your terminal, send a little STX to the printed address, and ask the agent to unlock the wallet and make a paid inference call.
Claude Desktop (App)
This detects your OS and writes to the correct Claude Desktop config file:
Restart Claude Desktop after installing.
Other MCP Clients
This is a standard stdio MCP server, so it works with any MCP-compatible client. Claude Code is the default --install target; select another client with a flag:
Each installer merges into the existing config — it won't clobber other servers or settings. Restart the client afterward.
OpenRouter (any model)
The clients above are MCP hosts — they connect to this server for you. To drive the tools with an OpenRouter model instead, the server ships a built-in bridge: it spawns itself in server mode, exposes the tools to the model as function tools, and runs the tool-call loop. This is the client-side pattern from OpenRouter's MCP cookbook, packaged into the binary.
Safety flags (this server moves real funds, so the bridge defaults to nothing extra and lets you constrain it):
Before any agent loop runs (and on --list-tools), the bridge prints a compact safety receipt to stderr — network, read-only mode, exposed/write/blocked tool counts, the session spend cap, and the number of known x402 endpoints — so the configured execution boundaries are visible up front. It reports boundaries only; it never claims any value moved.
The allowlist is re-enforced at execution time, so a model can never call a tool outside the exposed set. Any MCP-capable agent framework (@openrouter/agent, OpenAI Agents SDK, Claude Agent SDK) can also point at this server directly — the bridge is for driving it through OpenRouter's raw API without adopting a framework.
Testnet Mode
Add --testnet to any install command:
Why npx? Using
npx @aibtc/mcp-server@latestensures you always get the newest version automatically. Global installs (npm install -g) won't auto-update.
Tool Profiles
Every tool definition is loaded into the model's context, so --install writes AIBTC_TOOLS=core: a lean core of 26 tools: wallet (including wallet_rotate_password; wallet_export is in the wallet group so the mnemonic isn't one call away), balances, STX/BTC/sBTC transfers, x402 (list_x402_endpoints, probe_x402_endpoint, execute_x402_endpoint) earning (earning_opportunities, bounty_list/get/submit, identity_register) and inbox auto-reply (inbox_auto_reply, inbox_auto_reply_configure).
Add groups with AIBTC_TOOLS=core,defi,ordinals in the server's env (the core is always included), or load everything with AIBTC_TOOLS=all / --profile full. If AIBTC_TOOLS is not set at all, every tool is loaded, so configs written by earlier versions keep all their tools:
The server's instructions list the groups that are off, so the agent can tell you which one to enable. The OpenRouter bridge starts from the full set and narrows it with its own --read-only/--allow/--block flags.
Manual Configuration
If you prefer to configure manually, add the following to your client's config file. The -y flag stops npx from prompting for confirmation.
Claude Code / Claude Desktop / Cursor / Windsurf / Gemini CLI — mcpServers JSON:
VS Code (.vscode/mcp.json) — uses a servers key and a typed entry:
OpenAI Codex CLI (~/.codex/config.toml) — TOML, not JSON:
Zed (settings.json) — uses a context_servers key:
Cline / Roo Code (VS Code extension) — add the same mcpServers JSON block above via the extension's MCP settings panel (the exact cline_mcp_settings.json path varies by OS and VS Code build).
Any other MCP client works too — point it at
npx -y @aibtc/mcp-server@latestover stdio withNETWORKin the env.
Giving Claude a Wallet
--install creates a wallet for you (see Quick Start). If you installed with --no-wallet, configured the client by hand, or want another wallet, the agent can create or import one:
Example Conversation
Wallet States
Session Management
- By default, the wallet auto-locks after 15 minutes
- You can change this with
wallet_set_timeout(set to 0 to disable) - Use
wallet_lockto manually lock the wallet - Use
wallet_unlockwhen you need Claude to transact again
Wallet Storage
Claude's wallets are stored locally on your machine:
Security:
- AES-256-GCM encryption with Scrypt key derivation
- Password required to unlock
- Mnemonics never stored in plaintext
- File permissions set to owner-only (0600)
Bitcoin L1 Support
Each wallet automatically derives both a Stacks address and a Bitcoin address from the same mnemonic using BIP39/BIP32 standards.
Derivation Paths (BIP84):
- Mainnet:
m/84'/0'/0'/0/0(Bitcoin coin type 0) - Testnet:
m/84'/1'/0'/0/0(Bitcoin testnet coin type 1)
Address Format:
- Mainnet:
bc1q...(Native SegWit P2WPKH) - Testnet:
tb1q...(Native SegWit P2WPKH)
Capabilities:
- Full Bitcoin L1 transaction support (send BTC)
- Balance and UTXO queries via mempool.space API
- Fee estimation (fast/medium/slow)
- P2WPKH (native SegWit) transactions for optimal fees
Example:
Both addresses are derived from the same recovery phrase, making it easy to manage both Layer 1 (Bitcoin) and Layer 2 (Stacks) assets.
Available Tools (350+ total)
Wallet Management
Bitcoin L1
Mempool Watch (Bitcoin)
Bitcoin Inscriptions
PSBT & Ordinals Trading
Message Signing
Wallet & Balance
STX Transfers
sBTC Operations
Token Operations (SIP-010)
NFT Operations (SIP-009)
Stacking / PoX
BNS Domains (V1 + V2)
Smart Contracts
DeFi - ALEX DEX (Mainnet)
Uses the official alex-sdk for swap operations. Supports simple token symbols like "STX", "ALEX".
DeFi - Zest Protocol (Mainnet)
Supports 10 assets: sBTC, aeUSDC, stSTX, wSTX, USDH, sUSDT, USDA, DIKO, ALEX, stSTX-BTC
DeFi - Bitflow DEX (Mainnet)
DEX aggregator that routes trades across multiple liquidity sources.
Units: Bitflow tools default to human units (
amountUnit: "human"). Pass"2"to swap 2 STX, not"2000000". SetamountUnit: "base"only when working with raw on-chain integers. See Units & Decimals guide for details and common pitfalls.
Pillar Smart Wallet
sBTC smart wallet with Zest Protocol integration and passkey authentication.
For autonomous agents, use pillar_direct_* tools (no browser needed).
Blockchain Queries
Yield Hunter (Autonomous)
x402 API Endpoints
TaskMarket (Work Marketplace on Base)
Read-only discovery of onchain agent work on TaskMarket (USDC escrow on Base). The tools are public and anonymous: no wallet, no spend.
Inbox Messaging (aibtc.com)
Usage Examples
Wallet management:
"What's your wallet address?" "Create a wallet for yourself" "Unlock your wallet" "Keep your wallet unlocked for 1 hour"
Check balances:
"How much STX do you have?" "What's your sBTC balance?"
Transfer tokens:
"Send 2 STX to ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM" "Transfer 0.001 sBTC to muneeb.btc"
NFTs:
"What NFTs do you own?" "Send this NFT to alice.btc"
BNS domains:
"What address is satoshi.btc?" "Is myname.btc available?"
DeFi trading (mainnet):
"What pools are available on ALEX?" "Swap 0.1 STX for ALEX" "Get a quote for 100 STX to ALEX" "What assets can I lend on Zest?" "Supply 100 stSTX to Zest" "Borrow 50 aeUSDC from Zest" "Check my Zest position"
x402 endpoints:
"Get trending liquidity pools" "Tell me a dad joke"
Supported Tokens
Well-known tokens can be referenced by symbol:
- sBTC - Native Bitcoin on Stacks
- USDCx - USD Coin on Stacks
- ALEX - ALEX governance token
- wSTX - Wrapped STX
ALEX DEX tokens: STX, ALEX, and any token from alex_list_pools
Zest Protocol assets: sBTC, aeUSDC, stSTX, wSTX, USDH, sUSDT, USDA, DIKO, ALEX, stSTX-BTC
Or use any SIP-010 token by contract ID: SP2X...::token-name
Configuration
Note on NETWORK: The --install command writes NETWORK=mainnet by default (pass --testnet to use testnet). If you omit NETWORK from your config entirely, the runtime fallback is also mainnet.
Note on spending limits: A default-on safety rail meters every STX, sBTC and BTC spend (transfers, contract calls, sponsored transactions, x402/L402 auto-payments, Bitcoin broadcasts, psbt_sign) against a cumulative per-session and per-day cap, so a single bad instruction or a malicious endpoint can't drain the wallet. A spend over the cap is blocked before it is signed or broadcast, and the agent is told to ask you. Raise the caps via the env vars above, or disable with SPEND_LIMIT_ENABLED=false. The limit runs inside the server: it does not contain an agent with shell access to your machine, so keep spend tools out of your client's auto-approve list. See SECURITY.md.
Note: CLIENT_MNEMONIC is optional. The recommended approach is to let Claude create its own wallet. HIRO_API_KEY is optional but recommended for production use — without it, you may hit Hiro's public rate limits (429 responses). Get a key at platform.hiro.so.
Note on Hiro rate limits: without a key, Hiro allowed 20 requests per second and 50 per minute per client when measured on 2026-10-23 (response headers below). The per-minute budget is the one an agent usually exhausts first. A single tool call can make several Hiro requests, so 50 a minute goes quickly in a busy session. Every Hiro response reports both budgets, so you can check the current values yourself:
On a 429 the server waits for Retry-After (60s if Hiro sends none, and at least 1s, 2s, then 4s) and retries up to three times before surfacing a rate-limit error (src/services/hiro-api.ts). Retrying before that time just returns another 429. Hiro can change these limits, so treat the numbers as a snapshot and the headers as the source of truth.
Architecture
Security Notes
- Claude's wallet is stored encrypted on YOUR machine
- Password is never stored - only the encrypted keystore
- Mnemonics shown only once at creation
- Auto-lock after 15 minutes (configurable)
- Transactions signed locally before broadcast
- Spending limit (default-on): outbound spends are capped per session and per day so a single bad instruction can't drain the wallet — see Configuration
- Secret-scanning pre-commit hook: contributors get a hook (auto-installed via
npm install) that blocks committing a seed phrase or private key - For mainnet: Fund with small amounts first
See SECURITY.md for the full wallet-key protection model and key-leak recovery steps.
Advanced: Pre-configured Mnemonic
For automated setups where Claude needs immediate wallet access, add the CLIENT_MNEMONIC environment variable to your MCP server config (in ~/.claude.json for Claude Code, or claude_desktop_config.json for Claude Desktop):
This bypasses the wallet creation flow - Claude has immediate access to transact.
Agent Skill
This package includes an Agent Skills compatible skill that teaches any LLM how to use the Bitcoin wallet capabilities effectively.
What is it?
The aibtc-bitcoin-wallet skill provides:
- Structured workflows for Bitcoin L1 operations (balance, send, fees)
- Reference guides for Pillar smart wallets and Stacks L2 DeFi
- LLM-agnostic instructions that work with Claude Code, Cursor, Codex, and 20+ other tools
Using the Skill
The skill is automatically included when you install the MCP server. Find it at:
- Local:
node_modules/@aibtc/mcp-server/skill/SKILL.md - ClawHub: clawhub.ai/skills - search for
aibtc-bitcoin-wallet
Skill Structure
Development
Releases
This repo uses Release Please for automated releases:
- Merge PRs with conventional commits (
feat:,fix:, etc.) - Release Please creates a Release PR with changelog
- Merge the Release PR to publish
Repository Secrets (Maintainers)
To obtain a ClawHub API token, visit clawhub.ai and create an account.
License
MIT
Source: README.md at commit 1a122e6
Tools
0Version history
1- v1.17.0LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.