TheGraph MCP Server
Easily integrate and query blockchain data in your AI workflows with TheGraph MCP Server, bringing the power of The Graph protocol to FlowHunt and AI agents.

What does “TheGraph” MCP Server do?
TheGraph MCP Server is an integration layer that connects AI agents with indexed blockchain data from The Graph protocol. It empowers AI systems to access, query, and analyze blockchain information efficiently by exposing subgraph data through standardized MCP (Model Context Protocol) tools. By allowing assistants to fetch subgraph schemas and execute GraphQL queries, TheGraph MCP Server facilitates development workflows involving blockchain analytics, on-chain data retrieval, and decentralized finance (DeFi) monitoring. This server makes it possible for developers and AI agents to retrieve structured blockchain data, perform automated analyses, and build applications that interact seamlessly with The Graph’s decentralized indexing network.
List of Prompts
- Schema Queries
- Prompts to retrieve and display the schema of a given subgraph, such as requesting a readable GraphQL schema or understanding the data model structure.
- Data Queries
- Prompts to fetch specific data from a subgraph, like finding top tokens by trading volume, retrieving pairs with high liquidity, or listing recent swap events.
- Analysis Tasks
- Prompts to perform analyses on blockchain data, such as analyzing trading volumes for specific tokens over defined time periods.
List of Resources
No explicit MCP resources are documented in the repository.
List of Tools
- getSubgraphSchema
- Fetches the schema of a specified subgraph, allowing AI agents to understand the structure and format of blockchain data indexed by The Graph.
- querySubgraph
- Executes GraphQL queries on a designated subgraph, enabling the retrieval of custom data sets and analytics directly from The Graph’s indexed blockchain data.
Use Cases of this MCP Server
- Blockchain Data Analytics
- Developers and AI agents can analyze on-chain data, such as trading volumes or liquidity, to provide insights for DeFi platforms or trading bots.
- Schema Exploration for Developers
- Enables quick retrieval of subgraph schemas for understanding data models, accelerating the development of blockchain-integrated applications.
- DeFi Monitoring and Reporting
- Automated monitoring of financial metrics (e.g., top tokens, swap events) for decentralized exchanges and assets using subgraph queries.
- Custom Data Retrieval
- Facilitates the extraction of specific blockchain data for research, dashboards, or real-time analytics by crafting and executing custom GraphQL queries.
- AI-powered Blockchain Assistants
- Powers agents that can answer questions or automate tasks based on blockchain data, such as alerting on unusual transactions or generating reports.
How to set it up
Windsurf
- Prerequisites: Ensure Python 3.10+ and
uv
are installed. - Clone the repository:
git clone https://github.com/kukapay/thegraph-mcp.git
- Edit configuration file: Locate your Windsurf config (e.g.,
config.json
). - Add TheGraph MCP Server:
{ "mcpServers": { "thegraph-mcp": { "command": "uv", "args": ["--directory", "path/to/thegraph-mcp", "run", "main.py"], "env": { "THEGRAPH_API_KEY": "your_api_key_here" } } } }
- Save and restart Windsurf.
- Verify: Test with a schema or data query prompt.
Claude
- Prerequisites: Python and
uv
installed. - Clone the repo:
git clone https://github.com/kukapay/thegraph-mcp.git
- Update Claude’s MCP settings: Edit your Claude config.
- Insert server details:
{ "mcpServers": { "thegraph-mcp": { "command": "uv", "args": ["--directory", "path/to/thegraph-mcp", "run", "main.py"], "env": { "THEGRAPH_API_KEY": "your_api_key_here" } } } }
- Restart Claude and test connectivity.
Cursor
- Install prerequisites: Python 3.10+ and
uv
. - Clone the repository:
git clone https://github.com/kukapay/thegraph-mcp.git
- Edit Cursor’s MCP config file.
- Add the following JSON:
{ "mcpServers": { "thegraph-mcp": { "command": "uv", "args": ["--directory", "path/to/thegraph-mcp", "run", "main.py"], "env": { "THEGRAPH_API_KEY": "your_api_key_here" } } } }
- Restart Cursor and verify by running a test query.
Cline
- Prerequisites: Ensure Python 3.10+ and
uv
are available. - Clone the repository:
git clone https://github.com/kukapay/thegraph-mcp.git
- Edit Cline’s configuration file.
- Insert the following in your MCP config:
{ "mcpServers": { "thegraph-mcp": { "command": "uv", "args": ["--directory", "path/to/thegraph-mcp", "run", "main.py"], "env": { "THEGRAPH_API_KEY": "your_api_key_here" } } } }
- Restart Cline, then test with a prompt.
Securing API Keys
- Store your
THEGRAPH_API_KEY
as an environment variable. - Example configuration:
{ "mcpServers": { "thegraph-mcp": { "command": "uv", "args": ["--directory", "path/to/thegraph-mcp", "run", "main.py"], "env": { "THEGRAPH_API_KEY": "${THEGRAPH_API_KEY}" } } } }
How to use this MCP inside flows
Using MCP in FlowHunt
To integrate MCP servers into your FlowHunt workflow, start by adding the MCP component to your flow and connecting it to your AI agent:

