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
- 01Filter pools by asset and collateral
- 02Lend assets to pools
- 03Borrow assets against collateral
- 04Add or remove position collateral
- 05View lending and borrowing positions
- 06Repay loans and withdraw assets
Use cases
- 01Find pools for a chosen asset or collateral
- 02Review pool APRs when selecting a pool
- 03Adjust collateral for a borrowing position
- 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.
Tools
9Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | string | Yes | The amount for the asset to add as collateral in the FraxLend pool. |
| pairAddress | string | Yes | The contract address of the asset to add as collateral. |
Details
From the project READMEFraxlend MCP Server
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)
| Variable | Required | Description | Default |
|---|---|---|---|
WALLET_PRIVATE_KEY | Yes | Your 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
| Parameter | Type | Required | Description |
|---|---|---|---|
pairAddress | string | Yes | The contract address of the asset to add as collateral. |
amount | string | Yes | The amount for the asset to add as collateral in the FraxLend pool. |
FRAXLEND_BORROW
Borrow assets from a FraxLend pool
| Parameter | Type | Required | Description |
|---|---|---|---|
pairAddress | string | Yes | The contract address of the agent token to sell. |
receiver | string | Yes | The address to receive the borrowed assets. |
collateralAmount | string | Yes | The amount for the collateral asset to deposit in the FraxLend pool. |
borrowAmount | string | Yes | The amount for the asset to borrow from the FraxLend pool. |
FRAXLEND_GET_PAIR_ADDRESS
Get FraxLend pair addresses and pool information
| Parameter | Type | Required | Description |
|---|---|---|---|
assetSymbol | string | The symbol of the asset token. | |
collateralSymbol | string | The symbol of the collateral token. | |
sortByApr | string | Sort the results by APR, either highest or lowest. |
FRAXLEND_GET_POSITIONS
Get your positions in FraxLend pools
| Parameter | Type | Required | Description |
|---|---|---|---|
address | string | The address of the user to get the positions for |
FRAXLEND_LEND
Lend assets to a FraxLend pool
| Parameter | Type | Required | Description |
|---|---|---|---|
pairAddress | string | Yes | The contract address of the asset to lend. |
amount | string | Yes | The amount for the asset to lend in the FraxLend pool. |
FRAXLEND_REMOVE_COLLATERAL
Remove collateral from a FraxLend position
| Parameter | Type | Required | Description |
|---|---|---|---|
pairAddress | string | Yes | The contract address of the asset to remove as collateral. |
amount | string | Yes | The amount for the asset to remove collateral from the FraxLend pool. |
FRAXLEND_REPAY
Repay borrowed assets to a FraxLend pool
| Parameter | Type | Required | Description |
|---|---|---|---|
pairAddress | string | Yes | The contract address of the asset to repay. |
amount | string | Yes | The amount for the asset to repay in the FraxLend pool. |
FRAXLEND_WITHDRAW
Withdraw assets from a FraxLend pool
| Parameter | Type | Required | Description |
|---|---|---|---|
pairAddress | string | Yes | The contract address of the asset to withdraw. |
amount | string | Yes | The 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 definitionssrc/services/: Business logic and blockchain interactionssrc/lib/: Shared utilitiessrc/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
Comments
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.