
Haiku DeFi MCP
io.github.Haiku-TradingPublished by GitHub account Haiku-Tradingv0.0.8Updated Oct 25, 2026
DeFi execution for AI agents — swap, lend, bridge, and yield across 22 chains.
Overview
A local MCP server that lets an AI assistant quote, sign and execute DeFi swaps, bridges and yield moves across 22 EVM chains via the Haiku API.
- What you can do
- Discover supported tokens and DeFi assets, filtered by chain or category, and read wallet balances across chains and analyze a wallet's DeFi portfolio with yield options and health factors. Find yield opportunities ranked by APY or TVL, filtered by network, category, minimum APY and minimum TVL. Get swap or portfolio-rebalance quotes with slippage and target weights. Extract EIP-712 Permit2 and bridge signing payloads for an external wallet to sign. Execute a quote either self-contained with a private key or by returning an unsigned transaction for a separate wallet tool to broadcast.
- When to use it
- Use it when an assistant should help with on-chain DeFi work: checking balances, comparing yields, rebalancing a portfolio, or preparing and executing swaps and cross-chain bridges on supported EVM networks.
- Requirements
- Runs locally via npx with Node.js, over stdio or an optional HTTP mode. Network access to the Haiku API. An optional HAIKU_API_KEY raises rate limits; optional WALLET_PRIVATE_KEY enables self-contained execution; optional RPC_URL_{chainId} overrides chain RPC endpoints. Without a private key, a wallet address and receiver must be supplied and a separate wallet tool handles signing and broadcasting.
Installation
In SourceWeft
- Open Haiku DeFi MCP 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
Haiku MCP Server
An MCP (Model Context Protocol) server that enables AI agents to execute blockchain transactions via the Haiku API.
Features
- Token Discovery: List supported tokens and DeFi assets across 21 blockchain networks
- Balance Checking: Get wallet balances across all supported chains
- Trading Quotes: Get quotes for swaps and portfolio rebalancing
- Transaction Building: Convert quotes to unsigned EVM transactions
- Wallet Integration: Extract EIP-712 payloads for external wallet signing (Coinbase, AgentKit, Safe, etc.)
- Self-Contained Execution: Optional end-to-end execution with WALLET_PRIVATE_KEY env var
- Yield Discovery: Find the highest-yielding DeFi opportunities across protocols and chains, filtered by APY, TVL, and category
- Portfolio Analysis: Analyze a wallet's holdings and surface context-specific yield opportunities based on what it actually holds
Installation
Or run directly with npx:
Configuration
Environment Variables
Note: The API works without a key, but providing one unlocks higher rate limits for production use.
Claude Desktop Configuration
Add to your claude_desktop_config.json:
With API key for higher rate limits:
Available Tools
haiku_get_tokens
Get supported tokens and DeFi assets for trading.
Parameters:
network(optional): Filter by chain ID (e.g., 42161 for Arbitrum)category(optional): Filter by token category:token- Vanilla tokens (ETH, USDC, etc.)collateral- eg. Aave aTokens (deposited collateral)varDebt- eg. Aave variable debt tokensvault- eg. Yearn/Morpho yield vaultsweightedLiquidity- eg. Balancer LP tokensconcentratedLiquidity- eg. Uniswap V3 LP positions
Example:
haiku_get_balances
Get token balances for a wallet address across all chains.
Parameters:
walletAddress(optional): Wallet address or ENS name. Required whenWALLET_PRIVATE_KEYis not set; omit to auto-derive fromWALLET_PRIVATE_KEYwhen it is set.
Example:
Omit walletAddress when WALLET_PRIVATE_KEY is set to use the derived address.
haiku_get_quote
Get a quote for a token swap or portfolio rebalance.
Note: Quotes are valid for 5 minutes, but execute as quickly as possible after quoting — the longer you wait, the more likely prices have moved and the transaction will fail on-chain.
Parameters:
inputPositions(required): Map of token IID to amount to spendtargetWeights(required): Map of output token IID to weight (must sum to 1)slippage(optional): Max slippage as decimal (default: 0.003)receiver: Receiving wallet address. Required whenWALLET_PRIVATE_KEYis not set — must be provided explicitly. WhenWALLET_PRIVATE_KEYis set, auto-derived if omitted. WhenWALLET_PRIVATE_KEYis not set (Path B), you must passreceiverexplicitly.
Example:
Example above omits receiver (valid when WALLET_PRIVATE_KEY is set). For Path B, include "receiver": "0x...".
haiku_prepare_signatures
Extract and normalize EIP-712 signing payloads from a quote for external wallet signing (Path B only). When using quoteId, the quote must have been obtained in the same session.
Use this when a wallet MCP handles signing (Coinbase Payments MCP, wallet-agent, AgentKit, Safe, etc.). Returns standardized typed data that any wallet's signTypedData can consume, plus step-by-step instructions.
Parameters:
quoteId(preferred): Quote ID fromhaiku_get_quote— server resolves the full quote from session cache. QuoteId only works when the quote was returned byhaiku_get_quotein the same MCP session; otherwise usequoteResponse.quoteResponse(fallback): Full response object fromhaiku_get_quote, if quoteId is unavailable
Returns:
requiresPermit2: Whether Permit2 signature is neededpermit2: EIP-712 payload to pass tosignTypedData(if required)requiresBridgeSignature: Whether bridge signature is neededbridgeIntent: EIP-712 payload to pass tosignTypedData(if required)sourceChainId: Chain ID for the transactioninstructions: Step-by-step instructions for completing the flow
Example:
haiku_discover_yields
Discover yield-bearing opportunities across DeFi protocols, ranked by APY or TVL.
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 Base". The iid field in results
can be used directly as a key in the targetWeights object in haiku_get_quote.
Parameters:
network(optional): Filter by chain ID (e.g., 42161 for Arbitrum)category(optional):lending(Aave collateral),vault(Yearn/Morpho),lp(Balancer/Uniswap),all(default)minApy(optional): Minimum APY as a percentage (e.g.,5means ≥5% APY)minTvl(optional): Minimum TVL in USD (e.g.,1000000means ≥$1M). Filters to established mainstream vaults.sortBy(optional):apy(default) ortvl, descendinglimit(optional): Max results (default 20)
Example:
haiku_analyze_portfolio
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. Pair with
haiku_discover_yields for broader market context, then use haiku_get_quote to execute.
Parameters:
walletAddress(required): Wallet address (0x...) to analyze
Example:
haiku_execute
Execute a quote. Two distinct paths depending on who holds the private key.
Path A — Self-contained (WALLET_PRIVATE_KEY set in env): Haiku signs Permit2/bridge payloads internally and broadcasts. Returns a tx hash.
Parameters:
quoteId(required): Quote ID fromhaiku_get_quotesourceChainId(recommended): Chain ID from the quote response. Omit only if the quote was obtained in the same session — the server can recover from cache.permit2SigningPayload(optional): Pass through fromhaiku_get_quoteif presentbridgeSigningPayload(optional): Pass through fromhaiku_get_quoteif present (cross-chain only)approvals(optional): Pass through fromhaiku_get_quoteif present
Example:
Path B — External wallet (no WALLET_PRIVATE_KEY, using a wallet MCP): You sign and broadcast. broadcast: false is required — without WALLET_PRIVATE_KEY, haiku cannot sign or send the final EVM transaction. If you call haiku_execute with broadcast: true and no WALLET_PRIVATE_KEY, the server returns an error directing you to set broadcast: false and broadcast the returned transaction via your wallet MCP.
Before calling haiku_execute:
- If
approvalsis non-empty in the quote: broadcast each approval as a transaction{ to, data, value }(includevaluewhen present, e.g. for native token) via your wallet MCP and wait for confirmation. - If signatures are required: call
haiku_prepare_signatureswith the quoteId, sign the returned EIP-712 payloads via your wallet MCP, then pass the signatures here.
Parameters:
quoteId(required): Quote ID fromhaiku_get_quotesourceChainId(recommended): Chain ID from the quote response. Omit only if the quote was obtained in the same session — the server can recover from cache.broadcast(required): Must befalse— haiku returns the unsigned tx for you to broadcastpermit2Signature(optional): Signature from signing the Permit2 payload via your wallet MCPuserSignature(optional): Signature from signing the bridge payload via your wallet MCP (cross-chain only)
Example:
Returns { transaction: { to, data, value, chainId } } — pass transaction to your wallet MCP's sendTransaction.
Token IID Format
Tokens are identified using the IID format: chainSlug:tokenAddress
Examples:
arb:0x82aF49447D8a07e3bd95BD0d56f35241523fBab1- WETH on Arbitrumarb:0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee- Native ETH on Arbitrumbase:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913- USDC on Base
Supported Chains
Workflow Examples
Path A: Self-Contained Swap (WALLET_PRIVATE_KEY set)
Haiku handles all signing and broadcasting. Returns a tx hash.
Path B: External Wallet (wallet MCP handles signing + broadcasting)
Use when WALLET_PRIVATE_KEY is not set and a separate wallet MCP holds the keys.
Simple swap (no Permit2 or bridge signatures needed, e.g. native ETH input):
With Permit2 or bridge signatures (e.g. ERC-20 input or cross-chain swap):
Yield Discovery
Portfolio Analysis & Optimization
Transaction Signing
Two modes depending on your setup:
Self-contained (WALLET_PRIVATE_KEY set): haiku_execute signs everything internally and broadcasts. Returns a tx hash. No external signing needed.
External wallet (no WALLET_PRIVATE_KEY): Use haiku_execute with broadcast: false (required — haiku cannot sign or broadcast without the private key). If you call haiku_execute with broadcast: true and no WALLET_PRIVATE_KEY, the server returns an error directing you to set broadcast: false and broadcast the returned transaction via your wallet MCP. Returns { transaction: { to, data, value, chainId } } for your wallet MCP to broadcast. If Permit2 or bridge signatures are required, call haiku_prepare_signatures first. If approvals are present in the quote, broadcast each approval { to, data, value } (include value when present, e.g. for native token) via your wallet MCP before calling haiku_execute.
The external wallet design allows agents to use any signing infrastructure (wallet MCPs, hardware wallets, custodial services, MPC, etc.).
Cross-Chain Bridge Signatures
For cross-chain swaps, the quote may return isComplexBridge: true, indicating a bridge intent signature is required in addition to (or instead of) Permit2.
Self-contained (Path A): Pass bridgeSigningPayload from the quote to haiku_execute — it handles the bridge signature internally.
External wallet (Path B): Call haiku_prepare_signatures with the quoteId — it returns a normalized bridgeIntent EIP-712 payload. Sign it via your wallet MCP and pass the result as userSignature to haiku_execute.
Transport Modes
Stdio (default)
Standard MCP stdio transport — used by Claude Desktop, Cursor, etc.
Streamable HTTP
HTTP transport for remote hosting, Smithery, and web-based MCP clients.
Endpoints:
POST /mcp— MCP Streamable HTTP endpointGET /health— Health check
Development
License
MIT
Source: README.md at commit f751bb5
Tools
0Version history
1- v0.0.8LatestSep 16, 2026
Score
50% 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