The WdkMcpServer extends McpServer from the official @modelcontextprotocol/sdk with WDK-specific capabilities. All standard MCP server features are available.
Wallet Configuration
Enable WDK
server.useWdk({seed:process.env.WDK_SEED})
The seed is a BIP-39 mnemonic phrase used for key derivation across all registered blockchains.
Never hardcode seed phrases in source code. Use environment variables or a secrets manager. The setup wizard generates a gitignored .vscode/mcp.json for local development.
Register Wallets
Register a wallet module for each blockchain you want to support:
importWalletManagerEvmfrom'@tetherto/wdk-wallet-evm'importWalletManagerBtcfrom'@tetherto/wdk-wallet-btc'importWalletManagerSolanafrom'@tetherto/wdk-wallet-solana'// EVM chains - one module handles all EVM networksserver.registerWallet('ethereum',WalletManagerEvm,{provider:'https://eth-mainnet.g.alchemy.com/v2/KEY'})server.registerWallet('polygon',WalletManagerEvm,{provider:'https://polygon-rpc.com'})// Bitcoinserver.registerWallet('bitcoin',WalletManagerBtc,{network:'bitcoin',host:'electrum.blockstream.info',port:50001})// Solanaserver.registerWallet('solana',WalletManagerSolana,{provider:'https://api.mainnet-beta.solana.com'})
Each registerWallet() call registers the chain name and makes it available to all wallet tools. For configuration details of each wallet module, see the Wallet Modules documentation.
Capabilities
Enable optional capabilities before registering their tools:
Fetches live prices from Bitfinex. No API key needed.
Indexer
Enables querying token balances and transfer history for any address. Requires an API key.
Protocols
DeFi protocols are registered per-chain:
Token Management
Default Tokens
USDT is auto-registered for supported chains via DEFAULT_TOKENS. You can query what's available:
Custom Tokens
Register additional tokens with registerToken():
Registered tokens are available to all tools that accept a token parameter (getTokenBalance, transfer, quoteTransfer, swap, etc.).
Tool Registration
Built-in Tool Arrays
Each category exports three arrays for fine-grained control:
Export
Contents
WALLET_TOOLS
All 11 wallet tools
WALLET_READ_TOOLS
7 read-only wallet tools
WALLET_WRITE_TOOLS
4 wallet tools that modify state
PRICING_TOOLS
All 2 pricing tools
INDEXER_TOOLS
All 2 indexer tools
SWAP_TOOLS
All 2 swap tools
SWAP_READ_TOOLS
1 read-only swap tool
SWAP_WRITE_TOOLS
1 swap tool that modifies state
BRIDGE_TOOLS
All 2 bridge tools
BRIDGE_READ_TOOLS
1 read-only bridge tool
BRIDGE_WRITE_TOOLS
1 bridge tool that modifies state
LENDING_TOOLS
All 8 lending tools
LENDING_READ_TOOLS
4 read-only lending tools
LENDING_WRITE_TOOLS
4 lending tools that modify state
FIAT_TOOLS
All 8 fiat tools
FIAT_READ_TOOLS
6 read-only fiat tools
FIAT_WRITE_TOOLS
2 fiat tools that modify state
Read-Only Mode
To allow an AI agent to query data without the ability to make transactions:
Individual Tool Registration
You can also import and register tools individually:
Custom Tools
Add your own MCP tools alongside the built-in ones using the standard registerTool() method (inherited from McpServer). See the MCP SDK tools documentation for full details.
Environment Variables
Variable
Required
Description
WDK_SEED
Yes
BIP-39 mnemonic for wallet key derivation
WDK_INDEXER_API_KEY
No
API key for WDK Indexer
MOONPAY_API_KEY
No
API key for MoonPay fiat on/off-ramp
MOONPAY_SECRET_KEY
No
Secret key for MoonPay
Security Checklist
Self-custodial wallets require careful key management. Follow these guidelines to protect user funds.
Need Help?
Discord Community
Connect with developers, ask questions, share your projects