Haiku DeFi MCP
OfficialServer Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| HAIKU_API_KEY | No | Your Haiku API key for higher rate limits. Contact contact@haiku.trade to request one. | |
| HAIKU_BASE_URL | No | API base URL. Defaults to https://api.haiku.trade/v1 | https://api.haiku.trade/v1 |
| RPC_URL_{chainId} | No | Override RPC URL for a specific chain (e.g., RPC_URL_42161 for Arbitrum). | |
| WALLET_PRIVATE_KEY | No | Private key (0x hex) for self-contained execution via haiku_execute. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| haiku_get_tokensA | Get supported tokens and DeFi positions for trading. Includes vanilla tokens, Aave collateral/debt, yield vaults, and LP tokens. Use category filter to narrow results (e.g., 'collateral' for Aave aTokens). Returns token IIDs (unique identifiers), symbols, names, prices, and chain information. Use the IID format (chainSlug:tokenAddress) when specifying tokens in other tools. |
| haiku_get_balancesA | Get token balances for a wallet address. By default fetches across all supported chains. Pass chainIds for a partial refresh — only the specified chains are queried, which is faster and useful after a swap when you only need updated balances for the source and destination chains. Returns balances, USD prices, total portfolio value, and categorized positions (tokens, collateral, debt, vaults). walletAddress is optional when WALLET_PRIVATE_KEY is set in the environment. |
| haiku_get_quoteA | Get a quote for a token swap or portfolio rebalance. Returns expected outputs, fees, gas estimates, and any required approvals. When signatures are required (Permit2 or bridge), EIP-712 signing payloads are included in the response. Two execution paths after getting a quote: • Path A — Self-contained (WALLET_PRIVATE_KEY set): call haiku_execute with quoteId, sourceChainId, permit2SigningPayload + bridgeSigningPayload (if present in this response), and approvals. Haiku signs and broadcasts automatically — returns tx hash. • Path B — External wallet (wallet MCP, broadcast: false required): (1) broadcast any approvals {to, data} via wallet MCP first; (2) call haiku_prepare_signatures with quoteId if signatures are needed → sign via wallet MCP; (3) call haiku_execute with quoteId, sourceChainId, signatures, and broadcast: false → returns { transaction: { to, data, value, chainId } } → broadcast transaction via wallet MCP. |
| haiku_prepare_signaturesA | External wallet signing path — use this instead of passing signing payloads directly to haiku_execute when WALLET_PRIVATE_KEY is not set or when a wallet MCP (Coinbase Payments MCP, wallet-agent, etc.) handles signing. Extracts and normalizes the EIP-712 payloads from a quote into a standard format any wallet's signTypedData can consume. Pass quoteId (preferred) — the server resolves the full quote from session cache. Alternatively pass the full quoteResponse object if quoteId is unavailable. After signing externally, pass permit2Signature and/or userSignature to haiku_execute. |
| haiku_discover_yieldsA | Discover yield-bearing opportunities across DeFi protocols. Returns APY, TVL, risk parameters, and token IIDs ready for haiku_get_quote. Use this to answer questions like 'best lending yields on Arbitrum', 'highest APY vaults with at least $1M TVL', or 'what can I do with USDC on BNB Chain'. The iid field in results can be used directly as a targetWeight key in haiku_get_quote. |
| haiku_analyze_portfolioA | Analyze a wallet's DeFi portfolio and surface relevant yield opportunities. Returns current positions enriched with available APY options, collateral health factors, and context-specific opportunities based on what the wallet actually holds. Use this when a user asks what they should do with their portfolio or wants yield optimization advice. Pair the output with haiku_discover_yields for broader market context, then use haiku_get_quote to execute. |
| haiku_executeA | Execute a quote. Call haiku_get_quote first, then choose a path: • Path A — Self-contained (WALLET_PRIVATE_KEY set): pass quoteId, sourceChainId, permit2SigningPayload + bridgeSigningPayload (if present in the quote), and approvals. Haiku signs Permit2/bridge internally, sends any approvals on-chain, and broadcasts. Returns tx hash. • Path B — External wallet (no WALLET_PRIVATE_KEY): broadcast: false is required. First broadcast any approvals from the quote via your wallet MCP (each is a {to, data} transaction). Then call haiku_prepare_signatures if signatures are needed → sign via wallet MCP → call haiku_execute with quoteId, sourceChainId, the signatures, and broadcast: false. Returns { transaction: { to, data, value, chainId } } — broadcast transaction via your wallet MCP. Always pass sourceChainId from the quote response. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Haiku-Trading/haiku-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server