Pendle Finance MCP Server
Provides DeFi protocol integration through Pendle Finance, enabling yield farming operations, staking simulations, swap transactions, and portfolio management on Ethereum testnet
Built using FastAPI framework to expose MCP endpoints for DeFi operations and AI-based financial predictions
Mentioned as an optional enhancement for implementing machine learning models to replace random predictions with historical yield analysis and portfolio optimization
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Pendle Finance FastMCP Server π
This repository contains a Model Context Protocol (MCP) Server built with FastMCP in Python.
It connects to Pendle Finance DeFi Protocol and exposes endpoints for AI agents or clients like MCP Inspector.
Features include:
Fetching live yields from Pendle API
Simulating staking and swaps
Retrieving user DeFi portfolio
AI-based token recommendations (simulated)
AI future yield predictions (simulated)
β Setup and Installation
Prerequisites
Python 3.10+ installed on your system
Node.js 16+ if you want to use MCP Inspector
Clone This Repo
git clone https://github.com/maneesa029/Pendle_mcp cd Pendle_mcp
Create and Activate a Virtual Environment
Create virtual environment
python -m venv venv
Windows
.\venv\Scripts\activate
macOS/Linux
source venv/bin/activate
Install Dependencies
pip install -r requirements.txt
Configure .env
Create a .env file in the root folder and add your configuration:
FastAPI settings
FASTAPI_ENV=development HOST=127.0.0.1 PORT=8000
Pendle API (no secret key needed for public endpoints)
PENDLE_API_URL=https://api.pendle.finance/v1/yields
Ethereum testnet (if using staking simulation or swaps)
RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY PRIVATE_KEY=0xYOUR_TEST_PRIVATE_KEY
β Security Warning: Do NOT use your main wallet private key with real funds. Always use a testnet key or a small segregated account for testing.
π¬ Running and Monitoring the Server
Start the Pendle MCP Server
uvicorn server:app --reload --port 8000
You should see:
INFO: Uvicorn running on http://127.0.0.1:8000 INFO: Application startup complete.
Open MCP Inspector (Optional)
If you want to test tools interactively:
npx @modelcontextprotocol/inspector
This will launch a local URL (e.g., http://127.0.0.1:6274)
Open the URL in your browser
In Tools tab, youβll see all exposed Pendle MCP functions:
get_yield β fetch top yields
stake β simulate staking
swap β simulate swap
portfolio β user portfolio
predict_best_token β AI-recommended token
predict_future β future yield prediction
β 3. Test via Python Client
test_client.py
import requests
BASE = "http://127.0.0.1:8000"
print(requests.get(f"{BASE}/get_yield").json()) print(requests.post(f"{BASE}/stake", json={"user_address":"0x123","token":"PENDLE","amount":10}).json()) print(requests.get(f"{BASE}/predict_best_token").json())
πΉ Features
Fetch live Pendle yields from API
Simulate staking and swaps
Retrieve user DeFi portfolio
AI predicts best token to stake
AI predicts future yields for N days
Works seamlessly with MCP Inspector or any AI agent
πΉ Optional AI Improvements
Replace random predictions with historical yield ML model (scikit-learn / Prophet)
Include portfolio optimization for multiple tokens
Connect Ethereum testnet to simulate real transactions
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Crypto yield data for AI agents: lending, savings, staking, borrowing & stablecoin rates. 21 tools.
Underwritten DeFi yield discovery & goal planning for AI agents on Base & EVM.
Discover DeFi yield opportunities and manage Zyfai positions with self-custodial AI agents.
Passive income opportunity scanner. Yield analysis and portfolio optimization for AI agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides AI assistants with access to real-time DeFi lending rates and yield data across 14+ protocols and multiple blockchains. Enables querying borrow/supply rates, comparing platforms, calculating leverage strategies, and finding best earn opportunities.629 npm4MIT
- FlicenseNot gradedqualityDmaintenanceReal-time DeFi data for AI agents. Provides yields, TVL, prices, DEX volumes, fees, and contract data via 8 MCP endpoints, powered by DeFiLlama.-
- AlicenseAqualityDmaintenanceMulti-protocol yield intelligence for AI agents β covering Spectra Finance, Pendle, and Morpho via the Model Context Protocol.5623 npm4MIT
- FlicenseNot gradedqualityDmaintenanceProvides agent-ready access to Beefy DeFi protocols, enabling interaction with vaults, pools, and yield strategies through natural language.-