githubEdit

wrenchConfiguration

Configure wallets, capabilities, tokens, protocols, and custom tools

Server Setup

Create a server with a name and version:

import { WdkMcpServer } from '@tetherto/wdk-mcp-toolkit'

const server = new WdkMcpServer('my-server', '1.0.0')

The WdkMcpServer extends McpServer from the official @modelcontextprotocol/sdkarrow-up-right 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.

triangle-exclamation

Register Wallets

Register a wallet module for each blockchain you want to support:

import WalletManagerEvm from '@tetherto/wdk-wallet-evm'
import WalletManagerBtc from '@tetherto/wdk-wallet-btc'
import WalletManagerSolana from '@tetherto/wdk-wallet-solana'

// EVM chains - one module handles all EVM networks
server.registerWallet('ethereum', WalletManagerEvm, {
  provider: 'https://eth-mainnet.g.alchemy.com/v2/KEY'
})
server.registerWallet('polygon', WalletManagerEvm, {
  provider: 'https://polygon-rpc.com'
})

// Bitcoin
server.registerWallet('bitcoin', WalletManagerBtc, {
  network: 'bitcoin',
  host: 'electrum.blockstream.info',
  port: 50001
})

// Solana
server.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:

Capability
Method
Requirement
Unlocks

Pricing

server.usePricing()

None

PRICING_TOOLS (2 tools)

Indexer

server.useIndexer({ apiKey })

INDEXER_TOOLS (2 tools)

Swap

server.registerProtocol(chain, label, SwapProtocol)

Swap module installed

SWAP_TOOLS (2 tools)

Bridge

server.registerProtocol(chain, label, BridgeProtocol)

Bridge module installed

BRIDGE_TOOLS (2 tools)

Lending

server.registerProtocol(chain, label, LendingProtocol)

Lending module installed

LENDING_TOOLS (8 tools)

Fiat

server.registerProtocol(chain, label, FiatProtocol, config)

Fiat module installed

FIAT_TOOLS (8 tools)

Pricing

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 documentationarrow-up-right 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

triangle-exclamation

Need Help?