
GraphMind
Natural language DeFi research assistant powered by The Graph's Subgraph MCP
Demo
About
GraphMind is a DeFi research assistant I built for the ETHGlobal hackathon. Instead of digging through dashboards or writing GraphQL by hand, you just ask plain-English questions, like "what are the top lending pools by TVL on Aave?" and it queries live onchain data through The Graph's Subgraph MCP, reasons over the numbers, and answers back with tables and risk callouts instead of raw JSON.
How it's made
Frontend: a simple chat UI (HTML/CSS/vanilla JS) where you type a question. Backend: a small Express server hat receives the question via a /api/chat endpoint. The agent (agent.ts): sends your question to OpenAI along with a system prompt describing its job (DeFi research assistant) and a list of tools it's allowed to call. The tools are provided by The Graph's Subgraph MCP server a hosted service that exposes real blockchain data through the Model Context Protocol. The model can call tools like "search subgraphs by keyword," "get GraphQL schema" or "execute a query." The MCP client (mcpClient.ts) forwards those tool calls to The Graph, which runs GraphQL queries against indexed onchain data (e.g., Aave's subgraph) and returns real numbers. The model can call multiple tools in sequence (search → get schema → query → maybe compare), each time getting real data back, until it has enough to answer. Instead of raw JSON, the model writes a natural-language summary with a table and risk callouts.