Skip to main content
Glama
Haiku-Trading

Haiku DeFi MCP

Official

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

Related MCP server: maxia-mcp

Installation

npm install haiku-mcp-server

Or run directly with npx:

npx haiku-mcp-server

Configuration

Environment Variables

Variable

Required

Description

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

WALLET_PRIVATE_KEY

No

Private key (0x hex) for self-contained execution via haiku_execute.

RPC_URL_{chainId}

No

Override 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 identified using the IID format: chainSlug:tokenAddress

Examples:

  • arb:0x82aF49447D8a07e3bd95BD0d56f35241523fBab1 - WETH on Arbitrum

  • arb:0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - Native ETH on Arbitrum

  • base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 - USDC on Base

Supported Chains

Chain

Chain ID

Slug

Arbitrum

42161

arb

Avalanche

43114

avax

Base

8453

base

Berachain

80094

bera

BNB Smart Chain

56

bsc

Bob

60808

bob

Ethereum

1

eth

Gnosis

100

gnosis

Hyperliquid

999

hype

Katana

747474

katana

Lisk

1135

lisk

MegaETH

4326

megaeth

Monad

143

monad

Optimism

10

opt

Plasma

9745

plasma

Polygon

137

poly

Scroll

534352

scroll

Sei

1329

sei

Sonic

146

sonic

Unichain

130

uni

World Chain

480

worldchain

ApeChain

33139

ape

Workflow Examples

Path A: Self-Contained Swap (WALLET_PRIVATE_KEY set)

Haiku handles all signing and broadcasting. Returns a tx hash.

1. haiku_get_quote(inputPositions, targetWeights) → returns quoteId, sourceChainId, permit2SigningPayload?, bridgeSigningPayload?, approvals
2. haiku_execute(quoteId, sourceChainId, permit2SigningPayload?, bridgeSigningPayload?, approvals)
   → Haiku broadcasts approvals, signs Permit2/bridge internally, broadcasts swap, returns 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):

1. haiku_get_quote(inputPositions, targetWeights, receiver) → returns quoteId, sourceChainId, approvals
2. For each item in approvals: broadcast as transaction { to, data, value } (include value when present) via wallet MCP and wait for confirmation
3. haiku_execute(quoteId, sourceChainId, broadcast: false)
   → returns { transaction: { to, data, value, chainId } }
4. Broadcast transaction via wallet MCP

With Permit2 or bridge signatures (e.g. ERC-20 input or cross-chain swap):

1. haiku_get_quote(inputPositions, targetWeights, receiver) → returns quoteId, sourceChainId, approvals, permit2SigningPayload?, bridgeSigningPayload?
2. For each item in approvals: broadcast as transaction { to, data, value } (include value when present) via wallet MCP and wait for confirmation
3. haiku_prepare_signatures(quoteId) → returns normalized EIP-712 payloads + step-by-step instructions
4. Sign payloads via wallet MCP (e.g. coinbase_sign_typed_data) → get permit2Signature?, userSignature?
5. haiku_execute(quoteId, sourceChainId, permit2Signature?, userSignature?, broadcast: false)
   → returns { transaction: { to, data, value, chainId } }
6. Broadcast transaction via wallet MCP (e.g. coinbase_send_transaction)

Yield Discovery

1. haiku_discover_yields with category/network/minTvl filters → find opportunities, note iid
2. haiku_get_quote with the chosen iid as a key in targetWeights
3. Execute via Path A or Path B above

Portfolio Analysis & Optimization

1. haiku_analyze_portfolio with wallet address → review positions and opportunities
2. Optionally haiku_discover_yields for broader market context
3. haiku_get_quote to rebalance into higher-yielding positions
4. Execute via Path A or Path B above

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.

npx haiku-mcp-server

Streamable HTTP

HTTP transport for remote hosting, Smithery, and web-based MCP clients.

npx haiku-mcp-server --http
npx haiku-mcp-server --http --port=8080

