Graph AAVE MCP

Graph AAVE MCP

MCP server for querying AAVE V2/V3 lending protocol and governance data via The Graph subgraphs. Exposes 14 tools and 5 guided prompts that any AI agent (Claude, Cursor, Copilot, etc.) can use to query lending markets, user positions, health factors, liquidations, flash loans, rate history, and AAVE governance — across 7 chains (Ethereum, Base, Arbitrum, Polygon, Optimism, Avalanche, Fantom) via

Category
访问服务器

README

graph-aave-mcp

<div align="center">

npm version MCP Registry smithery badge License: MIT

<a href="https://glama.ai/mcp/servers/@PaulieB14/graph-aave-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@PaulieB14/graph-aave-mcp/badge" /> </a>

MCP server for querying AAVE V2/V3 lending protocol and governance data via The Graph subgraphs.

Exposes 14 tools and 5 guided prompts that any AI agent (Claude, Cursor, Copilot, etc.) can use to query lending markets, user positions, health factors, liquidations, flash loans, rate history, and AAVE governance — across 7 chains (Ethereum, Base, Arbitrum, Polygon, Optimism, Avalanche, Fantom) via 11 subgraphs covering both V2 and V3 deployments plus AAVE Governance V3.

</div>

Published to the MCP Registry as io.github.PaulieB14/graph-aave-mcp

Supported Chains & Subgraphs

7 chains, 11 subgraphs — some chains have both V2 (legacy) and V3 deployments tracked separately.

Chain Version Deployment ID
Ethereum V3 QmX2VfvEspbShTdcjefWeG3CKBVXKWm9naxH6TVhqPb9qY
Ethereum V2 QmdEuhCPTFx5q1Vf7jPQDVGQDpC34KYry82yb3NPc9sK6a
Base V3 QmXZ53Kzz3L2LvvbGve2ebtLKWMhjjB1a3U2jnUj2YwGCW
Arbitrum V3 Qmdn5hAZZj3wmWVuksXHtua3E6aWftCDeTFcW8YQ8Lu6pB
Polygon V3 QmceoHP3ekxJ6JYqAXhqrVgv8rb9WXumrGe1ZhVZah8Ar5
Polygon V2 QmNfojj4Wu1DErB9iC6epPZc4K2zQCrm4KJUra3DMQqSNm
Optimism V3 QmScPH3aFxzFgrie8MMDU4QtFu3CE7nTfsRfSQXiccxBPh
Avalanche V3 QmXhWmYZyEr8PGEic8F739wVqvMYxHLD7jke69RXmwQU95
Avalanche V2 QmdDSA73QkFAvRZqtRoHgLvxonuSZTuJhoWkmBtEdVuTmz
Ethereum Governance V3 QmRyQo7xz4P3WvthdVzfkhwSzfwa8Uku1qrcyJCAN6RAWS
Fantom V3 QmNTzi2eFS2boHFFY372xrxGHNM8yPjF26H3eUxWTtnvoA

Prerequisites

You need a free Graph API key (takes ~2 minutes):

  1. Go to The Graph Studio
  2. Connect your wallet (MetaMask, WalletConnect, etc.)
  3. Click "API Keys" in the sidebar and create one
  4. Free tier includes 100,000 queries/month

Installation

npm install -g graph-aave-mcp

Or use directly with npx (no install needed):

GRAPH_API_KEY=your-key npx graph-aave-mcp

Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "graph-aave": {
      "command": "npx",
      "args": ["-y", "graph-aave-mcp"],
      "env": {
        "GRAPH_API_KEY": "your-api-key-here"
      }
    }
  }
}

Claude Code (CLI)

claude mcp add graph-aave -- npx -y graph-aave-mcp

Then set the environment variable:

export GRAPH_API_KEY=your-api-key-here

Cursor

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

{
  "mcpServers": {
    "graph-aave": {
      "command": "npx",
      "args": ["-y", "graph-aave-mcp"],
      "env": {
        "GRAPH_API_KEY": "your-api-key-here"
      }
    }
  }
}

Other MCP Clients

Use stdio transport with npx graph-aave-mcp as the command and GRAPH_API_KEY as an environment variable.

Available Tools

Discovery

Tool Description
list_aave_chains List all supported AAVE chains with subgraph IDs, versions, and 30-day query volumes
get_aave_schema Full GraphQL schema introspection for any chain's subgraph

Lending Markets

