Graph AAVE MCP
graph-aave-mcp
用于 AAVE V2、V3 和 V4 的 MCP 服务器 —— 涵盖 16 个 Graph 子图 + Aave V4 API 的 40 个工具。
涵盖借贷市场、用户头寸、健康因子、跨链清算风险监控、清算、闪电贷、治理、V4 中心/分支 (Hubs/Spokes)、汇率、兑换报价、奖励和协议历史。
已发布至 MCP Registry,标识符为
io.github.PaulieB14/graph-aave-mcp
三种数据源
数据源 | 版本 | 提供内容 | 认证 |
The Graph 子图 | V2/V3 | 7 条链上的 11 个子图 — 储备金、头寸、事件、治理 |
|
清算风险子图 | V3 | 5 条链 — 实时健康因子、风险评分、风险警报、协议风险统计 |
|
Aave V4 API | V4 | 中心、分支、储备金、汇率、用户头寸、活动、兑换报价、奖励 | 无需认证 |
Related MCP server: The Graph Token API MCP
快速入门
# Claude Code
claude mcp add graph-aave -- npx -y graph-aave-mcp
# Set Graph API key for subgraph tools (V4 tools work without it)
export GRAPH_API_KEY=your-key-here{
"mcpServers": {
"graph-aave": {
"command": "npx",
"args": ["-y", "graph-aave-mcp"],
"env": {
"GRAPH_API_KEY": "your-api-key-here"
}
}
}
}免费 Graph API 密钥:thegraph.com/studio (每月 10 万次查询免费额度)。
托管部署 (无需安装):Fronteir AI
V2/V3 工具 (The Graph 子图)
15 个工具 + 1 个原始查询入口。需要 GRAPH_API_KEY。
发现
工具 | 描述 |
| 所有支持的链,包含子图 ID、版本、30 天查询量 |
| 任何链的完整 GraphQL 模式内省 |
借贷市场
工具 | 描述 |
| 所有活跃市场 — TVL、存款/借款 APY、LTV、清算阈值 |
| 单个资产的深度详情:生命周期统计、配置、代币地址 |
| 历史 APY、利用率、TVL 快照 |
用户头寸
工具 | 描述 |
| 钱包的存款/借款资产、抵押品标记、e-mode |
| 模拟价格变动对用户健康因子的影响 |
协议事件
工具 | 描述 |
| 近期借款 — 按用户或资产筛选 |
| 近期存款 (自动处理 V2 与 V3 模式差异) |
| 近期还款 |
| 近期清算 — 按用户或清算人筛选 |
| 近期闪电贷及费用 |
治理
工具 | 描述 |
| 包含标题、状态、投票数的提案 |
| 按投票权划分的投票者明细 |
高级
工具 | 描述 |
| 原始 GraphQL — 对任何链执行任何查询 |
支持的链 (V2/V3)
链 | 版本 | 30 天查询量 |
Ethereum | V3 | 21.6M |
Base | V3 | 5.6M |
Arbitrum | V3 | 5.6M |
Polygon | V3 | 2.0M |
Optimism | V3 | 1.8M |
Avalanche | V3 | 1.2M |
Ethereum | V2 | 701K |
Polygon | V2 | 216K |
Avalanche | V2 | 133K |
Fantom | V3 (Messari) | 13K |
Ethereum | Governance V3 | 486K |
清算风险工具 (新增)
8 个由 5 条链上的专用风险子图驱动的工具。需要 GRAPH_API_KEY。
实时清算风险监控,包含健康因子、风险评分 (0–100)、风险等级分类(安全/警告/危险/严重)以及跨链风险汇总。
风险监控
工具 | 描述 |
| 处于清算风险中的头寸 — 按风险等级筛选,按风险评分排序 |
| 钱包的完整风险概况 — 所有头寸的健康因子和风险评分 |
| 汇总统计:总头寸数、危险/警告/严重等级计数 |
| 一次调用获取所有 5 条链的风险概览 |
风险事件
工具 | 描述 |
| 风险等级转换 — 当头寸在安全/警告/危险/严重之间变动时 |
| 包含抵押品/债务资产、金额和交易哈希的清算事件 |
| 特定钱包的健康因子趋势 |
发现
工具 | 描述 |
| 可用的清算风险链,包含子图 ID 和查询量 |
支持的链 (清算风险)
链 | 30 天查询量 | 信号 |
Ethereum | 21.1K | 20.2K GRT |
Arbitrum | 19.3K | 35.7K GRT |
Base | 16.2K | 15.2K GRT |
Polygon | 13.2K | — |
Optimism | 13.0K | — |
V4 工具 (Aave API)
16 个由 api.aave.com/graphql 驱动的工具。无需 API 密钥。
流动性模型
工具 | 描述 |
| 流动性中心 (Core, Plus, Prime),包含 TVL 和利用率 |
| 跨链分支 (Main, Bluechip, Kelp, Lido, Ethena, EtherFi, Forex, Gold, Lombard) |
| 每个分支的储备金,包含存款/借款 APY、风险参数、上限 |
| 支持的 V4 链 |
| 跨中心资产汇总,包含平均 APY 和价格 |
| 通过 Chainlink 预言机获取任何代币价格 (ERC-20, 原生, 或法币) |
| 历史代币价格 |
| 随时间变化的存款/借款总额 |
用户数据
工具 | 描述 |
| 跨链头寸 — 健康因子、抵押品、债务、借款能力 |
| 汇总投资组合:总头寸、净余额、净 APY |
| 包含本金和利息的存款头寸 |
| 包含债务明细的借款头寸 |
| 跨链代币持有量,包含每个代币的最佳 APY |
| 交易历史:存款、借款、还款、清算、兑换 |
| 可领取的 Merkl 和积分奖励 |
| 通过 CoW Protocol 获取只读兑换报价 (MEV 保护) |
V4 架构
Hubs (Core, Plus, Prime)
└── Assets (WETH, USDC, GHO, cbBTC, etc.)
└── Spokes (Main, Bluechip, Kelp, Lido, Ethena, ...)
└── Reserves (per-spoke lending markets)
└── User Positions (health factor, collateral, debt)V4 支持跨链借贷:在一个分支存款,在另一个分支借款。中心汇总各分支的流动性。
引导式提示词
7 个预构建的工作流,引导代理进行多步分析:
提示词 | 描述 |
| 完整的钱包分析:头寸、健康因子、清算风险 |
| 协议概览:顶级市场、利率、近期活动 |
| 比较所有链上单个资产的 APY |
| 清算模式、顶级清算人、高风险市场 |
| 近期提案、投票结果、活跃决策 |
| 跨版本比较:V2 vs V3 vs V4 利率和头寸 |
| 新增 — 跨链清算风险:最高风险头寸、警报、协议健康状况 |
问题示例
清算风险 (新增):
“Arbitrum 上哪些 Aave 头寸最接近清算?”
“给我一个跨链风险仪表板 — 哪个网络的高风险头寸最多?”
“钱包 0x... 在任何链上有清算风险吗?”
“显示近期的风险警报 — 哪些头寸刚刚变得危险?”
“该钱包在 Base 上的健康因子随时间发生了什么变化?”
V4:
“Aave V4 中心及其利用率是多少?”
“显示存款 APY 最高的 V4 储备金”
“Aave V4 上当前的 ETH 价格是多少?”
“比较 V3 与 V4 的 USDC 存款利率”
“Aave V4 在以太坊上有哪些分支?”
V2/V3:
“以太坊上按 TVL 排名的顶级 AAVE 市场有哪些?”
“比较所有 V3 链上的 WETH 借款利率”
“分析钱包 0x... 的 AAVE 头寸”
“如果 ETH 下跌 30%,地址 0x... 会被清算吗?”
“显示以太坊上最近的 20 次清算”
“有哪些活跃的 AAVE 治理提案?”
开发
git clone https://github.com/PaulieB14/graph-aave-mcp.git
cd graph-aave-mcp
npm install
npm run build
GRAPH_API_KEY=your-key node build/index.js许可证
MIT
Available Tools
40 toolsfind_best_ratesA
Use this when the user asks 'Where should I supply USDC for the best yield?', 'Which chain has the lowest WETH borrow rate?', 'Compare AAVE rates across chains for USDC', 'Best AAVE lending rates for DAI'. Queries all AAVE lending deployments in parallel for the given asset, then ranks by APY. Excludes Fantom (incompatible Messari schema) and skips anomalous pools. Returns a ranked table with chain, supply APY, variable borrow APY, utilization, and approx available liquidity. Includes a _recommendation field with the best option.
Inputs: asset (required), side, minLiquidityUSD.
get_aave_flash_loansA
Use this when the user asks about AAVE flash loans — 'Show me recent flash loans on Ethereum', 'What assets are flash-loaned most?', 'How much in flash loan fees has AAVE earned?'. Returns: initiator address, asset borrowed, amount, fee paid (totalFee), and timestamp. Flash loans must be borrowed and repaid within a single transaction.
Inputs: chain (required), first.
get_aave_liquidationsA
Use this when the user asks about AAVE liquidation events — 'Show me recent liquidations on Ethereum', 'Has address 0x... been liquidated?', 'Who are the top liquidators on Arbitrum?', 'What collateral is being seized most?'. Returns: liquidator address, liquidated user, collateral asset seized, debt asset repaid, amounts, and timestamp. Liquidations occur when a user's health factor drops below 1.0.
Inputs: chain (required), first, liquidator, userAddress.
get_aave_repaysA
Use this when the user asks about AAVE debt repayment activity — 'Show me recent repayments on Ethereum', 'Has address 0x... repaid any debt?', 'What assets are being repaid most on Arbitrum?', 'Show USDC repay history'. Returns repay events with: repayer address, asset, raw amount, and timestamp. Divide amount by 10^decimals for human-readable value.
Inputs: chain (required), first, userAddress, reserveSymbol.
get_aave_reserveA
Use this when the user asks about a specific AAVE asset in detail — e.g. 'Tell me everything about USDC on Ethereum AAVE', 'What are the WETH borrow parameters?', 'What is the liquidation threshold for WBTC collateral?'. Returns full reserve config: current rates, TVL, LTV, liquidation parameters, lifetime stats (total borrows/repayments/liquidations), and token addresses. RATE CONVERSION: divide liquidityRate / variableBorrowRate by 1e27 * 100 for APY %.
Inputs: chain (required), symbol (required).
get_aave_reservesA
Use this when the user asks about AAVE lending markets, available assets, supply APY, borrow APY, TVL, utilization rate, collateral factors, or liquidation thresholds on a specific chain. Returns all active reserves sorted by total liquidity (TVL). RATE CONVERSION: liquidityRate and variableBorrowRate are in RAY units (1e27). Supply APY % = liquidityRate / 1e27 * 100. Borrow APY % = variableBorrowRate / 1e27 * 100. Amounts are in native token units — divide by 10^decimals for human-readable. Ideal for: 'What assets can I lend on Arbitrum?', 'What is USDC supply rate on Base?', 'Show me all AAVE V3 markets on Polygon'.
Inputs: chain (required), includeInactive.
get_aave_schemaA
Use this to introspect the full GraphQL schema for any AAVE chain's subgraph. Returns all queryable root fields and their types. Useful before writing a custom query_aave_subgraph call, or to understand what data is available on a specific chain/version.
Inputs: chain (required).
get_aave_user_positionA
Use this when the user asks about a wallet's AAVE position — 'What is my health factor?', 'What have I supplied to AAVE?', 'How much have I borrowed?', 'Am I at risk of liquidation?', 'Show me my collateral and debt on Arbitrum'. Returns all supplied assets (with aToken balances), all borrowed assets (variable + stable debt), collateral flags, and e-mode category. Health Factor ≈ sum(collateral_i * price_i * liqThreshold_i) / sum(debt_i * price_i). HF < 1.0 = liquidatable. Amounts in native token units — divide by 10^decimals.
Inputs: chain (required), userAddress (required).
get_at_risk_positionsA
Find Aave positions at risk of liquidation across 5 chains. Returns positions with health factor, risk score (0–100), risk level (critical/danger/warning), collateral, and debt amounts. Use when asked: 'Which positions are close to liquidation on Arbitrum?', 'Show me the riskiest Aave positions on Base', 'How many critical positions are there?'
Inputs: chain (required), first, riskLevel.
get_cross_chain_risk_summaryA
Get a cross-chain risk overview across all 5 chains (Ethereum, Arbitrum, Base, Polygon, Optimism) in a single call. Returns protocol-level risk stats for each chain: total positions, danger/warning/critical counts. Use when asked: 'Which chain has the most at-risk positions?', 'Give me a risk dashboard across all chains', 'Compare Aave risk levels across networks'.
Inputs: no named parameters.
get_governance_proposalsA
Use this when the user asks about AAVE governance — 'Show me recent AAVE governance proposals', 'What proposals are currently active?', 'What is the status of AAVE proposal #X?', 'Show me governance voting activity'. Queries the AAVE Governance V3 subgraph on Ethereum. Returns: proposal ID, creator, access level (1=short executor/2=long executor), current state, voting duration (seconds), for/against votes, title, and payload info. Proposal states: Created=0, Active=1, Queued=2, Executed=3, Failed=4, Cancelled=5, Expired=6.
Inputs: first, state.
get_health_factor_historyA
Get a user's health factor history over time — shows how their risk has changed block by block. Useful for trend analysis and understanding if a position is deteriorating. Use when asked: 'How has this wallet's health factor changed?', 'Is this position getting riskier over time?', 'Show me the health factor trend for 0x...'.
Inputs: chain (required), userAddress (required), first.
get_proposal_votesA
Use this when the user asks about the vote totals on a specific AAVE governance proposal — 'How did proposal #X vote?', 'Show me the for/against breakdown for proposal #185', 'Did proposal #X pass?'. Returns aggregate vote totals: total forVotes and againstVotes for the proposal. Note: individual per-voter records are not indexed in this subgraph.
Inputs: proposalId (required).
get_protocol_risk_statsA
Get aggregate risk statistics for Aave on a chain — total positions, and how many are in danger, warning, or critical state. Use when asked: 'How healthy is Aave on Ethereum right now?', 'How many positions are at risk on Arbitrum?', 'Give me a risk overview of the protocol'.
Inputs: chain (required).
get_recent_borrowsA
Use this when the user asks about recent borrowing activity on AAVE — 'Who has been borrowing USDC on Ethereum?', 'Show me recent WETH borrows on Arbitrum', 'What has address 0x... borrowed recently?', 'Show borrow volume by asset'. Returns borrow events with: borrower address, asset, raw amount, borrow rate, rate mode (variable=2/stable=1), and timestamp. Divide amount by 10^decimals for human-readable value.
Inputs: chain (required), first, userAddress, reserveSymbol.
get_recent_suppliesA
Use this when the user asks about recent deposit/supply activity on AAVE — 'Who has been supplying ETH on Base?', 'Show me recent USDC deposits on Polygon', 'What has address 0x... deposited recently?'. V3 chains use the 'supply' entity; V2 chains use 'deposit' — handled automatically. Returns: supplier address, asset symbol, raw amount, and timestamp. Divide amount by 10^decimals for human-readable value.
Inputs: chain (required), first, userAddress, reserveSymbol.
get_reserve_rate_historyA
Use this when the user asks about historical AAVE rates or TVL trends — 'How has USDC supply rate changed over time?', 'Show me ETH borrow rate history on Polygon', 'What was the utilization rate last week?'. Returns timestamped snapshots of: liquidityRate, variableBorrowRate, stableBorrowRate, utilizationRate, availableLiquidity, totalLiquidity, totalCurrentVariableDebt. Rates are in RAY units (divide by 1e27 * 100 for APY %). Get the reserve ID from get_aave_reserves (the 'id' field = underlyingAsset + poolAddress).
Inputs: chain (required), reserveId (required), first.
get_risk_alertsA
Get recent risk level transitions — when positions moved between safe/warning/danger/critical states. Shows previous and new risk level, health factor at transition, and timestamp. Use when asked: 'Which positions recently became at risk?', 'Show me health factor drops on Polygon', 'Has wallet 0x... had any risk alerts?'.
Inputs: chain (required), first, userAddress.
get_risk_liquidationsA
Get liquidation events from the risk subgraph — includes collateral asset, debt asset, amounts, liquidator, and transaction hash. Complements get_aave_liquidations with risk-specific context. Use when asked: 'Show recent liquidations on Base', 'Was this wallet liquidated?', 'What collateral was seized?'.
Inputs: chain (required), first, userAddress.
get_user_risk_profileA
Get a user's full liquidation risk profile on a specific chain — all their positions with health factors, risk scores, collateral, and debt. Use when asked: 'Is wallet 0x... at risk of liquidation?', 'What's the health factor for this address on Base?', 'Show me this user's risk across all their Aave positions'.
Inputs: chain (required), userAddress (required).
get_v4_assetA
Get Aave V4 asset details: total supplied/borrowed across all hubs, average supply/borrow APY, and current price. No API key needed.
Inputs: tokenAddress (required), chainId.
get_v4_asset_price_historyB
Get historical price data for an Aave V4 asset. Powered by Chainlink oracles. No API key needed.
Inputs: tokenAddress (required), window, chainId.
get_v4_chainsA
List all chains supported by Aave V4 (mainnet and testnet). No API key needed.
Inputs: no named parameters.
get_v4_claimable_rewardsA
Get a user's claimable Merkl and points rewards on Aave V4. No API key needed.
Inputs: userAddress (required), chainId.
get_v4_exchange_rateA
Get exchange rate for any token via Aave V4's Chainlink oracle integration. Supports ERC-20 tokens, native tokens (ETH), and fiat currencies. No API key needed.
Inputs: to, native, chainId, tokenAddress.
get_v4_hubsA
Get Aave V4 liquidity hubs (Core, Plus, Prime) with TVL, utilization, and supply/borrow caps. No API key needed.
Inputs: chainId.
get_v4_protocol_historyA
Get Aave V4 protocol-wide historical data: total deposits and borrows over time in USD. No API key needed.
Inputs: window.
get_v4_reservesA
Get Aave V4 reserves with supply/borrow APYs, risk params (collateral factor, caps), and status. Use get_aave_reserves for V2/V3. No API key needed.
Inputs: chainId.
get_v4_spokesA
Get Aave V4 spokes (Main, Bluechip, Kelp, Lido, Ethena, EtherFi, etc.). Spokes are chain-specific deployment points enabling cross-chain lending. No API key needed.
Inputs: chainId.
get_v4_swap_quoteA
Get a read-only swap price quote from Aave V4 (powered by CoW Protocol with MEV protection). Returns pricing, fees, and slippage. No API key needed.
Inputs: sellAmount (required), userAddress (required), buyTokenAddress (required), sellTokenAddress (required), +1 more.
get_v4_user_activitiesB
Get a user's Aave V4 transaction history: supplies, borrows, withdrawals, repayments, liquidations, swaps. No API key needed.
Inputs: userAddress (required), chainId.
get_v4_user_balancesA
Get a user's cross-chain token balances in Aave V4 with highest supply APY and lowest borrow APY per token. No API key needed.
Inputs: userAddress (required).
get_v4_user_borrowsA
Get a user's Aave V4 borrow positions with principal, debt, interest. No API key needed.
Inputs: userAddress (required), chainId.
get_v4_user_positionsA
Get a user's Aave V4 positions across all spokes — health factor, collateral, debt, borrowing power, net APY. Cross-chain by default. No API key needed.
Inputs: userAddress (required).
get_v4_user_summaryA
Get aggregated Aave V4 portfolio summary for a user: total positions, net balance, collateral, debt, net APY, lowest health factor. No API key needed.
Inputs: userAddress (required).
get_v4_user_suppliesB
Get a user's Aave V4 supply positions with principal, interest, and collateral status. No API key needed.
Inputs: userAddress (required), chainId.
list_aave_chainsA
Use this when the user asks which AAVE chains are supported, wants to pick a network, or needs to discover available AAVE deployments. Returns all supported chains with their subgraph IDs, protocol version (V2/V3), chain name, 30-day query volume, and key entities. Chains: Ethereum, Base, Arbitrum, Polygon, Optimism, Avalanche, Fantom (V3 + V2 legacy), plus AAVE Governance V3. Always call this first if chain is ambiguous.
Inputs: no named parameters.
list_risk_chainsA
List all available liquidation risk subgraph chains with their names, networks, subgraph IDs, and 30-day query volumes. Use when asked: 'Which chains have liquidation risk data?', 'What risk subgraphs are available?'.
Inputs: no named parameters.
query_aave_subgraphA
Use this when a pre-built tool doesn't cover the user's need — execute a raw GraphQL query against any AAVE chain's subgraph. Use get_aave_schema first to explore available entities and fields. Lending schema entities: reserves, userReserves, borrows, supplies (V3) / deposits (V2), repays, liquidationCalls, flashLoans, pool, protocol, reserveParamsHistoryItems. Governance schema entities: proposals, proposalVotes_collection, payloads, votingPortals, votingConfigs, proposalMetadata_collection.
Inputs: chain (required), query (required), variables.
simulate_health_factorA
Use this when the user wants to simulate how a price change affects their AAVE health factor — 'What happens to my health factor if ETH drops 20%?', 'How much can WBTC fall before I get liquidated?', 'Simulate a 30% drop in my collateral asset'. Fetches the user's full position, computes current health factor, then recalculates it after applying the specified price change to the target asset. Health Factor < 1.0 means the position is liquidatable.
Inputs: chain (required), assetSymbol (required), userAddress (required), priceChangePct (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 40 tools
While each tool has a detailed description, there are several pairs with overlapping purposes (e.g., get_aave_liquidations vs get_risk_liquidations, get_aave_reserves vs get_v4_reserves, and multiple user-position tools). The high number of similar names could confuse an LLM despite the descriptions.
Tool names use a mix of prefixes (get_, list_, find_, simulate_, query_) and sometimes include version (v4) or omit it. There is no consistent verb_noun pattern across the set, making it harder to infer behavior from the name alone.
40 tools is on the high side, bordering on heavy. However, the server covers multiple AAVE versions, chains, and sub-domains (governance, risk, V4), so the count is somewhat justified. Some tools could be merged without loss of clarity.
The tool surface covers most expected queries: reserves, user positions, history, governance, risk, flash loans, liquidations, and raw subgraph access. Minor gaps exist (e.g., no cross-chain V2/V3 user summary, no tool to fetch all positions across chains), but overall it is comprehensive.
Maintenance
Related MCP Connectors
Official Aave MCP for V3 and V4 markets, positions, governance, and transaction preparation.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Pay-per-call DeFi and macro intel for AI agents. x402 USDC tools via streamable HTTP /api/mcp.
Your agent needs crypto prices it can rely on — spot, ranked market tables, history, OHLC, per-venue tickers, and what is trending right now. **What you can ask for** • "What is the price of these 20 tokens in USD and EUR right now?" • "Give me the top 100 by market cap with 24h and 7d change." • "Chart this coin's price over the last year, hourly." • "Where does this token trade, and at what spread per venue?" • "What is trending on CoinGecko today?" **How to use it** Point any MCP client at https://mcp.aisa.one/crypto-market-data/mcp and sign in with OAuth — there is no key to create or paste. 21 CoinGecko tools: simple price and token price by contract, supported currencies, coin list and detail, ranked markets, history, market charts and ranges, OHLC, per-coin tickers, categories, exchanges and their tickers, token data and charts, and trending. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Price the token here, then ask the same agent what X is posting about it — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/finance/mcp for equities, crypto and prediction markets in one place.
Related MCP Servers
- AlicenseAqualityDmaintenancePowers AI agents with indexed blockchain data from The Graph, enabling them to fetch subgraph schemas and execute GraphQL queries against blockchain data.29MIT
- AlicenseNot gradedqualityFmaintenanceOfficial MCP server that turns The Graph’s Token API into a plug-and-play web3 data tool. Exposes ERC-20 & NFT metadata, balances, transfers, top-holder stats, prices, and more, allowing LLMs to run SQL queries on structured and indexed blockchain data.2Apache 2.0
- AlicenseAqualityDmaintenanceEnables AI assistants to analyze Aave V3 positions on Ethereum, monitor health factors, identify liquidation opportunities, and query protocol data including collateral positions, debt composition, and real-time asset prices.81MIT
- AlicenseAqualityDmaintenanceAn MCP server that powers AI agents with indexed blockchain data from The Graph.3MIT