Endpoints:

  • POST /mcp — MCP Streamable HTTP endpoint

  • GET /health — Health check

Development

# Install dependencies
npm install

# Build
npm run build

# Run locally (stdio, works without API key)
npm start

# Run locally (HTTP)
npm run start:http

# Run with API key for higher rate limits
HAIKU_API_KEY=your-key npm start

License

MIT

Available Tools

7 tools
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.

ParametersJSON Schema
NameRequiredDescriptionDefault
walletAddressYesWallet address (0x...) to analyze

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses that the tool returns enriched positions with APY, health factors, and context-specific opportunities. While it doesn't detail side effects (likely none as it's read-only), the description is clear and trustworthy. Minor gap: doesn't explicitly state it's read-only.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, all informative. The first sentence states purpose and returns, the second gives usage guidance, the third provides workflow integration. Efficient and well-structured. Slight redundancy with 'context-specific opportunities' could be trimmed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple input (one string) and no output schema, the description fully covers what the tool does, returns, and how it fits into a workflow. No missing information for an agent to use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single parameter 'walletAddress', and the description already implies it's a wallet address. The description adds value by explaining the output is based on what the wallet holds, but the parameter itself is straightforward.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool analyzes a wallet's DeFi portfolio and surfaces yield opportunities, specifying what it returns (positions, APY options, health factors, opportunities). It uses specific verbs ('Analyze', 'surface') and distinguishes itself from sibling tools like haiku_discover_yields and haiku_execute.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use ('when a user asks what they should do with their portfolio or wants yield optimization advice') and provides clear guidance on pairing with haiku_discover_yields for market context and haiku_get_quote for execution. No exclusions needed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
networkNoFilter by network. Common networks: 42161 (Arbitrum), 8453 (Base), 1 (Ethereum), 137 (Polygon), 10 (Optimism), 56 (BNB Chain)
categoryNolending=Aave collateral tokens, vault=Yearn/Morpho vaults, lp=Balancer/Uniswap LP, all=every yield-bearing category (default: all)
minApyNoMinimum APY filter as a percentage, e.g. 5 means ≥5% APY
minTvlNoMinimum TVL filter in USD, e.g. 1000000 means ≥$1M TVL. Use this to filter to established mainstream vaults and exclude low-liquidity pools.
sortByNoSort by APY (default) or TVL, descending
limitNoMaximum number of results (default 20)

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses that results include APY, TVL, risk parameters, and token IIDs, and that the iid field is usable in haiku_get_quote. However, it does not mention rate limits, pagination behavior, or response size limits beyond the 'limit' parameter.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Concise at three sentences. The first sentence states purpose, second lists outputs and downstream use, third provides examples. Every sentence adds value. Slightly verbose in the last sentence with multiple examples, but still efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters with 100% schema coverage and no output schema, the description effectively explains the tool's purpose and output semantics. It could be improved by describing the risk parameters' nature (e.g., risk score vs. qualitative), but overall adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds value by explaining the iid field's downstream use and by including example questions. However, it does not add new meaning beyond the schema for most parameters, as the schema already has clear descriptions for each.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool discovers yield opportunities across DeFi protocols and lists specific output fields (APY, TVL, risk parameters, token IIDs). It distinguishes itself from siblings like haiku_get_quote by explaining the iid output can be used as input for that tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit example questions for when to use the tool, such as 'best lending yields on Arbitrum' or 'highest APY vaults with at least $1M TVL'. It also explains how the output connects to haiku_get_quote, guiding the agent on downstream usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
quoteIdYesQuote ID from haiku_get_quote
permit2SigningPayloadNopermit2SigningPayload from haiku_get_quote (for self-contained signing)
bridgeSigningPayloadNobridgeSigningPayload from haiku_get_quote (cross-chain only, for self-contained signing)
permit2SignatureNoPre-signed Permit2 signature (external wallet mode)
userSignatureNoPre-signed bridge intent signature (external wallet mode)
approvalsNoapprovals from haiku_get_quote. Self-contained mode only: haiku broadcasts these on-chain before the swap. In external wallet mode (broadcast: false), do not pass these — broadcast each approval {to, data} via your wallet MCP before calling haiku_execute.
sourceChainIdNoChain ID of the source token (from haiku_get_quote). Recommended — if omitted, the server will attempt to recover it from the signing payloads or session cache, but passing it explicitly is safer.
broadcastNoIf true (default), broadcasts tx. If false, returns unsigned tx.

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It fully discloses the tool's behavior: two distinct execution modes, signing internal vs external, broadcasting behavior (broadcast: true/false), and the transaction output format (tx hash vs { to, data, value, chainId }). No contradictions with annotations since none exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with bullet points for two clear paths, front-loading the main purpose. Every sentence adds value with no redundancy. Length is appropriate for the complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 8 parameters with 100% schema coverage, no output schema, and high complexity (two modes, nested objects), the description fully covers usage flow, parameter dependencies, and return format for both paths. No gaps identified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds significant value beyond schema by explaining when each parameter is needed (e.g., approvals in self-contained vs external mode, permit2SigningPayload vs permit2Signature based on path). The 'broadcast' parameter's effect is clarified. Minor deduction for not detailing the nested objects' structure (e.g., approval {to, data}) beyond what schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Execute a quote' and distinguishes two paths (self-contained vs external wallet), which differentiates it from sibling tools like haiku_get_quote or haiku_prepare_signatures. The verb 'execute' plus resource 'quote' is specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit step-by-step instructions for both Path A and Path B, including when to call haiku_get_quote first, when to use haiku_prepare_signatures, and when to broadcast approvals via wallet MCP. It clearly states alternatives and when not to use certain parameters.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
walletAddressNoWallet address (0x...) or ENS name. Omit to auto-derive from WALLET_PRIVATE_KEY.
chainIdsNoOptional list of chain IDs to fetch balances for. When provided, only those chains are queried (partial refresh). Example: [42161, 8453] to re-fetch only Arbitrum and Base after a cross-chain swap. Common chain IDs: 1 (Ethereum), 42161 (Arbitrum), 8453 (Base), 137 (Polygon), 10 (Optimism), 56 (BNB Chain), 80094 (Berachain). Omit to fetch all chains.

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must disclose behavioral traits. It explains optional wallet address derivation from environment variable and the partial refresh behavior. However, it doesn't mention rate limits, data freshness, or what happens if the wallet address is invalid. Adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with a clear structure: first sentence states purpose, second elaborates on parameters and return values. It is front-loaded and efficient, though the list of chain IDs could be trimmed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description explicitly lists return fields (balances, USD prices, portfolio value, categories). It covers the two parameters well. For a simple query tool, this is complete enough. Missing details about error handling or data freshness, but acceptable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds significant value by explaining the partial refresh use case for chainIds, providing common chain IDs and examples. For walletAddress, it clarifies optionality and auto-derivation. This goes beyond schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves token balances for a wallet address. It specifies the default behavior (all chains) and contrasts with a common variant (partial refresh with chainIds). This distinguishes it from siblings like haiku_analyze_portfolio which likely provides deeper analysis rather than raw balances.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use the tool (get balances) and when to use the chainIds parameter (after a swap for faster partial refresh). It doesn't explicitly exclude other scenarios or mention alternatives among siblings, but the context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
inputPositionsYesMap of token IID to amount. IID format: "<chain-slug>:<token-address>". Supported chain slugs: arb=Arbitrum(42161), base=Base(8453), eth=Ethereum(1), poly=Polygon(137), opt=Optimism(10), bsc=BNB Chain(56), avax=Avalanche(43114), gnosis=Gnosis(100), sonic=Sonic(146), worldchain=World Chain(480), scroll=Scroll(534352), lisk=Lisk(1135), sei=Sei(1329), bera=Berachain(80094), bob=BOB(60808), hype=Hyperliquid(999), katana=Katana(747474), monad=Monad(143), plasma=Plasma(9745), uni=Unichain(130), ape=ApeChain(33139), megaeth=MegaETH(4326). Example: { "arb:0x82aF49447D8a07e3bd95BD0d56f35241523fBab1": "1.5" }
targetWeightsYesMap of output token IID to weight (sum to 1). Example: { "arb:0xaf88...": 0.5, "arb:0xFd08...": 0.5 }
slippageNoMax slippage as decimal (e.g., 0.003 for 0.3%). Default: 0.003
receiverNoReceiving wallet address. Required when WALLET_PRIVATE_KEY is not set — must be provided explicitly. When WALLET_PRIVATE_KEY is set, auto-derived from it if omitted.

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It transparently explains that the tool returns EIP-712 signing payloads when signatures are required and outlines the two execution paths. However, it does not disclose potential side effects, rate limits, or authorization requirements beyond the receiver field note.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with bullet points for the two execution paths, making it easy to parse. It is slightly verbose due to the detailed path explanations, but every sentence adds value and avoids repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (nested objects, multiple execution paths, no output schema), the description covers the key aspects: what the tool returns, how to proceed after getting a quote, and parameter details. However, it could be improved by mentioning that no output schema exists, so the agent must infer the response structure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds value by explaining the IID format and providing examples for inputPositions and targetWeights, as well as clarifying the receiver parameter's behavior based on private key presence. However, it does not elaborate on slippage beyond its default value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches a quote for token swaps or portfolio rebalances, listing expected outputs like fees, gas estimates, and required approvals. It also distinguishes this tool from siblings by detailing its role as the first step in a multi-tool execution flow.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool (before execution) and details two distinct execution paths (Path A with private key, Path B with external wallet) including step-by-step instructions and sibling tool names like haiku_execute and haiku_prepare_signatures.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
networkNoFilter tokens by network. Common networks: 42161 (Arbitrum), 8453 (Base), 1 (Ethereum), 137 (Polygon), 10 (Optimism), 56 (BSC)
categoryNoFilter by token category: 'token' (vanilla tokens), 'collateral' (Aave aTokens), 'varDebt' (Aave debt tokens), 'vault' (Yearn/Morpho vaults), 'weightedLiquidity' (Balancer LP), 'concentratedLiquidity' (Uniswap V3 LP). Omit to return all categories.

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses that the tool returns token IIDs, symbols, names, prices, and chain information, and explains the IID format. However, it doesn't mention if this is a read-only operation, potential rate limits, or any side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with 4 sentences, front-loading the main purpose. Each sentence adds value. Could be slightly shorter by removing redundant 'Use the IID format' since schema already describes it, but still efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 2 optional parameters and no output schema, the description adequately explains purpose, return data, and usage guidance. The context signals show low complexity, and the description is sufficient for an AI agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, with both parameters having detailed descriptions. The description adds context beyond schema by listing token types and explaining IID format. The enum values are also clarified in description, but schema already covers them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves supported tokens and DeFi positions for trading, listing specific types like vanilla tokens, Aave collateral/debt, yield vaults, and LP tokens. This differentiates it from siblings like haiku_get_balances (balances) and haiku_analyze_portfolio (portfolio analysis) by focusing on supported token metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use category filter and gives an example ('collateral' for Aave aTokens). It also instructs to use IID format in other tools. However, it does not explicitly state when not to use this tool or compare to alternatives like haiku_get_balances for balances.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
quoteIdNoQuote ID from haiku_get_quote (preferred — server resolves the full quote from session cache)
quoteResponseNoFull response from haiku_get_quote (fallback when quoteId is unavailable)

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Since no annotations are provided, the description must disclose behavior. It explains that the tool extracts/normalizes EIP-712 payloads and does not execute the transaction, which is crucial. It also indicates it's a read-only preparation step, not destructive. However, it doesn't mention any authorization requirements or side effects, but given the tool's nature (signature preparation), the description is largely transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences and efficiently conveys purpose, usage, and parameter guidance. It could be slightly more concise by removing the last sentence about post-signing steps (which might belong in haiku_execute's description), but overall it's well-structured and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description implicitly covers return values (normalized EIP-712 payloads). It addresses the tool's role in a multi-step process (sign then execute). It lacks detail on the output format or error cases, but for a preparation tool with two optional params, it is reasonably complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters. The description adds value by explaining the preferred parameter (quoteId) and fallback (quoteResponse), and clarifying that quoteId allows server-side resolution from session cache. This goes beyond what the schema provides, justifying a score above baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: preparing EIP-712 signatures for external wallets, distinguishing it from haiku_execute. It specifies the resource ('EIP-712 payloads from a quote') and the action ('extracts and normalizes'), making it distinct from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly tells when to use this tool (when WALLET_PRIVATE_KEY is not set or wallet MCP handles signing) and when not to (instead of passing directly to haiku_execute). It also provides guidance on which parameter to use (prefer quoteId, fallback to quoteResponse), and what to do after ('pass permit2Signature and/or userSignature to haiku_execute').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 7 tool updatesv0.0.8
    • First observedhaiku_analyze_portfolio
    • First observedhaiku_discover_yields
    • First observedhaiku_execute
    • First observedhaiku_get_balances
    • First observedhaiku_get_quote
    • First observedhaiku_get_tokens
    • First observedhaiku_prepare_signatures

