A Model Context Protocol (MCP) server that provides tools for interacting with the Aave V3 DeFi protocol. This server enables LLMs like Claude to query markets, analyze user positions, prepare transactions, and interact with Aave's lending/borrowing protocol.
The server provides 18+ tools organized into categories:
get_supported_chains- List all supported blockchain networksget_markets- Fetch markets across multiple chains with TVL and APY dataget_market_details- Get comprehensive data for a specific market
get_user_positions- Get all supply/borrow positions for a userget_user_market_state- Get health factor and liquidation riskget_user_transaction_history- View historical transactions
get_reserve_details- Detailed info about specific assets (APY, caps, risk params)get_apy_history- Historical APY data for supply or borrow
prepare_supply_transaction- Prepare a supply/deposit transactionprepare_borrow_transaction- Prepare a borrow transactionprepare_repay_transaction- Prepare a debt repayment transactionprepare_withdraw_transaction- Prepare a withdrawal transaction
get_vaults- List yield-generating vault strategiesget_vault_details- Detailed vault information
get_gho_balance- Get sGHO (staked GHO) balance
aave://chains- List of supported networksaave://markets/{chain_id}- Markets for a specific chainaave://common-addresses- Quick reference for market addresses
Pre-built prompts for common workflows:
analyze_user_positions- Comprehensive position analysisfind_best_yield- Compare yields across chainsprepare_defi_strategy- Create yield/leverage/hedge strategies
pip install -e .uv pip install -e .- Python 3.10+
mcp[cli]>=1.4.0httpx>=0.27.0
# Using Python directly
python aave_mcp_server.py
# Or using the installed script
aave-mcp-serverAdd to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"aave-v3": {
"command": "python",
"args": ["/path/to/aave-mcp-server/aave_mcp_server.py"]
}
}
}Or if using uv:
{
"mcpServers": {
"aave-v3": {
"command": "uv",
"args": [
"--directory",
"/path/to/aave-mcp-server",
"run",
"aave_mcp_server.py"
]
}
}
}# Start the server
python aave_mcp_server.py
# In another terminal, use MCP Inspector
mcp dev aave_mcp_server.pyUser: What are the current Aave markets on Ethereum?
Claude: [Uses get_markets tool with chain_id=1]
User: Can you analyze the health of wallet 0x742d35...?
Claude: [Uses get_user_positions and get_user_market_state tools]
User: I want to supply 100 USDC to Aave on Ethereum
Claude: [Uses prepare_supply_transaction tool with the parameters]
User: Where can I get the best yield for my USDC?
Claude: [Uses find_best_yield prompt, then get_markets to compare]
| Chain | Chain ID | Market Address |
|---|---|---|
| Ethereum | 1 | 0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2 |
| Polygon | 137 | 0x794a61358d6845594f94dc1db02a252b5b4814ad |
| Arbitrum | 42161 | 0x794a61358d6845594f94dc1db02a252b5b4814ad |
| Optimism | 10 | 0x794a61358d6845594f94dc1db02a252b5b4814ad |
| Avalanche | 43114 | 0x794a61358d6845594f94dc1db02a252b5b4814ad |
| Base | 8453 | 0xa238dd80c259a72e81d7e4664a9801593f98d1c5 |
Important: This MCP server prepares transactions but does not execute them. The transaction data returned must be:
- Signed by the user's wallet
- Broadcast to the blockchain
For transaction execution, you'll need:
- A wallet provider (MetaMask, WalletConnect, etc.)
- Sufficient native tokens for gas
- The user's explicit approval
This server communicates with Aave's official GraphQL API:
- Production:
https://api.v3.aave.com/graphql
Based on the official Aave SDK.
- No Private Keys: This server never handles private keys or signs transactions
- Read Operations: Most tools perform read-only queries
- Transaction Prep: Transaction tools only prepare unsigned transaction data
- Rate Limits: The Aave API may have rate limits; implement caching for production use
pytest tests/ruff check .
black --check .MIT License - See LICENSE file for details.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Aave Protocol for the DeFi infrastructure
- Anthropic for the Model Context Protocol
- Aave SDK for the API structure