Loading...

TheGraph MCP server provides AI agents with access to indexed blockchain data via GraphQL queries, enabling analysis and insights.
Boost this tool
Subscribe to listing upgrades or segmented pushes.
TheGraph MCP server provides AI agents with access to indexed blockchain data via GraphQL queries, enabling analysis and insights.
This server is relatively safe for read-only access to blockchain data. The primary risks involve query construction and API key management. It's crucial to monitor query patterns and secure the API key to prevent abuse.
Performance depends on the complexity of the GraphQL queries and the subgraph's indexing efficiency. Consider optimizing queries for specific use cases.
Cost is primarily determined by The Graph's API usage. Monitor API usage to avoid unexpected charges.
{
"mcpServers": {
"thegraph-mcp": {
"command": "uv",
"args": ["--directory", "path/to/thegraph-mcp", "run", "main.py"],
"env": {
"THEGRAPH_API_KEY": "your_api_key_here"
}
}
}
}getSubgraphSchemaFetches the schema of a specified subgraph, enabling AI to understand the data structure.
Read-only operation, no data modification.
querySubgraphExecutes a GraphQL query against a specified subgraph, retrieving indexed blockchain data.
Read-only operation, retrieves data based on the query.
API Key
This server is relatively safe for read-only access to blockchain data. The primary risks involve query construction and API key management. It's crucial to monitor query patterns and secure the API key to prevent abuse.
Autonomy is limited by the read-only nature of the tools. Agents can explore and analyze data but cannot modify anything.
Production Tip
Implement robust error handling and rate limiting to prevent service disruptions.
A subgraph is a curated set of indexed blockchain data that The Graph makes available for querying.
Subgraph IDs are typically found in The Graph's explorer or documentation for the specific project.
The JSON schema is a machine-readable representation, while the GraphQL schema is human-readable and describes the data types and relationships.
Yes, The Graph imposes rate limits. Refer to their documentation for details.
The tool returns GraphQL responses, which may contain error messages. Your agent needs to parse these messages.
No, this server only supports read operations.
Store the API key in a secure environment variable and avoid hardcoding it in your code.