haiku-mcp-server

haiku-mcp-server

Haiku-Trading

MCP server for blockchain transactions, DeFi trading, yield discovery, and portfolio analysis across 21 networks via Hai

An MCP server that enables AI agents to execute blockchain transactions, discover DeFi yields, check wallet balances, and trade tokens across 21 networks via the Haiku API.

1456 viewsLocal (stdio)

About haiku-mcp-server

haiku-mcp-server is a community-built MCP server published by Haiku-Trading that provides AI assistants with tools and capabilities via the Model Context Protocol. MCP server for blockchain transactions, DeFi trading, yield discovery, and portfolio analysis across 21 networks via Hai It is categorized under finance. This server exposes 7 tools that AI clients can invoke during conversations and coding sessions.

How to install

You can install haiku-mcp-server in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

haiku-mcp-server is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Tools (7)

haiku_get_tokens

Get supported tokens and DeFi assets for trading across networks

haiku_get_balances

Get token balances for a wallet address across all chains

haiku_get_quote

Get a quote for a token swap or portfolio rebalance

haiku_prepare_signatures

Extract EIP-712 signing payloads from a quote for external wallet signing

haiku_discover_yields

Discover yield-bearing opportunities across DeFi protocols, ranked by APY or TVL

Haiku MCP Server

An MCP (Model Context Protocol) server that enables AI agents to execute blockchain transactions via the Haiku API.

npm version GitHub

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

npm install haiku-mcp-server

Or run directly with npx:

npx haiku-mcp-server

Configuration

Environment Variables

VariableRequiredDescription
HAIKU_API_KEYNoYour Haiku API key for higher rate limits. Contact contact@haiku.trade to request one.
HAIKU_BASE_URLNoAPI base URL. Defaults to https://api.haiku.trade/v1
WALLET_PRIVATE_KEYNoPrivate key (0x hex) for self-contained execution via haiku_execute.
RPC_URL_{chainId}NoOverride RPC URL for a specific chain (e.g., RPC_URL_42161 for Arbitrum).

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:

{
  "mcpServers": {
    "haiku": {
      "command": "npx",
      "args": ["haiku-mcp-server"]
    }
  }
}

With API key for higher rate limits:

{
  "mcpServers": {
    "haiku": {
      "command": "npx",
      "args": ["haiku-mcp-server"],
      "env": {
        "HAIKU_API_KEY": "your-api-key-here"
      }
    }
  }
}

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 tokens
    • vault - eg. Yearn/Morpho yield vaults
    • weightedLiquidity - eg. Balancer LP tokens
    • concentratedLiquidity - eg. Uniswap V3 LP positions

Example:

{
  "network": 42161,
  "category": "token"
}

haiku_get_balances

Get token balances for a wallet address across all chains.

Parameters:

  • walletAddress (optional): Wallet address or ENS name. Required when WALLET_PRIVATE_KEY is not set; omit to auto-derive from WALLET_PRIVATE_KEY when it is set.

Example:

