Fluid MCP Server
Allows interaction with the Fluid DeFi protocol on Ethereum, enabling AI agents to query liquidity, lending, vault, and DEX data, and build unsigned transactions for deposits, withdrawals, swaps, and vault management.
Allows interaction with the Fluid DeFi protocol on Polygon, enabling AI agents to query liquidity, lending, vault, and DEX data, and build unsigned transactions for deposits, withdrawals, swaps, and vault management.
Click 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., "@Fluid MCP Server get current supply rates for USDC on Ethereum"
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.
EXPERMINTAL MODE ONLY
Fluid MCP Server
A production-ready Model Context Protocol (MCP) server that enables AI agents to interact with the Fluid DeFi Protocol across all supported chains.
Fluid is a next-generation DeFi protocol by Instadapp that unifies lending, borrowing, and DEX trading into a single capital-efficient liquidity layer.
Supported Chains
Chain | Chain ID | Protocols |
Ethereum | 1 | Liquidity, Lending, Vault, DEX |
Arbitrum | 42161 | Liquidity, Lending, Vault, DEX |
Base | 8453 | Liquidity, Lending, Vault, DEX |
Polygon | 137 | Liquidity, Lending, Vault, DEX |
Related MCP server: @y0exchange/mcp
Quick Start
Install & Run
# Install globally
npm install -g fluid-mcp-server
# Or run directly with npx
npx fluid-mcp-serverAdd to Claude Desktop
Add to your Claude Desktop config (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"fluid": {
"command": "npx",
"args": ["fluid-mcp-server"]
}
}
}Add to Claude Code
claude mcp add fluid -- npx fluid-mcp-serverBuild from Source
git clone https://github.com/ahmadmardeni1/fluid-mcp-server.git
cd fluid-mcp-server
npm install
npm run build
npm startArchitecture
graph TB
subgraph "AI Agent Layer"
Agent[AI Agent / LLM]
MCP[MCP Client]
end
subgraph "Fluid MCP Server"
Server[MCP Server Entry Point]
subgraph "READ Tools"
LR[Liquidity Read]
LendR[Lending Read]
VR[Vault Read]
DR[DEX Read]
end
subgraph "WRITE Tools"
LendW[Lending Write]
VW[Vault Write]
DW[DEX Write]
end
Config[Chain Config]
ABIs[ABI Definitions]
Provider[Provider Manager]
end
subgraph "Fluid Protocol (On-Chain)"
LL[Liquidity Layer]
LP[Lending Protocol / fTokens]
VP[Vault Protocol]
DEX[DEX Protocol]
subgraph "Resolvers"
LiqR[LiquidityResolver]
LendRes[LendingResolver]
VaultRes[VaultResolver]
DexRes[DexReservesResolver]
end
end
Agent --> MCP
MCP --> Server
Server --> LR & LendR & VR & DR
Server --> LendW & VW & DW
LR & LendR & VR & DR --> Provider
LendW & VW & DW --> Provider
Provider --> Config & ABIs
Provider --> LiqR & LendRes & VaultRes & DexRes
LiqR --> LL
LendRes --> LP
VaultRes --> VP
DexRes --> DEXTool Reference
READ Tools (No wallet required)
These tools query on-chain data through Fluid's resolver contracts. They are completely read-only and require no wallet or private key.
Liquidity Layer
Tool | Description |
| List all tokens in the Liquidity Layer |
| Get supply/borrow rates for a specific token |
| Dashboard view of all tokens with rates and TVL |
| Query a user's supply position for a token |
| Query a user's borrow position for a token |
| Get protocol revenue for a token |
Lending Protocol (fTokens)
Tool | Description |
| List all fToken addresses |
| Get details for a specific fToken (rates, TVL, asset) |
| Dashboard view of all fTokens |
| Get user's position in an fToken pool |
| Get reward program info for an fToken |
Vault Protocol
Tool | Description |
| List all vault addresses |
| Get comprehensive vault data (rates, limits, totals) |
| Dashboard view of all vaults |
| Get a position by NFT ID |
| Get all positions owned by a user |
| Get available liquidation opportunities |
DEX Protocol
Tool | Description |
| List all DEX pool addresses |
| Get reserves for a specific pool |
| Get reserves for all pools |
| Get adjusted reserves (for swap math) |
| Estimate output for a given input |
| Estimate required input for a desired output |
WRITE Tools (Wallet required)
These tools build unsigned transaction data. The calling agent must sign and broadcast the transaction using the user's wallet.
Lending Operations
Tool | Description |
| Build deposit tx (ERC20 → fToken) |
| Build native ETH deposit tx |
| Build withdrawal tx (fToken → asset) |
| Build redeem tx (burn shares for assets) |
| Build ERC20 approval tx |
Vault Operations
Tool | Description |
| Open new vault position (deposit + optional borrow) |
| Modify existing position (add/remove collateral, borrow/repay) |
| Close position (repay all + withdraw all) |
DEX Operations
Tool | Description |
| Build swap tx with exact input amount |
| Build swap tx for exact output amount |
Protocol Flow Diagrams
Lending Flow (Deposit & Earn)
sequenceDiagram
participant Agent as AI Agent
participant MCP as MCP Server
participant Chain as Blockchain
participant fToken as fToken Contract
participant LL as Liquidity Layer
Note over Agent,LL: Step 1: Research
Agent->>MCP: fluid_get_all_ftokens_details(chain)
MCP->>Chain: LendingResolver.getAllFTokensDetails()
Chain-->>MCP: [fToken details with rates]
MCP-->>Agent: Best APY opportunities
Note over Agent,LL: Step 2: Approve (if ERC20)
Agent->>MCP: fluid_build_token_approve(token, fToken)
MCP-->>Agent: Unsigned approval tx
Agent->>Chain: Sign & send approval
Note over Agent,LL: Step 3: Deposit
Agent->>MCP: fluid_build_lending_deposit(fToken, amount, receiver)
MCP-->>Agent: Unsigned deposit tx + preview shares
Agent->>Chain: Sign & send deposit tx
Chain->>fToken: deposit(assets, receiver)
fToken->>LL: Supply to Liquidity Layer
fToken-->>Agent: fToken shares mintedVault Flow (Borrow Against Collateral)
sequenceDiagram
participant Agent as AI Agent
participant MCP as MCP Server
participant Chain as Blockchain
participant Vault as Vault Contract
participant LL as Liquidity Layer
Note over Agent,LL: Step 1: Find a vault
Agent->>MCP: fluid_get_all_vaults_data(chain)
MCP->>Chain: VaultResolver.getAllVaultsEntireData()
Chain-->>MCP: [All vaults with rates, limits, LTV]
MCP-->>Agent: Available vaults + collateral factors
Note over Agent,LL: Step 2: Open position
Agent->>MCP: fluid_build_vault_open(vault, collateral, borrow, receiver)
MCP-->>Agent: Unsigned operate() tx
Agent->>Chain: Sign & send tx
Chain->>Vault: operate(0, +col, +debt, to)
Vault->>LL: Deposit collateral + borrow from Liquidity
Vault-->>Agent: NFT minted (position ID)
Note over Agent,LL: Step 3: Monitor health
Agent->>MCP: fluid_get_vault_position(nftId)
MCP->>Chain: VaultResolver.positionByNftId()
Chain-->>MCP: Position data
MCP-->>Agent: Supply, borrow, LTV, health
Note over Agent,LL: Step 4: Repay & close
Agent->>MCP: fluid_build_vault_close(vault, nftId, receiver)
MCP-->>Agent: Unsigned close tx
Agent->>Chain: Sign & send tx
Chain->>Vault: operate(nftId, MIN, MIN, to)
Vault-->>Agent: All collateral returnedDEX Swap Flow
sequenceDiagram
participant Agent as AI Agent
participant MCP as MCP Server
participant Chain as Blockchain
participant Pool as DEX Pool
participant Res as DexReservesResolver
Note over Agent,Res: Step 1: Discover pools
Agent->>MCP: fluid_get_all_pools_reserves(chain)
MCP->>Chain: DexResolver.getAllPoolsReserves()
Chain-->>MCP: [All pools with token pairs & reserves]
MCP-->>Agent: Available trading pairs
Note over Agent,Res: Step 2: Get quote
Agent->>MCP: fluid_estimate_swap_in(pool, direction, amountIn)
MCP->>Chain: Fetch adjusted reserves + estimate
Chain-->>MCP: Estimated output
MCP-->>Agent: Quote with price impact
Note over Agent,Res: Step 3: Execute swap
Agent->>MCP: fluid_build_swap_exact_input(pool, direction, amountIn, slippage, receiver)
MCP->>Chain: Fetch reserves + calculate minOutput
MCP-->>Agent: Unsigned swap tx with slippage protection
Agent->>Chain: Sign & send swap tx
Chain->>Pool: swapIn(direction, amountIn, minOut, to)
Pool-->>Agent: Output tokens receivedTransaction Signing
This MCP server follows a non-custodial design. Write tools return unsigned transaction data — the JSON response contains:
{
"chain": "ethereum",
"action": "deposit",
"to": "0x...", // Contract to call
"data": "0x...", // Encoded calldata
"value": "0", // ETH value to send (wei)
"description": "...",
"note": "..."
}The calling agent is responsible for:
Connecting to the user's wallet (e.g., via ethers.js, web3.js, or wallet SDK)
Signing the transaction with the user's private key
Broadcasting the signed transaction to the blockchain
Monitoring the transaction for confirmation
Example (ethers.js v6):
import { ethers } from "ethers";
// After receiving tx data from MCP tool:
const wallet = new ethers.Wallet(PRIVATE_KEY, provider);
const tx = await wallet.sendTransaction({
to: toolResult.to,
data: toolResult.data,
value: BigInt(toolResult.value),
});
const receipt = await tx.wait();Custom RPC URLs
Every tool accepts an optional rpc_url parameter to use a custom RPC endpoint instead of the default public one. This is recommended for production use to avoid rate limits.
{
"chain": "ethereum",
"rpc_url": "https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY"
}Environment Variables
Variable | Description | Default |
| Custom RPC for Ethereum | Public RPC |
| Custom RPC for Arbitrum | Public RPC |
| Custom RPC for Base | Public RPC |
| Custom RPC for Polygon | Public RPC |
Resources
The server exposes two MCP resources:
fluid://chains— Supported chains and available protocols per chainfluid://overview— Protocol architecture overview with links
Prompts
Three built-in prompts guide agents through common workflows:
analyze-lending-rates— Find the best lending yield opportunitiescheck-vault-health— Assess a vault position's health and riskfind-swap-route— Find optimal swap routes on Fluid DEX
Project Structure
fluid-mcp-server/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── config/
│ │ └── chains.ts # Multi-chain contract addresses
│ ├── abis/
│ │ └── index.ts # Minimal ABI definitions
│ ├── tools/
│ │ ├── index.ts # Tool registry
│ │ ├── liquidity-read.ts # Liquidity Layer queries
│ │ ├── lending-read.ts # fToken lending queries
│ │ ├── vault-read.ts # Vault protocol queries
│ │ ├── dex-read.ts # DEX pool queries + swap estimates
│ │ ├── lending-write.ts # Lending transaction builders
│ │ ├── vault-write.ts # Vault transaction builders
│ │ └── dex-write.ts # DEX swap transaction builders
│ └── utils/
│ ├── provider.ts # Ethers.js provider management
│ └── formatting.ts # Data formatting utilities
├── package.json
├── tsconfig.json
├── README.md
└── LICENSETesting & Example Tool Calls
You can exercise the MCP server directly over stdio using raw JSON‑RPC.
From the project root (after npm run build):
# 1) List all fTokens on Ethereum
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fluid_get_all_ftokens","arguments":{"chain":"ethereum"}}}' \
| node dist/index.js
# 2) Get detailed info for a specific fToken (fUSDC on Ethereum)
echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"fluid_get_ftoken_details","arguments":{"chain":"ethereum","ftoken_address":"0x9Fb7b4477576Fe5B32be4C1843aFB1e55F251B33"}}}' \
| node dist/index.js
# 3) Build an unsigned deposit tx into fUSDC (100 USDC, 6 decimals)
echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"fluid_build_lending_deposit","arguments":{"chain":"ethereum","ftoken_address":"0x9Fb7b4477576Fe5B32be4C1843aFB1e55F251B33","amount":"100000000","receiver":"0xYOUR_ADDRESS"}}}' \
| node dist/index.js
# 4) List all vaults on Ethereum with their types (T1–T4)
echo '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"fluid_get_all_vaults","arguments":{"chain":"ethereum"}}}' \
| node dist/index.js
# 5) Build an unsigned Vault T1 operate() tx (open position)
# Example: ETH/GHO T1 vault on Ethereum
echo '{"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"fluid_build_vault_t1_operate","arguments":{"chain":"ethereum","vault_address":"0xD9A7Dcdc57C6e44f00740dC73664fA456B983669","nft_id":0,"new_col":"100000000000000000","new_debt":"200000000000000000000","receiver":"0xYOUR_ADDRESS"}}}' \
| node dist/index.jsEach call returns a JSON‑RPC response where result.content[0].text contains a JSON payload (either on‑chain data or an unsigned transaction description).
Contract Address Updates
Fluid's resolver contracts are periodically redeployed as the protocol evolves. The addresses in src/config/chains.ts are accurate as of the build date.
To get the latest addresses, check:
References
License
MIT
Available Tools
24 toolsfluid_build_lending_depositA
Build an unsigned transaction to deposit assets into a Fluid fToken lending pool. Returns the transaction data that must be signed and sent by the agent's wallet. Uses the ERC4626 deposit() method.
Inputs: chain (required), amount (required), receiver (required), ftoken_address (required), +1 more.
fluid_build_lending_deposit_nativeA
Build an unsigned transaction to deposit native ETH into a Fluid fToken lending pool (for ETH-based fTokens). No approval needed.
Inputs: chain (required), amount (required), receiver (required), ftoken_address (required), +1 more.
fluid_build_lending_mintA
Build an unsigned transaction to mint a specific number of fToken shares by depositing underlying assets.
Inputs: chain (required), shares (required), receiver (required), ftoken_address (required), +1 more.
fluid_build_lending_redeemA
Build an unsigned transaction to redeem fToken shares for underlying assets. Specify how many shares to burn rather than how many assets to receive.
Inputs: chain (required), owner (required), shares (required), receiver (required), +2 more.
fluid_build_lending_withdrawA
Build an unsigned transaction to withdraw underlying assets from a Fluid fToken lending pool. Burns fToken shares in exchange for underlying assets.
Inputs: chain (required), owner (required), amount (required), receiver (required), +2 more.
fluid_build_lending_withdraw_nativeA
Build an unsigned transaction to withdraw native ETH from a Fluid fToken lending pool.
Inputs: chain (required), owner (required), amount (required), receiver (required), +2 more.
fluid_build_token_approveA
Build an unsigned transaction to approve an ERC20 token for spending by a Fluid contract (fToken, vault, DEX pool). Required before deposit/supply operations.
Inputs: chain (required), spender (required), token_address (required), amount, +1 more.
fluid_build_vault_t1_operateA
Build an unsigned transaction to interact with a Vault T1 (single-asset collateral, single-asset debt). T1 operate function is payable.
Inputs: chain (required), nft_id (required), new_col (required), new_debt (required), +3 more.
fluid_build_vault_t2_operateC
Build an unsigned transaction to interact with a Vault T2 (dual-asset collateral, single-asset debt).
Inputs: chain (required), nft_id (required), new_debt (required), receiver (required), +6 more.
fluid_build_vault_t3_operateB
Build an unsigned transaction to interact with a Vault T3 (single-asset collateral, dual-asset debt).
Inputs: chain (required), nft_id (required), new_col (required), receiver (required), +6 more.
fluid_build_vault_t4_operateB
Build an unsigned transaction to interact with a Vault T4 (dual-asset collateral, dual-asset debt).
Inputs: chain (required), nft_id (required), receiver (required), vault_address (required), +9 more.
fluid_get_all_ftokensB
List all fToken (Fluid lending token) addresses on a chain. fTokens are ERC4626-compliant and represent a user's share in the lending pool.
Inputs: chain (required), rpc_url.
fluid_get_all_ftokens_detailsA
Get details for ALL fTokens on a chain in a single call — names, rates, TVL, and underlying assets. Perfect for a lending dashboard.
Inputs: chain (required), rpc_url.
fluid_get_all_vaultsA
List all Fluid vault addresses on a chain. Returns vault addresses and their types (T1, T2, T3, T4).
Inputs: chain (required), rpc_url.
fluid_get_ftoken_detailsA
Get detailed information about a specific fToken including name, symbol, underlying asset, supply rate, rewards rate, total assets, and total supply.
Inputs: chain (required), ftoken_address (required), rpc_url.
fluid_get_previewsA
Get conversion previews for deposit/mint/withdraw/redeem operations on an fToken. Useful for estimating output before transacting.
Inputs: chain (required), ftoken_address (required), assets, shares, +1 more.
fluid_get_total_positionsA
Get the total number of vault positions (NFTs) across all vaults on a chain.
Inputs: chain (required), rpc_url.
fluid_get_user_all_positionsA
Get all of a user's lending positions across all fTokens on a chain. Returns combined fToken details and user position data.
Inputs: chain (required), user_address (required), rpc_url.
fluid_get_user_lending_positionB
Get a user's position in a specific fToken lending pool. Returns fToken shares, underlying asset value, wallet balance, and allowance.
Inputs: chain (required), user_address (required), ftoken_address (required), rpc_url.
fluid_get_user_vault_nft_idsB
Get all vault position NFT IDs owned by a specific user address.
Inputs: chain (required), user_address (required), rpc_url.
fluid_get_vault_by_nftB
Get the vault address and decoded position summary for a specific vault position NFT ID.
Inputs: chain (required), nft_id (required), rpc_url.
fluid_get_vault_dataA
Get comprehensive data for a specific Fluid vault: supply/borrow tokens with symbols, rates as APY, human-readable collateral factor, liquidation threshold, LTV limits, total supply/borrow, and availability limits.
Inputs: chain (required), vault_address (required), rpc_url.
fluid_get_vault_positionB
Get a specific vault position by its NFT ID. Each Fluid vault position is represented as an NFT. Returns decoded supply (collateral), borrow (debt) in human-readable token amounts, liquidation status, vault config, and rates.
Inputs: chain (required), nft_id (required), rpc_url.
fluid_get_vault_typeA
Get the type of a specific vault (T1, T2, T3, or T4). T1=10000, T2=20000, T3=30000, T4=40000.
Inputs: chain (required), vault_address (required), rpc_url.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Most tools are cleanly separated by resource and action, but fluid_get_vault_position and fluid_get_vault_by_nft overlap heavily since both resolve a vault position by NFT ID. The get_all_ftokens vs get_all_ftokens_details pair is also easy to confuse even though one returns only addresses.
All tools follow a consistent fluid_ prefix with either get_ or build_ followed by a descriptive noun phrase. Deposit/mint/withdraw/redeem and T1-T4 vault variants follow a clear, predictable pattern with no mixed conventions.
24 tools sits in the borderline heavy 16-25 band. The count is understandable for a server covering both fToken lending and vault operations, but some getters could be consolidated and the native-ETH lending variants add bulk.
The tool surface covers the full core lifecycle for both fToken lending and vaults: reading positions, fetching rates/config, previewing conversions, building approvals, and constructing deposit/mint/withdraw/redeem and vault operate transactions. Common workflows have no obvious dead ends.
Maintenance
Related MCP Connectors
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for the Z1N Protocol - on-chain identity for AI agents on Polygon
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
AlicenseCqualityDmaintenanceAn MCP server providing unified access to blockchain operations, bridging, swapping, and crypto trading strategies for AI agents.37178GPL 3.0- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents real-time access to DeFi across multiple chains, enabling non-custodial crypto trading, portfolio queries, and transaction execution.7 npm7MIT

Syeniteofficial
FlicenseNot gradedqualityCmaintenanceA DeFi MCP server enabling AI agents to query lending rates, execute swaps/bridges, monitor positions, and access prediction markets across 30+ chains with a trust layer for calldata verification.-- AlicenseNot gradedqualityCmaintenanceMCP server that lets any AI agent operate a wallet directly on-chain: create wallets, send, swap, bridge, and deploy contracts across EVM and Bitcoin networks.1MIT