Skip to main content
Glama

KawaFi - Hedera DeFi MCP Server

KawaFi provides unified access to the Hedera DeFi ecosystem through the Model Context Protocol (MCP), enabling AI assistants to interact with multiple DeFi platforms safely and efficiently.

MCP TypeScript License Tools Success Rate

šŸš€ Overview

A comprehensive Model Context Protocol (MCP) server that provides unified access to major Hedera DeFi platforms including SaucerSwap, Bonzo Finance, Stader, HeliSwap, and Hashport. This server enables AI assistants and applications to interact with Hedera's DeFi ecosystem through 36 standardized tools covering data analytics, transaction preparation, and cross-platform operations.

Related MCP server: Hedera Toolbox

✨ Features

šŸ” Dual-Mode Security System

  • Prepare Mode (Default): Generate unsigned transactions for external signing

  • Execute Mode (Advanced): Optionally sign and execute transactions directly

  • Security-First Design: Private keys only loaded when explicitly required

🌐 Multi-Platform DeFi Integration

šŸ› ļø Comprehensive Toolset

  • Data & Analytics: Real-time prices, pool reserves, APYs, lending rates

  • Transaction Preparation: Complete unsigned transaction data with proper encoding

  • Cross-chain Operations: Asset bridging across multiple networks

  • Yield Optimization: Staking, farming, and lending opportunities

šŸ“Š Tool Overview

Platform

Data Tools

Transaction Tools

Total

Status

SaucerSwap

10

9

19

āœ… 100% Working

Bonzo Finance

3

0*

3

āœ… 100% Working

Stader

1

2

3

āœ… 100% Working

HeliSwap

1

0

1

āœ… 100% Working

Hashport

10

0

10

āœ… 100% Working

TOTAL

25

11

36

āœ… 100% Working

*Bonzo transaction tools planned for future release

šŸ”§ Installation & Setup

Prerequisites

  • Node.js 18+

  • An MCP-compatible client (Claude Desktop, etc.)

1. Installation

# Install globally from npm
npm install -g kawa-fi-mcp

# Or run with npx (no installation needed)
npx kawa-fi-mcp --help

2. Environment Configuration

Create a .env file with your desired configuration (see .env.example for reference):

# Network Selection
HEDERA_NETWORK=mainnet  # or "testnet"

# Security Mode
EXECUTE_TX=false        # true for execution, false for prepare-only

# Platform API Keys
SAUCERSWAP_API_KEY=your_api_key_here  # Optional but recommended

# Hedera Credentials (choose based on network)
MAINNET_HEDERA_OPERATOR_ID=0.0.your_account
MAINNET_HEDERA_OPERATOR_KEY=your_private_key     # Only if EXECUTE_TX=true
TESTNET_HEDERA_OPERATOR_ID=0.0.your_testnet_account  
TESTNET_HEDERA_OPERATOR_KEY=your_testnet_private_key  # Only if EXECUTE_TX=true

3. MCP Client Configuration

Add to your MCP client:

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "hedera-defi": {
      "command": "npx",
      "args": ["kawa-fi-mcp"]
    }
  }
}

4. Verification

# Test the server directly
npx kawa-fi-mcp

# Or if installed globally
kawa-fi-mcp

# Check available tools (should show 13-36 tools based on configuration)

šŸ“‹ Available Tools

SaucerSwap (19 tools)

Data & Analytics Tools (10)

  • saucerswap_get_tokens - All available tokens with prices and metadata

  • saucerswap_get_stats - Platform statistics (TVL, volume, SAUCE circulation)

  • saucerswap_get_sss_stats - Single-Sided Staking statistics and XSAUCE ratio

  • saucerswap_get_hbar_prices - Historical HBAR price data (minutely resolution)

  • saucerswap_get_platform_data - Historical liquidity/volume data with intervals

  • saucerswap_get_farms - Active yield farming opportunities

  • saucerswap_get_farms_by_account - LP token amounts in farms by account

  • saucerswap_get_pools - All liquidity pools with reserves and token info

  • saucerswap_get_default_tokens - Default tokens with price changes

  • saucerswap_get_v2_pools - V2 pools with advanced metrics (fees, ticks, liquidity)

Transaction Tools (9) šŸ†•

  • saucerswap_quote_exact_input - Get swap quote for exact input amount

  • saucerswap_quote_exact_output - Get swap quote for exact output amount

  • saucerswap_swap_hbar_for_tokens - Prepare HBAR → tokens swap with refunds

  • saucerswap_swap_tokens_for_hbar - Prepare tokens → HBAR swap with unwrapping

  • saucerswap_swap_tokens_for_tokens - Prepare token → token swaps

  • saucerswap_stake_sauce - Prepare SAUCE staking for xSAUCE

  • saucerswap_unstake_xsauce - Prepare xSAUCE unstaking for SAUCE

  • saucerswap_deposit_to_farm - Prepare LP token farm deposits

  • saucerswap_withdraw_from_farm - Prepare LP token farm withdrawals

Other Platform Tools (17)

