MCP Fraxlend
Interact with the Fraxlend lending platform
- Package:
@iqai/mcp-fraxlend - Purpose: Interact with the Fraxlend lending platform
Usage with ADK TypeScript
import {McpFraxlend} from "@iqai/adk";
const toolset = McpFraxlend({
env: {
WALLET_PRIVATE_KEY: process.env.WALLET_PRIVATE_KEY,
},
})
const tools = await toolset.getTools()import {McpToolset} from "@iqai/adk";
const toolset = new McpToolset({
name: "Fraxlend MCP Client",
description: "Client for Fraxlend lending operations",
transport: {
mode: "stdio",
command: "pnpm",
args: ["dlx", "@iqai/mcp-fraxlend"],
env: {
WALLET_PRIVATE_KEY: process.env.WALLET_PRIVATE_KEY,
PATH: process.env.PATH || "",
},
},
})
const tools = await toolset.getTools(){
"mcpServers": {
"fraxlend-server": {
"command": "pnpm",
"args": ["dlx", "@iqai/mcp-fraxlend"],
"env": {
"WALLET_PRIVATE_KEY": "your_wallet_private_key_here"
}
}
}
}Features
- Interact with the Fraxlend lending platform
- Fetch statistics for a specific Fraxlend pair
- Lend assets to a specific Fraxlend pair
- Borrow assets from a specific Fraxlend pair
- Add collateral to a specific Fraxlend pair
- Remove collateral from a specific Fraxlend pair
- Repay borrowed assets to a specific Fraxlend pair
- Withdraw lent assets from a specific Fraxlend pair
- Get the pair address for a specific Fraxlend pair
Available Tools
FRAXLEND_ADD_COLLATERALpairAddress:stringamount:string
FRAXLEND_ADD_COLLATERALDescription
Add collateral to a FraxLend position
FRAXLEND_GET_POSITIONSaddress:string
FRAXLEND_GET_POSITIONSDescription
Get your positions in FraxLend pools
FRAXLEND_BORROWpairAddress:stringreceiver:stringcollateralAmount:stringborrowAmount:string
FRAXLEND_BORROWDescription
Borrow assets from a FraxLend pool
FRAXLEND_GET_STATSNo parameters
FRAXLEND_GET_STATSNo parameters
Description
Get lending statistics from FraxLend pools
FRAXLEND_LENDpairAddress:stringamount:string
FRAXLEND_LENDDescription
Lend assets to a FraxLend pool
FRAXLEND_GET_PAIR_ADDRESSassetSymbol:stringcollateralSymbol:stringsortByApr:string
FRAXLEND_GET_PAIR_ADDRESSDescription
Get FraxLend pair addresses and pool information
FRAXLEND_REMOVE_COLLATERALpairAddress:stringamount:string
FRAXLEND_REMOVE_COLLATERALDescription
Remove collateral from a FraxLend position
FRAXLEND_REPAYpairAddress:stringamount:string
FRAXLEND_REPAYDescription
Repay borrowed assets to a FraxLend pool
FRAXLEND_WITHDRAWpairAddress:stringamount:string
FRAXLEND_WITHDRAWDescription
Withdraw assets from a FraxLend pool
Environment Variables
Security
The private key is used for signing transactions for lending, borrowing, etc. Handle with care.
WALLET_PRIVATE_KEY: Required forLEND,BORROW,ADD_COLLATERAL,REMOVE_COLLATERAL,REPAY,WITHDRAW
Usage Examples
- "Show my current FraxLend positions"
- "I want to lend 100 FRAX to the FRAX-ETH pool at 0x123...abc"
- "Borrow 1000 FRAX using 2 ETH as collateral from the pool at 0x123...abc"
- "What's the pair address for FRAX-ETH pool with the highest APR?"
Response Format
Actions return structured responses, including:
ā Transaction status & hash (for lending/borrowing) š ā Formatted asset amounts š² ā Error messages when applicable ā ā Lending market details š
Error Handling
The plugin handles various error scenarios:
šØ Invalid market addresses šø Insufficient collateral or liquidity š Transaction failures š Network issues š Input validation errors