Tool Description
get_aave_reserves All active lending markets on a chain — TVL, supply APY, borrow APY, LTV, liquidation thresholds
get_aave_reserve Deep detail on one asset: lifetime stats, full config, token addresses
get_reserve_rate_history Historical snapshots of APY, utilization rate, and TVL over time

User Positions

Tool Description
get_aave_user_position Wallet's supplied assets, borrowed assets, collateral flags, and e-mode category
simulate_health_factor Simulate how a price change affects a user's health factor — e.g. "ETH drops 20%"

Protocol Events

Tool Description
get_recent_borrows Recent borrow events — filterable by user address or asset symbol
get_recent_supplies Recent supply/deposit events (handles V2 deposit vs V3 supply automatically)
get_aave_liquidations Recent liquidations — filterable by liquidated user or liquidator address
get_aave_flash_loans Recent flash loans with amounts and fees paid

Governance

Tool Description
get_governance_proposals AAVE Governance V3 proposals with titles, states, for/against vote counts
get_proposal_votes Individual voter breakdown for a specific proposal by voting power

Advanced

Tool Description
query_aave_subgraph Raw GraphQL escape hatch — execute any query against any chain

Guided Prompts

Prompts are pre-built multi-step workflows that guide any AI agent through common AAVE analysis tasks:

Prompt Description
analyze_aave_user Full wallet analysis: supplied/borrowed assets, health factor, liquidation risk
aave_chain_overview Protocol overview for a chain: top markets, rates, recent activity
compare_aave_rates Compare supply/borrow APY for one asset across all supported chains
aave_liquidation_analysis Analyze liquidation patterns, top liquidators, and at-risk markets
aave_governance_overview Recent governance proposals, voting results, and active decisions

Rate Conversion

AAVE stores interest rates in RAY units (27 decimal precision). To convert to human-readable APY:

Supply APY %  = liquidityRate    / 1e27 * 100
Borrow APY %  = variableBorrowRate / 1e27 * 100

Token amounts are stored in native token units. To convert:

Human amount = rawAmount / 10^decimals

Health Factor

A user's health factor determines liquidation risk:

HF = Σ(collateral_i × price_i × liquidationThreshold_i) / Σ(debt_i × price_i)
  • HF > 1.0 — position is safe
  • HF = 1.0 — liquidation threshold reached
  • HF < 1.0 — position is liquidatable

Use simulate_health_factor to test how price movements affect a specific wallet's HF.

Example Prompts for AI Agents

Once connected, an AI agent can answer questions like:

Markets & Rates

  • "What are the top AAVE markets on Ethereum by TVL?"
  • "What is the current USDC supply APY on Base?"
  • "Compare WETH borrow rates across all AAVE V3 chains"
  • "Which chain has the cheapest stablecoin borrowing right now?"

User Positions

  • "Analyze the AAVE position for wallet 0x..."
  • "What is the health factor for address 0x... on Arbitrum?"
  • "Show me what 0x... has supplied and borrowed on Polygon"
  • "If ETH drops 30%, will address 0x... get liquidated?"

Protocol Activity

  • "Show me the last 20 liquidations on Ethereum AAVE"
  • "Who are the most active liquidators on Arbitrum this week?"
  • "What are the biggest flash loans on Base recently?"
  • "Show me recent USDC borrows on Optimism"

Governance

  • "What are the latest AAVE governance proposals?"
  • "Is there anything currently up for a vote in AAVE governance?"
  • "Show me who voted on proposal #185 and how"
  • "What governance proposals have passed recently?"

Development

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

To test with a specific chain:

# Start the server and query it with a GraphQL client or MCP inspector
GRAPH_API_KEY=your-key npx @modelcontextprotocol/inspector node build/index.js

Schema Notes

Lending subgraphs (V3) use AAVE-native schema:

  • reserves — individual asset markets
  • userReserves — user positions per asset
  • borrows, supplies, repays — transaction events
  • liquidationCalls — liquidation events
  • flashLoans — flash loan events
  • reserveParamsHistoryItems — historical rate snapshots

Lending subgraphs (V2) use the same schema but with deposits instead of supplies.

Governance subgraph uses a separate schema:

  • proposals — governance proposals with votes and payloads
  • proposalVotes_collection — individual voter records
  • proposalMetadata_collection — proposal titles and content
  • payloads — on-chain execution payloads
  • votingPortals, votingConfigs — governance configuration

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选