Logo van stx402-agent

stx402-agent

Organisatie
aibtcdev

Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg, NFTs, and x402 payments.

Uitgeveraibtcdev
Repositoryaibtc-mcp-server
TaalTypeScript
Forks
47
Sterren
10
Beschikbare tools
66
Transporttypestdio
Categorieën
Links
  • Koppel tools aan AI-workflows

    stx402-agent biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 66 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    10 sterren en 47 forks in de gekoppelde repository.

@aibtc/mcp-server

npm version License: MIT

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)

bash
npx @aibtc/mcp-server@latest --install

That's it! This automatically configures Claude Code. Restart your terminal and start chatting.

Claude Desktop (App)

bash
npx @aibtc/mcp-server@latest --install --desktop

This detects your OS and writes to the correct Claude Desktop config file:

OSConfig Path
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Linux~/.config/Claude/claude_desktop_config.json
Windows%APPDATA%/Claude/claude_desktop_config.json

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:

bash
npx @aibtc/mcp-server@latest --install --cursor     # Cursor
npx @aibtc/mcp-server@latest --install --windsurf   # Windsurf
npx @aibtc/mcp-server@latest --install --gemini     # Gemini CLI
npx @aibtc/mcp-server@latest --install --codex      # OpenAI Codex CLI
npx @aibtc/mcp-server@latest --install --vscode     # VS Code (writes ./.vscode/mcp.json)
FlagClientConfig written
(none)Claude Code~/.claude.json
--desktopClaude Desktopclaude_desktop_config.json (see path table above)
--cursorCursor~/.cursor/mcp.json
--windsurfWindsurf~/.codeium/windsurf/mcp_config.json
--geminiGemini CLI~/.gemini/settings.json
--codexOpenAI Codex CLI~/.codex/config.toml
--vscodeVS Code (Copilot agent)./.vscode/mcp.json (project-scoped)

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.

bash
export OPENROUTER_API_KEY=sk-or-...
npx @aibtc/mcp-server@latest bridge "what's the STX balance of SP3...?"

Safety flags (this server moves real funds, so the bridge defaults to nothing extra and lets you constrain it):

FlagEffect
--read-onlyExpose only read-only tools (no transfer/swap/deploy/etc.)
--allow a,bForce-allow specific tool names (added to the set)
--block a,bForce-remove specific tool names (wins over --allow)
--max-spend-ustx <n> / --max-spend-sats <n>Cap spend via the server's spend-limit rail (enforced before signing)
--list-toolsPrint the exposed tool set and exit (no API key needed)
--model <id>OpenRouter model (default anthropic/claude-3.5-haiku)
--network <net>mainnet or testnet (default mainnet)
--max-turns <n>Tool-call loop cap (default 10)
bash
# Preview what a read-only session would expose, no key needed:
npx @aibtc/mcp-server@latest bridge --read-only --list-tools

# Read-only chat, plus one explicitly allowed write tool:
npx @aibtc/mcp-server@latest bridge --read-only --allow transfer_stx "send 1 STX to SP3..."

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:

bash
npx @aibtc/mcp-server@latest --install --testnet            # Claude Code, testnet
npx @aibtc/mcp-server@latest --install --cursor --testnet   # Cursor, testnet

Why npx? Using npx @aibtc/mcp-server@latest ensures you always get the newest version automatically. Global installs (npm install -g) won't auto-update.

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:

json
{
  "mcpServers": {
    "aibtc": {
      "command": "npx",
      "args": ["-y", "@aibtc/mcp-server@latest"],
      "env": {
        "NETWORK": "mainnet"
      }
    }
  }
}

VS Code (.vscode/mcp.json) — uses a servers key and a typed entry:

json
{
  "servers": {
    "aibtc": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@aibtc/mcp-server@latest"],
      "env": { "NETWORK": "mainnet" }
    }
  }
}

OpenAI Codex CLI (~/.codex/config.toml) — TOML, not JSON:

toml
[mcp_servers.aibtc]
command = "npx"
args = ["-y", "@aibtc/mcp-server@latest"]