Click on the MCP component to open the configuration panel. In the system MCP configuration section, insert your MCP server details using this JSON format:
{
"thegraph-mcp": {
"transport": "streamable_http",
"url": "https://yourmcpserver.example/pathtothemcp/url"
}
}
Once configured, the AI agent is now able to use this MCP as a tool with access to all its functions and capabilities. Remember to change “thegraph-mcp” to whatever the actual name of your MCP server is and replace the URL with your own MCP server URL.
Overview
Section | Availability | Details/Notes |
---|---|---|
Overview | ✅ | |
List of Prompts | ✅ | |
List of Resources | ⛔ | No explicit MCP resources found |
List of Tools | ✅ | 2 tools: getSubgraphSchema, querySubgraph |
Securing API Keys | ✅ | Environment variable supported |
Sampling Support (less important in evaluation) | ⛔ | Not mentioned |
Our opinion
TheGraph MCP Server provides a clear interface and two essential tools for interacting with The Graph’s indexed blockchain data. The documentation covers setup and security, but lacks details on explicit MCP resources, roots, or sampling. Overall, it’s straightforward and functional for its intended use.
Rating: 7/10
MCP Score
Has a LICENSE | ✅ (MIT) |
---|---|
Has at least one tool | ✅ |
Number of Forks | 7 |
Number of Stars | 4 |
Frequently asked questions
- What is TheGraph MCP Server?
TheGraph MCP Server is an integration layer that connects AI agents and applications with indexed blockchain data from The Graph protocol. It exposes subgraph data and enables efficient data querying and analysis using standardized MCP tools.
- Which tools does TheGraph MCP Server provide?
It offers two tools: getSubgraphSchema (to retrieve and explore the schema of any subgraph) and querySubgraph (to execute GraphQL queries and fetch custom data sets directly from The Graph’s indexed blockchain data).
- What are typical use cases?
Typical use cases include blockchain data analytics, DeFi monitoring, schema exploration for developers, custom on-chain data retrieval for dashboards or research, and enabling AI-powered blockchain assistants.
- How do I secure my API key?
Always store your THEGRAPH_API_KEY as an environment variable in your MCP server configuration. This protects your sensitive credentials and allows for safer deployments.
- Can I use TheGraph MCP Server with FlowHunt?
Yes! Add the MCP server to your FlowHunt flow, configure it with your server URL and API key, and your AI agents will gain access to all of TheGraph MCP Server’s tools and functions.
Supercharge Your AI with Blockchain Data
Connect your AI agents to The Graph’s indexed blockchain data using TheGraph MCP Server. Enable instant analytics, DeFi monitoring, and custom data queries in FlowHunt today.