MCP Fraxlend
Interact with Fraxlend lending pairs — supply, borrow, repay, and query positions on the Frax ecosystem.
- Package:
@iqai/mcp-fraxlend - Provider: IQ AI
Overview
The Fraxlend MCP server lets your agent interact with Fraxlend lending pairs on the Frax protocol. It supports supplying assets, borrowing, repaying loans, managing collateral, and querying current lending pair data — all requiring a wallet private key for on-chain execution.
Private Key Security
This server signs on-chain transactions using your wallet private key. Never commit your private key to source control. Always load it from a secure environment variable.
Getting Started
Install the package:
pnpm add @iqai/mcp-fraxlendUse the server in your agent:
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: "npx",
args: ["-y", "@iqai/mcp-fraxlend"],
env: {
WALLET_PRIVATE_KEY: process.env.WALLET_PRIVATE_KEY,
PATH: process.env.PATH || "",
},
},
});
const tools = await toolset.getTools();{
"mcpServers": {
"fraxlend-mcp-server": {
"command": "npx",
"args": ["-y", "@iqai/mcp-fraxlend"],
"env": {
"WALLET_PRIVATE_KEY": "your_wallet_private_key_here"
}
}
}
}Environment Variables
| Variable | Required | Description |
|---|---|---|
WALLET_PRIVATE_KEY | Yes | Private key of the wallet used to sign Fraxlend transactions |
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
Integration Example
import { AgentBuilder, McpFraxlend } from "@iqai/adk";
import * as dotenv from "dotenv";
dotenv.config();
async function main() {
// Initialize McpFraxlend toolset
const toolset = McpFraxlend({
env: {
WALLET_PRIVATE_KEY: process.env.WALLET_PRIVATE_KEY,
},
});
// Get available McpFraxlend tools
const fraxlendTools = await toolset.getTools();
// Create agent with McpFraxlend tools
const { runner } = await AgentBuilder.create("fraxlend_agent")
.withModel("gemini-2.5-flash")
.withDescription("A DeFi agent that manages Fraxlend lending positions")
.withTools(...fraxlendTools)
.build();
const response = await runner.ask(
"Show me all available Fraxlend lending pairs and their current interest rates",
);
console.log(response);
}
main().catch(console.error);