[mcp_servers.aibtc.env]
NETWORK = "mainnet"

Zed (settings.json) — uses a context_servers key:

json
{
  "context_servers": {
    "aibtc": {
      "source": "custom",
      "command": "npx",
      "args": ["-y", "@aibtc/mcp-server@latest"],
      "env": { "NETWORK": "mainnet" }
    }
  }
}

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@latest over stdio with NETWORK in the env.

Giving Claude a Wallet

When you first use @aibtc/mcp-server, Claude doesn't have a wallet. Here's the smooth onboarding flow:

Example Conversation

You: What's your wallet address?

Claude: I don't have a wallet yet. Would you like to assign me one?
        I can either create a fresh wallet or you can import an existing one.

You: Create a new wallet called "agent-wallet"

Claude: What password should I use to protect the wallet?

You: use "secure123password"

Claude: I now have a wallet! My address is ST1ABC...XYZ

        IMPORTANT: Please save this recovery phrase securely:
        "word1 word2 word3 ... word24"

        This phrase will NOT be shown again. It's the only way to recover
        the wallet if the password is forgotten.

You: Send 10 STX to ST2DEF...

Claude: Done! I've sent 10 STX to ST2DEF...
        Transaction: 0x123...

Wallet States

StateWhat Claude SaysWhat To Do
No wallet"I don't have a wallet yet"Use wallet_create or wallet_import
Locked"My wallet is locked"Use wallet_unlock with password
Ready"My address is ST..."Claude can perform transactions

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_lock to manually lock the wallet
  • Use wallet_unlock when you need Claude to transact again

Wallet Storage

Claude's wallets are stored locally on your machine:

~/.aibtc/
├── wallets.json       # Wallet index (names, addresses - no secrets)
├── config.json        # Active wallet, settings
└── wallets/
    └── [wallet-id]/
        └── keystore.json  # Encrypted mnemonic (AES-256-GCM + Scrypt)

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:

You: Create a wallet called "my-wallet"
Claude: I've created a wallet with:
        Stacks address: ST1ABC...
        Bitcoin address: bc1q...

You: Send 50000 sats to bc1q...
Claude: Done! Transaction broadcast: abc123...

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

ToolDescription
wallet_createCreate a new wallet for Claude
wallet_importImport an existing wallet for Claude
wallet_unlockUnlock Claude's wallet
wallet_lockLock Claude's wallet
wallet_listList Claude's available wallets
wallet_switchSwitch Claude to a different wallet
wallet_deleteDelete a wallet
wallet_exportExport wallet mnemonic
wallet_statusCheck if Claude's wallet is ready (includes Stacks and Bitcoin addresses)
wallet_set_timeoutSet how long wallet stays unlocked

Bitcoin L1

ToolDescription
get_btc_balanceGet BTC balance (total, confirmed, unconfirmed)
get_btc_feesGet fee estimates (fast, medium, slow)
get_btc_utxosList UTXOs for an address
transfer_btcSend BTC to a recipient
get_cardinal_utxosUTXOs safe to spend (no inscriptions)
get_ordinal_utxosUTXOs containing inscriptions

Mempool Watch (Bitcoin)

ToolDescription
get_btc_mempool_infoGet current Bitcoin mempool statistics (tx count, vsize, fees, fee histogram)
get_btc_transaction_statusGet confirmation status and details for a Bitcoin transaction by txid
get_btc_address_txsGet recent transaction history for a Bitcoin address (last 25 transactions)

Bitcoin Inscriptions

ToolDescription
get_taproot_addressGet wallet's Taproot (P2TR) address
estimate_inscription_feeCalculate inscription cost
inscribeCreate inscription commit transaction
inscribe_revealComplete inscription reveal transaction
get_inscriptionFetch inscription content from reveal tx
get_inscriptions_by_addressList inscriptions owned by address

PSBT & Ordinals Trading

ToolDescription
psbt_create_ordinal_buyBuild a buyer-side PSBT for ordinal purchase
psbt_signSign selected PSBT inputs with active wallet keys
psbt_decodeDecode PSBT inputs/outputs/signature status
psbt_broadcastFinalize and broadcast a fully-signed PSBT