Bonzo Finance (3)

  • bonzo_get_reserves - All lending/borrowing reserves

  • bonzo_get_account - Account positions and balances

  • bonzo_get_liquidations - Accounts eligible for liquidation

Stader (3)

  • stader_get_exchange_rate - Current HBAR to HBARX exchange rate

  • stader_stake_hbar - Stake HBAR for HBARX (transaction)

  • stader_unstake_hbarx - Unstake HBARX for HBAR (transaction)

HeliSwap (1)

  • heliswap_get_pair_info - Trading pair information

Hashport (10)

  • hashport_get_supported_assets - Bridge-supported assets

  • hashport_get_supported_networks - All supported networks

  • hashport_get_bridge_steps - Step-by-step bridging instructions

  • hashport_validate_bridge - Validate bridge parameters

  • hashport_get_assets_amounts - Asset reserve amounts

  • hashport_get_transfers - Paginated transfer history

  • hashport_get_network_assets - Assets on specific networks

  • hashport_get_network_asset_amounts - Asset amounts per network

  • hashport_get_network_asset_details - Detailed asset information

  • hashport_convert_hedera_tx_id - Transaction ID format conversion

šŸŽÆ Usage Examples

For comprehensive examples and test prompts for all 36 tools, see PROMPTS.md.

Basic DeFi Data

Get all tokens available on SaucerSwap
Show current HBAR to HBARX staking rate  
List active yield farms with APYs

Transaction Preparation šŸ†•

Prepare transaction to swap 10 HBAR for SAUCE tokens with 0.3% fee pool
Prepare transaction to stake 1000000 SAUCE for xSAUCE
Prepare transaction to deposit LP tokens to farm pool 1

Analytics & Cross-chain

Get HBAR price history from last week
Find accounts eligible for liquidation on Bonzo
Get bridge steps from Ethereum to Hedera for USDC

šŸ“Š Status & Testing

Current Status

  • Overall: 36/36 tools working (100% success rate)

  • Transaction Tools: 11/11 working (100% success rate)

  • Data Tools: 25/25 working (100% success rate)

Detailed Results

See TEST_RESULTS.md for:

  • Complete testing results with response sizes

  • Performance notes and API rate limiting info

  • Known issues and resolution steps

  • Platform-specific availability details

Known Issues

  • API Rate Limiting: Some SaucerSwap endpoints may timeout during high load

  • Network Dependencies: Stader and HeliSwap only available on mainnet

šŸ›”ļø Security & Transaction Modes

EXECUTE_TX=false  # or omit entirely
  • āœ… Secure: Private keys never loaded

  • āœ… Flexible: Sign with hardware wallets, dApps, or secure environments

  • āœ… Transparent: Complete unsigned transaction data provided

  • ⚔ Fast: No blockchain interaction delays

Execute Mode (Advanced)

EXECUTE_TX=true
MAINNET_HEDERA_OPERATOR_KEY=302e020100...
  • āš ļø Security: Private key loaded in memory

  • ⚔ Convenient: Automatic transaction signing and submission

  • šŸ“Š Results: Returns transaction IDs and confirmations

  • šŸŽÆ Use Case: Automated strategies, trusted environments

Transaction Output Example

Prepare Mode Output:

{
  "type": "prepared_transaction",
  "description": "Swap 10 HBAR for minimum 1000000 SAUCE tokens",
  "from": "0.0.123456",
  "to": "0x00000000000000000000000000000000002cc9B2",
  "function": "multicall(bytes[])",
  "gas": 400000,
  "value": "1000000000",
  "unsigned": {
    "contractId": "0x00000000000000000000000000000000002cc9B2",
    "functionName": "multicall",
    "functionParams": ["0xc04b8d59000000..."],
    "payableAmount": "1000000000"
  }
}

šŸ—ļø Architecture & Development

Project Structure

src/
ā”œā”€ā”€ clients/           # Platform-specific client implementations
│   ā”œā”€ā”€ saucerswap.ts    # SaucerSwap API + transaction tools
│   ā”œā”€ā”€ bonzo.ts         # Bonzo Finance integration
│   ā”œā”€ā”€ stader.ts        # Stader staking with transactions  
│   ā”œā”€ā”€ hashport.ts      # Hashport bridge operations
│   └── heliswap.ts      # HeliSwap pair data
ā”œā”€ā”€ index.ts           # MCP server with 36 tool definitions
└── types/             # TypeScript definitions

Development Commands

# For local development (after git clone)
npm install            # Install dependencies
npm run dev            # Development with hot reload
npm run build          # Production build
npm run test           # Run test suite

# For users (npm package)
npm install -g kawa-fi-mcp  # Global installation
npx kawa-fi-mcp             # Direct execution

Technical Details

For complete technical overview, challenges, and architecture details, see SUBMISSION.md.

šŸ¤ Contributing

  1. Fork the repository

  2. Create a feature branch: git checkout -b feature/amazing-feature

  3. Commit changes: git commit -m 'Add amazing feature'

  4. Push to branch: git push origin feature/amazing-feature

  5. Open a Pull Request