TDQS

A4.4/5.0
Disambiguation4/5

Tools have mostly distinct purposes: portfolio analysis, yield discovery, token queries, balance checking, quoting, execution, and signature preparation. However, haiku_execute and haiku_prepare_signatures have overlapping concerns around execution paths, which could cause some confusion.

Naming Consistency5/5

All tools follow a consistent haiku_verb_noun pattern (analyze_portfolio, discover_yields, execute, get_balances, get_quote, get_tokens, prepare_signatures). The naming is predictable and intuitive.

Tool Count5/5

Seven tools is an appropriate number for a DeFi MCP server covering portfolio analysis, yield discovery, quoting, execution, and token/balance queries. Each tool serves a clear purpose without unnecessary bloat.

Completeness5/5

The tool set covers the full lifecycle of DeFi interactions: discovery (haiku_discover_yields, haiku_get_tokens), analysis (haiku_analyze_portfolio, haiku_get_balances), quoting (haiku_get_quote), and execution (haiku_execute, haiku_prepare_signatures). No obvious gaps for typical DeFi workflows.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A comprehensive MCP server providing unified access to over 144 tools for lending, trading, and staking across six major DeFi protocols on the Stacks Bitcoin Layer 2. It enables AI agents to perform complex blockchain operations and interact with the DeFi ecosystem using natural language commands.
    3
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    AI-to-AI marketplace MCP server with 46 tools — swap 65+ crypto tokens on 7 chains, rent GPUs, trade 25 tokenized stocks, on-chain escrow (Solana + Base), DeFi yields, sentiment analysis, wallet monitoring, and image generation. Supports USDC payments across 14 blockchains.
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    MCP server providing AI agents with native access to Jupiter's full DeFi stack on Solana. It offers 17 tools covering swaps, tokens, lending, limit orders, DCA, prediction markets, perpetuals, and portfolio management.
    16
    -
  • A
    license
    A
    quality
    B
    maintenance
    Cross-chain DeFi intelligence MCP server for AI agents. 7 tools for yield discovery, pool analysis, profit simulation, risk scoring, whale tracking, impermanent loss calculation, and DeFi overview across 86 chains and 6,500+ liquidity pools.
    7
    1
    AGPL 3.0

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