Message Signing

ToolDescription
sip018_signSign structured Clarity data (SIP-018)
sip018_verifyVerify SIP-018 signature
sip018_hashCompute SIP-018 hash without signing
stacks_sign_messageSign plain text (SIWS-compatible)
stacks_verify_messageVerify Stacks message signature
btc_sign_messageSign with Bitcoin key (BIP-137)
btc_verify_messageVerify BIP-137 signature

Wallet & Balance

ToolDescription
get_wallet_infoGet Claude's wallet addresses (Stacks + Bitcoin) and status
get_stx_balanceGet STX balance for any address
get_stx_feesGet STX fee estimates (low, medium, high)

STX Transfers

ToolDescription
transfer_stxSend STX to a recipient
broadcast_transactionBroadcast a pre-signed transaction

sBTC Operations

ToolDescription
sbtc_get_balanceGet sBTC balance
sbtc_transferSend sBTC
sbtc_initiate_withdrawalInitiate sBTC peg-out to BTC L1
sbtc_withdrawAlias for withdrawal initiation
sbtc_withdrawal_statusCheck withdrawal request status
sbtc_get_deposit_infoGet BTC deposit instructions
sbtc_depositBuild, sign, and broadcast BTC→sBTC deposit
sbtc_deposit_statusCheck deposit status via Emily API
sbtc_get_peg_infoGet peg ratio and TVL

Token Operations (SIP-010)

ToolDescription
get_token_balanceGet balance of any SIP-010 token
transfer_tokenSend any SIP-010 token
get_token_infoGet token metadata
list_user_tokensList tokens owned by an address
get_token_holdersGet top holders of a token

NFT Operations (SIP-009)

ToolDescription
get_nft_holdingsList NFTs owned by an address
get_nft_metadataGet NFT metadata
transfer_nftSend an NFT
get_nft_ownerGet NFT owner
get_collection_infoGet NFT collection details
get_nft_historyGet NFT transfer history

Stacking / PoX

ToolDescription
get_pox_infoCurrent PoX-5 cycle, burn height, prepare phase
get_stacking_statusLocked amount, signer manager, unlock height
list_stacking_signersSigner managers in the next cycle's signer set
stack_stxLock STX with a signer manager
extend_stackingExtend, increase, switch signer or payout (stake-update)
unstake_stxStop early; unlocks next cycle
get_stacking_rewardsUnclaimed sBTC rewards for a cycle
claim_stacking_rewardsClaim a cycle's rewards through the signer manager

BNS Domains (V1 + V2)

ToolDescription
lookup_bns_nameResolve .btc domain to address
reverse_bns_lookupGet .btc domain for an address
get_bns_infoGet domain details
check_bns_availabilityCheck if domain is available
get_bns_priceGet registration price
list_user_domainsList domains owned
preorder_bns_namePreorder a .btc domain (step 1 of 2)
register_bns_nameRegister a .btc domain (step 2 of 2)

Smart Contracts

ToolDescription
call_contractCall a smart contract function
deploy_contractDeploy a Clarity smart contract
get_transaction_statusCheck transaction status
call_read_only_functionCall read-only function

DeFi - ALEX DEX (Mainnet)

Uses the official alex-sdk for swap operations. Supports simple token symbols like "STX", "ALEX".

ToolDescription
alex_list_poolsDiscover all available trading pools
alex_get_swap_quoteGet expected output for a token swap
alex_swapExecute a token swap (SDK handles routing)
alex_get_pool_infoGet liquidity pool reserves

DeFi - Zest Protocol (Mainnet)

Supports 10 assets: sBTC, aeUSDC, stSTX, wSTX, USDH, sUSDT, USDA, DIKO, ALEX, stSTX-BTC

ToolDescription
zest_list_assetsList all supported lending assets
zest_get_positionGet user's supply/borrow position
zest_supplySupply assets to earn interest
zest_withdrawWithdraw supplied assets
zest_borrowBorrow against collateral
zest_repayRepay borrowed assets

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". Set amountUnit: "base" only when working with raw on-chain integers. See Units & Decimals guide for details and common pitfalls.