{
  "walletAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}

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 spend
  • targetWeights (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 when WALLET_PRIVATE_KEY is not set — must be provided explicitly. When WALLET_PRIVATE_KEY is set, auto-derived if omitted. When WALLET_PRIVATE_KEY is not set (Path B), you must pass receiver explicitly.

Example:

{
  "inputPositions": {
    "arb:0x82aF49447D8a07e3bd95BD0d56f35241523fBab1": "1.0"
  },
  "targetWeights": {
    "arb:0xaf88d065e77c8cC2239327C5EDb3A432268e5831": 0.5,
    "arb:0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9": 0.5
  },
  "slippage": 0.005
}

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 from haiku_get_quote — server resolves the full quote from session cache. QuoteId only works when the quote was returned by haiku_get_quote in the same MCP session; otherwise use quoteResponse.
  • quoteResponse (fallback): Full response object from haiku_get_quote, if quoteId is unavailable

Returns:

  • requiresPermit2: Whether Permit2 signature is needed
  • permit2: EIP-712 payload to pass to signTypedData (if required)
  • requiresBridgeSignature: Whether bridge signature is needed
  • bridgeIntent: EIP-712 payload to pass to signTypedData (if required)
  • sourceChainId: Chain ID for the transaction
  • instructions: Step-by-step instructions for completing the flow

Example:

{
  "quoteId": "abc123..."
}

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., 5 means ≥5% APY)
  • minTvl (optional): Minimum TVL in USD (e.g., 1000000 means ≥$1M). Filters to established mainstream vaults.
  • sortBy (optional): apy (default) or tvl, descending
  • limit (optional): Max results (default 20)

Example:

{
  "network": 42161,
  "category": "lending",
  "minTvl": 1000000,
  "sortBy": "apy",
  "limit": 10
}

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:

{
  "walletAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}

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 from haiku_get_quote
  • sourceChainId (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 from haiku_get_quote if present
  • bridgeSigningPayload (optional): Pass through from haiku_get_quote if present (cross-chain only)
  • approvals (optional): Pass through from haiku_get_quote if present

Example:

{
  "quoteId": "abc123...",
  "sourceChainId": 42161,
  "permit2SigningPayload": { /* from haiku_get_quote, if present */ },
  "approvals": [ /* from haiku_get_quote, if present */ ]
}

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:

  1. If approvals is non-empty in the quote: broadcast each approval as a transaction { to, data, value } (include value when present, e.g. for native token) via your wallet MCP and wait for confirmation.
  2. If signatures are required: call haiku_prepare_signatures with the quoteId, sign the returned EIP-712 payloads via your wallet MCP, then pass the signatures here.

Parameters:

  • quoteId (required): Quote ID from haiku_get_quote
  • sourceChainId (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 be false — haiku returns the unsigned tx for you to broadcast
  • permit2Signature (optional): Signature from signing the Permit2 payload via your wallet MCP
  • userSignature (optional): Signature from signing the bridge payload via your wallet MCP (cross-chain only)

Example:

{
  "quoteId": "abc123...",
  "sourceChainId": 42161,
  "broadcast": false,
  "permit2Signature": "0x..."
}

Returns { transaction: { to, data, value, chainId } } — pass transaction to your wallet MCP's sendTransaction.

Token IID Format

Tokens are


README truncated. View full README on GitHub.

Alternatives

Related Skills

Browse all skills
news-aggregator-skill

Comprehensive news aggregator that fetches, filters, and deeply analyzes real-time content from 8 major sources: Hacker News, GitHub Trending, Product Hunt, 36Kr, Tencent News, WallStreetCN, V2EX, and Weibo. Best for 'daily scans', 'tech news briefings', 'finance updates', and 'deep interpretations' of hot topics.

20
finance-manager

Comprehensive personal finance management system for analyzing transaction data, generating insights, creating visualizations, and providing actionable financial recommendations. Use when users need to analyze spending patterns, track budgets, visualize financial data, extract transactions from PDFs, calculate savings rates, identify spending trends, generate financial reports, or receive personalized budget recommendations. Triggers include requests like "analyze my finances", "track my spending", "create a financial report", "extract transactions from PDF", "visualize my budget", "where is my money going", "financial insights", "spending breakdown", or any finance-related analysis tasks.

10
finance-skills

Production-ready financial analyst skill with ratio analysis, DCF valuation, budget variance analysis, and rolling forecast construction. 4 Python tools (all stdlib-only). Works with Claude Code, Codex CLI, and OpenClaw.

10
personal-finance-beancount

Professional personal finance advisor specializing in plain-text accounting with Beancount and Fava. Use when users need help with: (1) Analyzing spending habits and financial patterns from Beancount files, (2) Creating or understanding Beancount transactions and syntax, (3) Financial planning, budgeting, and investment advice, (4) Interpreting Fava reports and creating custom queries, (5) Organizing chart of accounts, (6) Double-entry bookkeeping principles, (7) Personal finance optimization and wealth building strategies. Provides analysis, education, and personalized recommendations while maintaining professional standards.

6
tavily-search-pro

Tavily AI search platform with 5 modes: Search (web/news/finance), Extract (URL content), Crawl (website crawling), Map (sitemap discovery), and Research (deep research with citations). Use for: web search with LLM answers, content extraction, site crawling, deep research.

4
stock-info-explorer

A Yahoo Finance (yfinance) powered financial analysis tool. Get real-time quotes, generate high-resolution charts with moving averages + indicators (RSI/MACD/Bollinger/VWAP/ATR), summarize fundamentals, and run a one-shot report that outputs both a text summary and a Pro chart.

4