lends-mcp-server
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@lends-mcp-servershow my lending positions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LENDS MCP Server
Local Model Context Protocol server for LENDS lending/borrowing, the leUSD PSM, and sleUSD staking.
The server exposes:
on-chain protocol, market, position, token, PSM, staking, unstake, and read-only liquidation-plan tools;
unsigned transaction construction for approvals, lending, repayment, PSM conversion, and the sleUSD stake/unstake lifecycle;
deterministic protocol-math tools using raw integer units.
It contains no signer, accepts no private key, never broadcasts, and exposes no admin, liquidation-execution, reserve, harvest, loss, configuration, pause, ownership, upgrade, LENDS purchase, lock, liquidity, or vesting action.
Install and run
Publish or install @lendsprotocol/sdk first, then:
npm install -g @lendsprotocol/mcp-server
LENDS_RPC_URL=https://your-rpc.example lends-mcpLENDS_RPC_URL is read from the child process environment. It is required only for on-chain read tools; transaction builders and math tools work offline. The server uses stdio, so an MCP client starts it as a local child process—there is no HTTP API or hosted LENDS service.
Example MCP client configuration:
{
"mcpServers": {
"lends": {
"command": "lends-mcp",
"env": {
"LENDS_RPC_URL": "https://your-rpc.example"
}
}
}
}For a local checkout, use "command": "node" and "args": ["/absolute/path/to/lends-mcp-server/dist/index.js"].
Related MCP server: DorkFiMCP
Inputs and outputs
All uint256-compatible inputs are unsigned base-10 strings, not JSON numbers. This prevents precision loss:
{
"collateral": "0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",
"amount": "1000000000000000000"
}Big integers in results are also base-10 strings. Prepared transactions contain only to, data, value, and chainId; the calling wallet must review, sign, and submit them.
Development
npm ci
npm run check
npm test
npm run buildAvailable Tools
37 toolslends_assert_chainLends Assert ChainARead-onlyIdempotent
Verify that LENDS_RPC_URL serves the configured deployment chain.
Inputs: no named parameters.
lends_get_liquidation_planLends Get Liquidation PlanARead-onlyIdempotent
Read liquidation eligibility and projected coverage without executing liquidation.
Inputs: owner (required), collateral (required).
lends_get_marketLends Get MarketARead-onlyIdempotent
Read one collateral market by token address.
Inputs: collateral (required).
lends_get_marketsLends Get MarketsARead-onlyIdempotent
List configured collateral markets with risk parameters and oracle state.
Inputs: no named parameters.
lends_get_positionLends Get PositionBRead-onlyIdempotent
Read a borrower's collateral position and derived debt, health, and capacity.
Inputs: owner (required), collateral (required), timestamp.
lends_get_protocol_stateLends Get Protocol StateARead-onlyIdempotent
Read a block-consistent snapshot of public LENDS protocol and PSM state.
Inputs: no named parameters.
lends_get_staking_stateLends Get Staking StateARead-onlyIdempotent
Read public sleUSD pool, capacity, cooldown, claim, and vesting state.
Inputs: no named parameters.
lends_get_token_stateLends Get Token StateBRead-onlyIdempotent
Read ERC-20 metadata, owner balance, total supply, and selected allowances.
Inputs: owner (required), token (required), spenders.
lends_get_unstake_requestLends Get Unstake RequestARead-onlyIdempotent
Read one sleUSD unstake request by unsigned request ID.
Inputs: requestId (required).
lends_math_collateral_valueLends Math Collateral ValueBRead-onlyIdempotent
Calculate raw 6-decimal leUSD collateral value.
Inputs: priceE8 (required), collateralRaw (required), collateralDecimals (required).
lends_math_convert_decimals_exactLends Math Convert Decimals ExactARead-onlyIdempotent
Convert raw units between decimal scales, returning null if downscaling is inexact.
Inputs: amount (required), toDecimals (required), fromDecimals (required).
lends_math_health_factorLends Math Health FactorARead-onlyIdempotent
Calculate health factor in basis points; returns null when debt is zero.
Inputs: debtLeusd (required), valueLeusd (required), liquidationThresholdBps (required).
lends_math_liquidation_priceLends Math Liquidation PriceARead-onlyIdempotent
Calculate the 8-decimal liquidation price; returns null without debt or collateral.
Inputs: debtLeusd (required), collateralRaw (required), collateralDecimals (required), liquidationThresholdBps (required).
lends_math_max_borrowLends Math Max BorrowBRead-onlyIdempotent
Calculate maximum raw leUSD debt at a borrow LTV.
Inputs: valueLeusd (required), borrowLtvBps (required).
lends_math_pending_vault_feeLends Math Pending Vault FeeARead-onlyIdempotent
Calculate projected simple vault fees with contract-equivalent floor rounding.
Inputs: debt (required), timestamp (required), lastAccrualTs (required), stabilityFeeAprBps (required).
lends_math_scale_price_to_e8Lends Math Scale Price To E8CRead-onlyIdempotent
Normalize a positive oracle answer to 8 decimals.
Inputs: answer (required), decimals (required).
lends_math_withdrawable_collateralLends Math Withdrawable CollateralBRead-onlyIdempotent
Calculate maximum raw collateral withdrawal while retaining borrow-LTV safety.
Inputs: priceE8 (required), debtLeusd (required), borrowLtvBps (required), collateralRaw (required), +1 more.
lends_prepare_accrue_feeLends Prepare Accrue FeeBRead-onlyIdempotent
Construct a permissionless vault fee-accrual transaction.
Inputs: borrower (required), collateral (required).
lends_prepare_approveLends Prepare ApproveBRead-onlyIdempotent
Construct an exact ERC-20 approval transaction; amount 0 revokes approval.
Inputs: token (required), amount (required), spender (required).
lends_prepare_approve_collateralLends Prepare Approve CollateralCRead-onlyIdempotent
Construct collateral approval for the LENDS protocol.
Inputs: amount (required), collateral (required).
lends_prepare_approve_leusd_for_psmLends Prepare Approve Leusd For PsmARead-onlyIdempotent
Construct leUSD approval for a PSM swap out to USDG.
Inputs: amount (required).
lends_prepare_approve_leusd_for_repayLends Prepare Approve Leusd For RepayARead-onlyIdempotent
Construct leUSD approval for protocol repayment.
Inputs: amount (required).
lends_prepare_approve_leusd_for_stakingLends Prepare Approve Leusd For StakingARead-onlyIdempotent
Construct leUSD approval for sleUSD staking.
Inputs: amount (required).
lends_prepare_approve_usdg_for_psmLends Prepare Approve Usdg For PsmARead-onlyIdempotent
Construct USDG approval for a PSM swap into leUSD.
Inputs: amount (required).
lends_prepare_borrowLends Prepare BorrowBRead-onlyIdempotent
Construct a leUSD borrowing transaction against collateral.
Inputs: amount (required), collateral (required).
lends_prepare_cancel_expired_unstakeLends Prepare Cancel Expired UnstakeARead-onlyIdempotent
Construct a transaction to recover shares from an expired unstake request.
Inputs: requestId (required).
lends_prepare_complete_unstakeLends Prepare Complete UnstakeBRead-onlyIdempotent
Construct a transaction to complete a claimable unstake request.
Inputs: requestId (required).
lends_prepare_depositLends Prepare DepositARead-onlyIdempotent
Construct a collateral deposit transaction.
Inputs: amount (required), collateral (required).
lends_prepare_psm_swap_inLends Prepare Psm Swap InBRead-onlyIdempotent
Construct an exact USDG-to-leUSD PSM transaction.
Inputs: usdgAssets (required).
lends_prepare_psm_swap_outLends Prepare Psm Swap OutBRead-onlyIdempotent
Construct an exact leUSD-to-USDG PSM transaction.
Inputs: leusdAmount (required).
lends_prepare_repayLends Prepare RepayARead-onlyIdempotent
Construct a leUSD repayment transaction with a maximum raw amount.
Inputs: maxAmount (required), collateral (required).
lends_prepare_request_unstakeLends Prepare Request UnstakeCRead-onlyIdempotent
Construct an sleUSD unstake-request transaction.
Inputs: shares (required).
lends_prepare_stakeLends Prepare StakeBRead-onlyIdempotent
Construct a leUSD stake transaction with an explicit minimum sleUSD share output.
Inputs: amount (required), minSharesOut (required).
lends_prepare_withdrawLends Prepare WithdrawBRead-onlyIdempotent
Construct a collateral withdrawal transaction.
Inputs: amount (required), collateral (required).
lends_quote_psm_swap_inLends Quote Psm Swap InBRead-onlyIdempotent
Quote exact USDG-to-leUSD PSM conversion and current availability.
Inputs: usdgAssets (required).
lends_quote_psm_swap_outLends Quote Psm Swap OutARead-onlyIdempotent
Quote exact leUSD-to-USDG PSM conversion and current availability.
Inputs: leusdAmount (required).
lends_quote_stakeLends Quote StakeARead-onlyIdempotent
Preview sleUSD shares for a raw leUSD amount using current pool state.
Inputs: amount (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 37 tools
Tools are grouped by category (math/get/quote/prepare/assert) and mostly map to distinct resources and actions. Some overlap exists between the generic approve tool and the five purpose-specific approval tools, but descriptions are clear enough to disambiguate.
All tools share the lends_ prefix and follow a consistent lends_<category>_<action/noun> snake_case pattern. Even long names remain predictable and readable.
At 37 tools, the surface is well above the 25-tool threshold and feels heavy, especially with six approval variants and eight math helpers. The protocol scope is broad, but consolidation would make the set more manageable.
Core user lifecycle operations for collateral, borrowing, PSM swaps, staking, and unstaking are well covered. However, there is no prepare or execute liquidation transaction despite the presence of get_liquidation_plan, leaving a notable gap in the liquidation workflow.
Maintenance
Related MCP Connectors
Official Aave MCP for V3 and V4 markets, positions, governance, and transaction preparation.
Leveraged-yield router on Morpho. List strategies, simulate, and build UNSIGNED txs.
Browse, deposit, withdraw & rebalance stablecoins on Aave, Morpho & Euler across major EVM chains.
Read-only THORChain swap quotes, liquidity pools, and network status.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables read and write access to the Celo blockchain including balance checks, token transfers, swaps, agent identity (ERC-8004), and x402 micropayments, returning unsigned transactions for user signing.-
- AlicenseAqualityDmaintenanceEnables interaction with the DorkFi lending protocol on Voi and Algorand, supporting market discovery, position queries, liquidation scanning, and transaction preparation without signing or broadcasting.10MIT

cork-defiofficial
FlicenseNot gradedqualityBmaintenanceEnables interaction with the Cork DeFi protocol for reading live chain state, computing bit-exact math, building unsigned bundles and orders, and managing markets, all without signing or broadcasting.-- AlicenseNot gradedqualityBmaintenanceEnables agents to interact with the Pons launchpad on Robinhood Chain, providing live protocol data, token launch, trading, and wallet operations through a read-only default with explicit signing opt-in.56 npmMIT