ToolDescription
bitflow_get_tickerGet market data (no API key needed)
bitflow_get_quoteGet swap quote
bitflow_swapExecute token swap

Pillar Smart Wallet

sBTC smart wallet with Zest Protocol integration and passkey authentication.

ToolDescription
pillar_connectConnect to Pillar wallet
pillar_sendSend sBTC to BNS names or addresses
pillar_boostCreate leveraged sBTC position
pillar_positionView wallet and Zest position

For autonomous agents, use pillar_direct_* tools (no browser needed).

Blockchain Queries

ToolDescription
get_account_infoGet account nonce, balance
get_account_transactionsList transaction history
get_block_infoGet block details
get_mempool_infoGet pending transactions
get_contract_infoGet contract ABI and source
get_contract_eventsGet contract event history
get_network_statusGet network health status

Yield Hunter (Autonomous)

ToolDescription
yield_hunter_startStart autonomous sBTC→Zest deposits
yield_hunter_stopStop yield hunting
yield_hunter_statusCheck yield hunter status
yield_hunter_configureAdjust threshold, reserve, interval

x402 API Endpoints

ToolDescription
list_x402_endpointsDiscover x402 endpoints
execute_x402_endpointExecute x402 endpoint with auto-payment
scaffold_x402_endpointGenerate x402 Cloudflare Worker project
scaffold_x402_ai_endpointGenerate x402 AI API with OpenRouter

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

Environment VariableDescriptionDefault
NETWORKmainnet or testnetmainnet
API_URLDefault x402 API base URLhttps://x402.biwas.xyz
CLIENT_MNEMONIC(Optional) Pre-configured mnemonic-
HIRO_API_KEY(Optional) Hiro API key for higher rate limits-
SPEND_LIMIT_ENABLEDSet false to disable the wallet spending limittrue
SPEND_LIMIT_DAILY_USTX / SPEND_LIMIT_SESSION_USTXSTX spend cap per day / per unlock (micro-STX)10000000 (10 STX)
SPEND_LIMIT_DAILY_SATS / SPEND_LIMIT_SESSION_SATSBTC spend cap per day / per unlock (sats)50000

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 outbound spend (transfer_stx, transfer_btc, x402/L402 auto-payments) 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 and reports the remaining budget. Raise the caps via the env vars above, or disable with SPEND_LIMIT_ENABLED=false. 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.

Architecture

You ←→ Claude ←→ aibtc-mcp-server
                        ↓
              Claude's Wallet (~/.aibtc/)
                        ↓
              ┌─────────┴─────────┐
              ↓                   ↓
        Hiro Stacks API    x402 Endpoints
              ↓                   ↓
        Stacks Blockchain  Paid API Services

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):

json
{
  "mcpServers": {
    "aibtc": {
      "command": "npx",
      "args": ["@aibtc/mcp-server@latest"],
      "env": {
        "CLIENT_MNEMONIC": "your twenty four word mnemonic phrase",
        "NETWORK": "testnet"
      }
    }
  }
}

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

skill/
├── SKILL.md                        # Bitcoin L1 core workflows
└── references/
    ├── at-stake.md                 # El Salvador prediction market & side legions
    ├── genesis-lifecycle.md        # Agent registration & check-in
    ├── inscription-workflow.md     # Bitcoin inscription guide
    ├── pillar-wallet.md            # Pillar smart wallet guide
    ├── stacks-defi.md              # Stacks L2 / DeFi operations
    ├── troubleshooting.md          # Common issues and solutions
    └── x402-inbox.md               # x402 inbox messaging

Development

bash
git clone https://github.com/aibtcdev/aibtc-mcp-server.git
cd aibtc-mcp-server
npm install
npm run build
npm run dev       # Run with tsx (development)

Releases

This repo uses Release Please for automated releases:

  1. Merge PRs with conventional commits (feat:, fix:, etc.)
  2. Release Please creates a Release PR with changelog
  3. Merge the Release PR to publish

Repository Secrets (Maintainers)

