mcpField
F

Fraxlend Mcp Server

Local
github.com/IQAIcomFinance1Updated 37w ago

About Fraxlend Mcp Server

Fraxlend MCP Server gives AI agents access to Fraxlend lending pools on Fraxtal. It is intended for DeFi users who need to inspect pools and manage lending, borrowing, and collateral positions through a set of operational tools.

Key features

  1. 01Filter pools by asset and collateral
  2. 02Lend assets to pools
  3. 03Borrow assets against collateral
  4. 04Add or remove position collateral
  5. 05View lending and borrowing positions
  6. 06Repay loans and withdraw assets

Use cases

  1. 01Find pools for a chosen asset or collateral
  2. 02Review pool APRs when selecting a pool
  3. 03Adjust collateral for a borrowing position
  4. 04Repay a loan or withdraw lent assets

MCP support

The server exposes pool discovery, position lookup, and lending operations as tools for MCP clients. A wallet private key is required to sign transactions.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"fraxlend": {
"command": "npx",
"args": [
"-y",
"@iqai/mcp-fraxlend"
],
"env": {
"WALLET_PRIVATE_KEY": "<WALLET_PRIVATE_KEY>"
}
}
}
}
Run commandnpx -y @iqai/mcp-fraxlend
Environment variables to set
WALLET_PRIVATE_KEYSecret

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@iqai/mcp-fraxlend

Tools

9

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
amountstringYesThe amount for the asset to add as collateral in the FraxLend pool.
pairAddressstringYesThe contract address of the asset to add as collateral.

Details

From the project README

Fraxlend MCP Server

npm version License: MIT

Overview

The Fraxlend MCP Server enables AI agents to interact with Fraxlend, a DeFi lending protocol on Fraxtal. This server provides comprehensive access to lending pools, allowing agents to view statistics, lend assets, borrow, manage collateral, repay loans, and withdraw funds.

By implementing the Model Context Protocol (MCP), this server allows Large Language Models (LLMs) to interact with Fraxlend pools, manage positions, and execute DeFi operations directly through their context window.

Features

  • Pool Discovery: Search and filter FraxLend pools by asset and collateral tokens.
  • Lending Operations: Lend assets to earn yield from borrowers.
  • Borrowing: Borrow assets against collateral from FraxLend pools.
  • Collateral Management: Add or remove collateral from lending positions.
  • Position Tracking: Monitor your lending and borrowing positions across pools.
  • Loan Repayment: Repay borrowed assets to reduce debt.

Installation

Using npx (Recommended)

To use this server without installing it globally:

npx @iqai/mcp-fraxlend
Build from Source
git clone https://github.com/IQAIcom/mcp-fraxlend.git
cd mcp-fraxlend
pnpm install
pnpm run build

Running with an MCP Client

Add the following configuration to your MCP client settings (e.g., claude_desktop_config.json).

Minimal Configuration
{
  "mcpServers": {
    "fraxlend": {
      "command": "npx",
      "args": ["-y", "@iqai/mcp-fraxlend"],
      "env": {
        "WALLET_PRIVATE_KEY": "your_wallet_private_key_here"
      }
    }
  }
}
Advanced Configuration (Local Build)
{
  "mcpServers": {
    "fraxlend": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-fraxlend/dist/index.js"],
      "env": {
        "WALLET_PRIVATE_KEY": "your_wallet_private_key_here"
      }
    }
  }
}

Configuration (Environment Variables)

VariableRequiredDescriptionDefault
WALLET_PRIVATE_KEYYesYour wallet private key for signing transactions-

Security Note: Handle your private key with extreme care. Ensure it is stored securely and only provided to trusted MCP client configurations.

Usage Examples

Pool Discovery
  • "What FraxLend pools are available for FRAX?"
  • "Find pools where I can use ETH as collateral."
  • "Show me the highest APR lending pools."
Lending & Borrowing
  • "Lend 1000 FRAX to the FRAX/sfrxETH pool."
  • "Borrow 500 FRAX using my sfrxETH as collateral."
  • "What are my current positions in FraxLend?"
Position Management
  • "Add more collateral to my borrowing position."
  • "Remove excess collateral from my position."
  • "Repay my loan in the FRAX pool."
  • "Withdraw my lent assets from the pool."

MCP Tools

FRAXLEND_ADD_COLLATERAL

Add collateral to a FraxLend position

ParameterTypeRequiredDescription
pairAddressstringYesThe contract address of the asset to add as collateral.
amountstringYesThe amount for the asset to add as collateral in the FraxLend pool.
FRAXLEND_BORROW

Borrow assets from a FraxLend pool

ParameterTypeRequiredDescription
pairAddressstringYesThe contract address of the agent token to sell.
receiverstringYesThe address to receive the borrowed assets.
collateralAmountstringYesThe amount for the collateral asset to deposit in the FraxLend pool.
borrowAmountstringYesThe amount for the asset to borrow from the FraxLend pool.
FRAXLEND_GET_PAIR_ADDRESS

Get FraxLend pair addresses and pool information

ParameterTypeRequiredDescription
assetSymbolstringThe symbol of the asset token.
collateralSymbolstringThe symbol of the collateral token.
sortByAprstringSort the results by APR, either highest or lowest.
FRAXLEND_GET_POSITIONS

Get your positions in FraxLend pools

ParameterTypeRequiredDescription
addressstringThe address of the user to get the positions for
FRAXLEND_LEND

Lend assets to a FraxLend pool

ParameterTypeRequiredDescription
pairAddressstringYesThe contract address of the asset to lend.
amountstringYesThe amount for the asset to lend in the FraxLend pool.
FRAXLEND_REMOVE_COLLATERAL

Remove collateral from a FraxLend position

ParameterTypeRequiredDescription
pairAddressstringYesThe contract address of the asset to remove as collateral.
amountstringYesThe amount for the asset to remove collateral from the FraxLend pool.
FRAXLEND_REPAY

Repay borrowed assets to a FraxLend pool

ParameterTypeRequiredDescription
pairAddressstringYesThe contract address of the asset to repay.
amountstringYesThe amount for the asset to repay in the FraxLend pool.
FRAXLEND_WITHDRAW

Withdraw assets from a FraxLend pool

ParameterTypeRequiredDescription
pairAddressstringYesThe contract address of the asset to withdraw.
amountstringYesThe amount for the asset to withdraw from the FraxLend pool.

Development

Build Project
pnpm run build
Development Mode (Watch)
pnpm run watch
Linting & Formatting
pnpm run lint
pnpm run format
Project Structure
  • src/tools/: Individual tool definitions
  • src/services/: Business logic and blockchain interactions
  • src/lib/: Shared utilities
  • src/index.ts: Server entry point

Resources

Disclaimer

This project is an unofficial tool and is not directly affiliated with Frax Finance. It interacts with DeFi protocols and blockchain transactions. Users should exercise caution, verify all data independently, and understand the risks involved in lending, borrowing, and managing collateral in DeFi protocols.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.