- Home
- MCP servers
- Pendle
Pendle
- python
2
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
This MCP server connects Pendle Finance to your AI agents and clients, delivering live yield data, staking and swap simulations, portfolio insights, and AI-driven token recommendations through a straightforward HTTP API and local runtime. It enables you to test strategies, explore yields, and iterate with automated tools in a safe, configurable environment.
How to use
You access the MCP endpoints from your client or agent to fetch live yields, simulate staking and swaps, retrieve a user portfolio, and receive AI-driven token recommendations or yield predictions. Start the server, then call the exposed HTTP endpoints or run the local MCP process to integrate with your agent workflows.
Core capabilities you can leverage: get_yield to fetch current yields, stake to simulate staking actions, swap to simulate token swaps, portfolio to retrieve a user’s DeFi holdings, predict_best_token for AI-recommended tokens, and predict_future for projected yields over a defined horizon.
How to install
Prerequisites: Python 3.10+ installed on your system. Node.js 16+ if you plan to use MCP Inspector for interactive testing.
Step 1: Create a project directory and clone the MCP source material. Then navigate into the project folder.
Step 2: Create and activate a Python virtual environment.
Step 3: Install dependencies from the requirements file.
Step 4: Create and configure the environment file with the required settings for FastAPI, Pendle API access, and Ethereum testnet details.
# Step-by-step commands
python -m venv venv
# Windows
.\\venv\\Scripts\\activate
# macOS/Linux
source venv/bin/activate
pip install -r requirements.txt
# Create .env with keys like FASTAPI_ENV, HOST, PORT, PENDLE_API_URL, RPC_URL, PRIVATE_KEY
# Example .env content:
FASTAPI_ENV=development
HOST=127.0.0.1
PORT=8000
PENDLE_API_URL=https://api.pendle.finance/v1/yields
RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY
PRIVATE_KEY=0xYOUR_TEST_PRIVATE_KEY
Additional content and notes
Security: Do not use your mainnet private key with real funds. Use a testnet key or a small segregated account for testing.
Starting the server: Use the runtime command shown to run the app in development with automatic reload for iterative testing.
Optional testing with MCP Inspector: Install the inspector client to interactively exercise the exposed functions in a browser-based Tools tab.
Testing via Python client: You can perform basic requests to the available endpoints to verify yields, staking simulation, and AI predictions.
Available tools
get_yield
Fetches live yield data from Pendle API for available tokens.
stake
Simulates staking actions against the Pendle protocol for a given user, token, and amount.
swap
Simulates token swap operations within the Pendle environment.
portfolio
Retrieves a simulated user DeFi portfolio with positions across Pendle tokens.
predict_best_token
AI-based recommendation for the best token to stake or engage with next.
predict_future
AI-driven projection of future yields over a specified horizon.