SecretDescription
NPM_TOKENnpm publish token for @aibtc scope
CLAWHUB_API_TOKENClawHub API token for skill publishing

To obtain a ClawHub API token, visit clawhub.ai and create an account.

License

MIT

Installatie

TypingMind
{
  "mcpServers": {
    "aibtc-mcp-server": {
      "command": "npx",
      "args": [
        "stx402-agent@latest"
      ]
    }
  }
}

Beschikbare tools

  • get_wallet_info

    Get the agent's wallet address and status. If the agent doesn't have a wallet yet, provides guidance on how to assign one.

  • get_stx_balance

    Get the STX balance for a wallet address.

  • wallet_create

    Create a new wallet for the agent with a generated BIP39 24-word mnemonic. The wallet is encrypted locally and stored in ~/.stx402/. IMPORTANT: Save the mnemonic securely - it will only be shown once!

  • wallet_import

    Import an existing wallet for the agent using a BIP39 mnemonic phrase. The wallet is encrypted locally and stored in ~/.stx402/.

  • wallet_unlock

    Unlock the agent's wallet to enable transactions. If no wallet ID is provided, unlocks the active wallet.

  • wallet_lock

    Lock the agent's wallet, clearing sensitive data from memory.

  • wallet_list

    List all wallets available for the agent to use.

  • wallet_switch

    Switch to a different wallet. Note: The new wallet will need to be unlocked before use.

  • wallet_delete

    Permanently delete a wallet. WARNING: This cannot be undone! Make sure you have backed up your mnemonic.

  • wallet_export

    Export the mnemonic phrase for a wallet. WARNING: Only use this in a secure environment! Anyone with the mnemonic can access your funds.

  • wallet_set_timeout

    Set how long the agent's wallet stays unlocked before automatically locking. Set to 0 to disable auto-lock.

  • wallet_status

    Get the agent's wallet status - whether it has a wallet, if it's unlocked, and what it can do.

  • transfer_stx

    Transfer STX tokens to a recipient address. Signs and broadcasts the transaction.

    Example: To send 2 STX, use amount "2000000" (micro-STX). 1 STX = 1,000,000 micro-STX

  • broadcast_transaction

    Broadcast a pre-signed Stacks transaction to the network.

  • call_contract

    Call a function on a Stacks smart contract. Signs and broadcasts the transaction.

    For typed arguments, use objects like {type: 'uint', value: 100} or {type: 'principal', value: 'SP...'}

  • deploy_contract

    Deploy a Clarity smart contract to the Stacks blockchain.

  • get_transaction_status

    Check the status of a Stacks transaction by its txid.

  • call_read_only_function

    Call a read-only function on a smart contract (no signing required).

  • sbtc_get_balance

    Get the sBTC balance for a wallet address.

  • sbtc_transfer

    Transfer sBTC tokens to a recipient address.

    sBTC uses 8 decimals (same as Bitcoin). Example: To send 0.001 sBTC, use amount "100000" (satoshis).

  • sbtc_get_deposit_info

    Get information about how to deposit BTC to receive sBTC.

  • sbtc_get_peg_info

    Get sBTC peg information including total supply and peg ratio.

  • get_token_balance

    Get the balance of any SIP-010 token for a wallet address.

    Supports well-known tokens by symbol: sBTC, USDCx, ALEX, DIKO Or use the full contract ID: address.contract-name

  • transfer_token

    Transfer any SIP-010 token to a recipient address.

    Supports well-known tokens by symbol: sBTC, USDCx, ALEX, DIKO Or use the full contract ID.

  • get_token_info

    Get metadata for a SIP-010 token (name, symbol, decimals, supply).

  • list_user_tokens

    List all fungible tokens owned by an address.

  • get_token_holders

    Get the top holders of a SIP-010 token.

  • get_nft_holdings

    List all NFTs owned by an address.

  • get_nft_metadata

    Get metadata for a specific NFT (SIP-016).

  • transfer_nft

    Transfer an NFT (SIP-009) to a recipient address.

  • get_nft_owner

    Get the current owner of a specific NFT.

  • get_collection_info

    Get information about an NFT collection.

  • get_nft_history

    Get the transfer history of NFTs in a collection.

  • get_pox_info

    Get current Proof of Transfer (PoX) cycle information.

  • get_stacking_status

    Check if an address is currently stacking STX.

  • stack_stx

    Lock STX for stacking to earn BTC rewards.

    Requires a Bitcoin address (hash) for receiving rewards.

  • extend_stacking

    Extend an existing stacking lock period.

  • lookup_bns_name

    Resolve a .btc domain name to its Stacks address.

  • reverse_bns_lookup

    Get the BNS domain names owned by an address.

  • get_bns_info

    Get detailed information about a BNS domain name.

  • check_bns_availability

    Check if a BNS domain name is available for registration.

  • get_bns_price

    Get the registration price for a BNS domain name.

  • list_user_domains

    List all BNS domains owned by an address.

  • get_account_info

    Get detailed account information including nonce and balance.

  • get_account_transactions

    Get transaction history for an account.

  • get_block_info

    Get information about a specific block.

  • get_mempool_info

    Get pending transactions in the mempool.

  • get_contract_info

    Get information about a smart contract including its ABI.

  • get_contract_events

    Get events emitted by a smart contract.

  • get_network_status

    Get the current status of the Stacks network.

  • list_x402_endpoints

    List known x402 API endpoints from x402.biwas.xyz and stx402.com.

    The agent can:

    1. Execute x402 endpoints from these sources (paid API calls with automatic payment handling)
    2. Execute direct Stacks transactions (transfer STX, call contracts, deploy contracts)

    Sources:

    • x402.biwas.xyz: DeFi analytics, market data, wallet analysis, Zest/ALEX protocols
    • stx402.com: AI services, cryptography, storage, utilities, agent registry
  • execute_x402_endpoint

    Execute an x402 API endpoint. Payment is handled automatically.

    Supported sources:

    • x402.biwas.xyz (default): Use path like "/api/pools/trending"
    • stx402.com: Use apiUrl="https://stx402.com" with path like "/api/ai/dad-joke"

    Use list_x402_endpoints to discover available endpoints.

  • alex_get_swap_quote

    Get a swap quote from ALEX DEX.

    Returns the expected output amount for swapping tokenX to tokenY. Use full contract IDs for tokens (e.g., 'SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.token-wstx-v2').

    Note: ALEX DEX is only available on mainnet.

  • alex_swap

    Execute a token swap on ALEX DEX.

    Swaps tokenX for tokenY using the ALEX AMM. Use full contract IDs for tokens.

    Note: ALEX DEX is only available on mainnet.

  • alex_get_pool_info

    Get liquidity pool information from ALEX DEX.

    Returns reserve balances and pool details for a token pair.

    Note: ALEX DEX is only available on mainnet.

  • alex_list_pools

    List all available trading pools on ALEX DEX.

    Discovers all token pairs that can be swapped directly. Returns pool ID, token pair, and factor (fee tier) for each pool.

    Use this to find which tokens can be swapped before calling alex_swap.

    Note: ALEX DEX is only available on mainnet.

  • zest_list_assets

    List all supported assets on Zest Protocol.

    Returns the list of assets that can be supplied, borrowed, or used as collateral. Each asset includes its symbol, name, and contract ID.

    Use this to discover available assets before supplying or borrowing.

    Note: Zest Protocol is only available on mainnet.

  • zest_get_position

    Get user's lending position on Zest Protocol.

    Returns supplied and borrowed amounts for a specific asset. You can use the asset symbol (e.g., 'stSTX') or full contract ID.

    Note: Zest Protocol is only available on mainnet.

  • zest_supply

    Supply assets to Zest Protocol lending pool.

    Deposits assets to earn interest from borrowers. You can use the asset symbol (e.g., 'stSTX') or full contract ID.

    Note: Zest Protocol is only available on mainnet.

  • zest_withdraw

    Withdraw assets from Zest Protocol lending pool.

    Redeems supplied assets plus earned interest. You can use the asset symbol (e.g., 'stSTX') or full contract ID.

    Note: Zest Protocol is only available on mainnet.

  • zest_borrow

    Borrow assets from Zest Protocol.

    Borrows assets against your supplied collateral. Ensure you have sufficient collateral to maintain a healthy position. You can use the asset symbol (e.g., 'aeUSDC') or full contract ID.

    Note: Zest Protocol is only available on mainnet.

  • zest_repay

    Repay borrowed assets to Zest Protocol.

    Repays borrowed assets plus accrued interest. You can use the asset symbol (e.g., 'aeUSDC') or full contract ID.

    Note: Zest Protocol is only available on mainnet.

  • scaffold_x402_endpoint

    Generate a complete Cloudflare Worker project with x402 payment integration.

    Creates a ready-to-deploy Hono.js application that accepts payments in STX, sBTC, or USDCx.

    Output Files

    • src/index.ts - Hono app with x402-protected endpoints
    • src/x402-middleware.ts - Payment verification middleware
    • wrangler.jsonc - Cloudflare Worker configuration
    • package.json - Dependencies and scripts
    • tsconfig.json - TypeScript configuration
    • .env.example - Environment variable template
    • .gitignore - Standard ignores
    • README.md - Documentation

    After Generation

    1. cd into the project directory
    2. Run: npm install
    3. Copy .env.example to .env and add Cloudflare credentials
    4. Set recipient address as secret: wrangler secret put RECIPIENT_ADDRESS
    5. Run: npm run dev (local development)
    6. Run: npm run deploy (deploy to Cloudflare)

    Payment Flow

    The generated endpoints implement the x402 payment protocol:

    1. Client requests endpoint without payment → receives 402 with payment requirem
  • scaffold_x402_ai_endpoint

    Generate a complete Cloudflare Worker project with x402 payment + OpenRouter AI integration.

    Creates a ready-to-deploy Hono.js application that:

    • Accepts payments in STX, sBTC, or USDCx
    • Calls OpenRouter AI models (Claude, GPT-4, Llama, etc.)
    • Returns AI-generated responses after payment

    AI Types

    • chat: General chat/Q&A endpoint
    • completion: Text completion/continuation
    • summarize: Summarize provided text
    • translate: Translate text to target language
    • custom: Custom system prompt

    Output Files

    • src/index.ts - Hono app with x402-protected AI endpoints
    • src/x402-middleware.ts - Payment verification middleware
    • src/openrouter.ts - OpenRouter API client
    • wrangler.jsonc - Cloudflare Worker configuration
    • package.json, tsconfig.json, .env.example, README.md

    After Generation

    1. cd into the project directory
    2. npm install
    3. Set secrets: wrangler secret put RECIPIENT_ADDRESS
    4. Set secrets: wrangler secret put OPENROUTER_API_KEY
    5. For local dev
  • openrouter_integration_guide

    Get OpenRouter integration examples and code patterns for implementing AI features.

    Use this tool when you need to add AI capabilities to any project. Returns:

    • Code examples for different environments (Node.js, Cloudflare Workers, browser)
    • API patterns and best practices
    • Model recommendations
    • Error handling patterns

    This is a reference tool - use the returned code as a template for implementation.

  • openrouter_models

    Get list of popular OpenRouter models with capabilities and context lengths.

    Use this to choose the right model for your use case. For latest pricing, check openrouter.ai/models

Gebruik stx402-agent MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra stx402-agent is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg stx402-agent toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van stx402-agent.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "aibtc-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "stx402-agent"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van stx402-agent in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van stx402-agent in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je stx402-agent gebruiken om me hiermee te helpen?
stx402-agent
Zeker. Ik heb het gelezen.
Dit vond ik met stx402-agent.

Veelgestelde vragen

Waarvoor wordt de MCP-server stx402-agent gebruikt?

stx402-agent is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik stx402-agent MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je stx402-agent gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom stx402-agent MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als stx402-agent verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik stx402-agent MCP met TypingMind?

stx402-agent werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt stx402-agent MCP in TypingMind?

stx402-agent biedt 66 MCP-tools die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om stx402-agent MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als stx402-agent authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