kukapay/thegraph-mcp
Free用来自 The Graph 的索引化区块链数据赋能 AI 代理的 MCP 服务器。
FreeFree tier
About kukapay/thegraph-mcp
An MCP (Model Context Protocol) server that enables AI agents to query indexed blockchain data from The Graph. It provides two tools: getSubgraphSchema for fetching subgraph schemas (in human-readable GraphQL or JSON format) and querySubgraph for executing arbitrary GraphQL queries against a specified subgraph. Installation requires cloning the repository and configuring a The Graph API key. The server supports natural language prompts for schema exploration, data retrieval, and combined analysis tasks.
Key Features
Fetches subgraph schema in human-readable GraphQL or JSON format via getSubgraphSchema
Executes arbitrary GraphQL queries against The Graph subgraphs via querySubgraph
Supports natural language prompts for schema exploration and data retrieval
Requires The Graph API key for authentication
Open source under MIT license
Pros & Cons
Pros
- Enables AI agents to directly access indexed blockchain data without manual GraphQL coding
- Supports any subgraph hosted on The Graph Network via subgraph ID
- Provides both human-readable and JSON schema output for flexibility
- Lightweight installation with uv and simple client configuration
Cons
- Requires a The Graph API key, adding a dependency on an external service
- Limited to querying data from The Graph subgraphs only; not a general blockchain data tool
- No built-in error handling or retry mechanisms visible in the documentation
Best For
Retrieving the schema of a subgraph to understand its data model before queryingQuerying token trading volumes, pair liquidity, and swap events from DeFi subgraphsAnalyzing trading patterns and market impact using indexed on-chain dataCombining schema discovery with data queries for automated blockchain analysis
FAQ
What tools does this MCP server provide?
It provides two tools: getSubgraphSchema (to fetch a subgraph's schema) and querySubgraph (to execute GraphQL queries against a subgraph).
How do I install and configure the server?
Clone the repository and add the configuration to your MCP client, specifying the path to the project and your The Graph API key as an environment variable.
What parameters does getSubgraphSchema take?
It takes a subgraphId (string) and an asText flag (boolean). When asText is true, it returns a human-readable GraphQL schema; when false (default), it returns JSON schema.