šŸ› Troubleshooting

Common Issues

Tools not appearing: Check MCP configuration and installation

npx kawa-fi-mcp --version  # Verify package is accessible

API timeouts: SaucerSwap has rate limits

# Retry requests or use smaller data ranges
# API tools may timeout but transaction tools work consistently

Contract errors: Verify network configuration

echo $HEDERA_NETWORK    # Should match your credentials
echo $EXECUTE_TX        # Should be "false" for prepare mode

Missing transaction tools: Ensure Hedera credentials are set

# For mainnet transaction tools:
echo $MAINNET_HEDERA_OPERATOR_ID    # Required for transaction preparation

Getting Help

  • Check TEST_RESULTS.md for current tool status

  • Review PROMPTS.md for working examples

  • Verify environment configuration matches requirements

šŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

šŸ™ Acknowledgments

  • Model Context Protocol for the integration framework

  • Hedera for the blockchain infrastructure

  • DeFi platforms: SaucerSwap, Bonzo Finance, Stader, HeliSwap, Hashport


KawaFi - Unifying Hedera DeFi for AI assistants šŸ¤–āš”

Built with MCP Hedera

Available Tools

17 tools
bonzo_get_accountC

Get account positions from Bonzo Finance

Inputs: accountId (required).

bonzo_get_liquidationsB

Get accounts with outstanding debt eligible for liquidation

Inputs: no named parameters.

bonzo_get_reservesB

Get all lending/borrowing reserves from Bonzo Finance

Inputs: no named parameters.

hashport_convert_hedera_tx_idC

Convert Hedera transaction ID format

Inputs: txId (required).

hashport_get_assets_amountsB

Get reserve amounts for all assets on Hashport

Inputs: no named parameters.

hashport_get_bridge_stepsC

Get step-by-step instructions for bridging assets via Hashport

Inputs: sourceNetworkId (required), targetNetworkId (required), sourceAssetId (required), recipient (required), +2 more.

hashport_get_network_asset_amountsC

Get amounts for a specific asset on a network

Inputs: networkId (required), assetId (required).

hashport_get_network_asset_detailsC

Get detailed information for a specific asset on a network

Inputs: networkId (required), assetId (required).

hashport_get_network_assetsC

Get assets available on a specific network

Inputs: networkId (required).

hashport_get_supported_assetsB

Get list of assets supported by Hashport bridge

Inputs: sourceNetwork, targetNetwork.

hashport_get_supported_networksB

Get all networks supported by Hashport

Inputs: no named parameters.

hashport_get_transfersC

Get paginated list of transfers with optional filtering

Inputs: page (required), pageSize (required), filter.

hashport_validate_bridgeC

Validate bridge parameters before initiating a bridge

Inputs: sourceNetworkId (required), targetNetworkId (required), sourceAssetId (required), recipient (required), +2 more.

heliswap_get_pair_infoC

Get trading pair information from HeliSwap

Inputs: token0 (required), token1 (required).

stader_get_exchange_rateA

Get current HBAR to HBARX exchange rate

Inputs: no named parameters.

stader_stake_hbarC

Prepare HBAR staking transaction (returns unsigned transaction)

Inputs: amountHbar (required).

stader_unstake_hbarxC

Prepare HBARX unstaking transaction (returns unsigned transaction)

Inputs: amountHbarx (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 17 tools

    Disambiguation4/5

    Tools are clearly grouped by service (Bonzo, Hashport, HeliSwap, Stader), with distinct purposes within each group. Minor potential confusion exists between hashport_get_assets_amounts and hashport_get_network_asset_amounts, but descriptions clarify the scope differences (all assets vs. specific asset).

    Naming Consistency5/5

    Perfectly consistent naming throughout: all tools follow a service_action_resource pattern with snake_case (e.g., bonzo_get_account, hashport_get_assets_amounts). This makes it easy to understand which service each tool belongs to and what it does.

    Tool Count4/5

    17 tools is reasonable for a multi-service DeFi server covering four distinct platforms. It's slightly on the higher side but well-organized by service, with each tool serving a specific purpose without obvious redundancy.

    Completeness3/5

    Coverage varies by service: Hashport has comprehensive tools for bridging (get, validate, convert), but Bonzo lacks update/delete operations for positions, and HeliSwap only has get_pair_info without broader DEX functionality. Gaps exist, but core workflows for each service are partially covered.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      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
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Production MCP server giving AI agents metered access to live Hedera blockchain data. Query token prices, screen identities, monitor governance, write tamper-evident HCS compliance records, and analyze smart contracts — all paid in HBAR micropayments per call.
      20
      47 npm
      Academic Free v1.1
    • A
      license
      A
      quality
      C
      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
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for DeFi execution — lets AI agents swap, provide liquidity, lend, bridge, and run yield strategies across 22 chains in a single transaction. 7 tools for token discovery, portfolio analysis, quoting, and execution via the Haiku API.
      7
      88 npm
      2
      MIT