thegraph-mcp

thegraph-mcp

An MCP server that powers AI agents with indexed blockchain data from The Graph.

7
Stars
12
Forks
0
Releases

Overview

TheGraph MCP Server powers AI agents with indexed blockchain data from The Graph. It exposes two primary tools: getSubgraphSchema, which fetches the schema of a specified subgraph (with an asText flag to return a human-readable GraphQL schema or default JSON schema), and querySubgraph, which executes GraphQL queries against a specified subgraph (allowing AI-generated or manual queries). The server is designed to enable AI workflows by providing the necessary context to construct and execute subgraph queries. The README includes installation steps (clone the repository) and a client configuration example for registering the MCP server under the name "thegraph-mcp" with a command, arguments, and an environment variable THEGRAPH_API_KEY for authentication. It runs with Python 3.10+ as indicated by the badges. Example prompts demonstrate schema queries, data queries, analysis tasks, and combined tasks to guide usage. Overall, this MCP server enables AI agents to access and query blockchain data via The Graph subgraphs efficiently within MCP workflows.

Details

Owner
kukapay
Language
Python
License
MIT License
Updated
2025-12-07

Features

getSubgraphSchema

Fetches the schema of a specified subgraph, providing context for generating GraphQL queries; supports asText to choose human-readable GraphQL schema or JSON schema.

querySubgraph

Executes GraphQL queries against a specified subgraph, enabling AI-generated or manual queries.

Schema output format option

asText flag lets users choose between a readable GraphQL schema (true) or a JSON schema (default) for getSubgraphSchema.

AI-ready subgraph data access

Provides AI agents with indexed blockchain data from The Graph to power informed querying and analysis.

Installation and client configuration

Includes clone-based setup and a sample client configuration showing how to register the MCP server (thegraph-mcp) with command, args, and THEGRAPH_API_KEY environment variable.

Prompts and usage examples

Includes extensive example prompts for schema queries, data queries, analysis tasks, and combined tasks to guide usage.

Audience

AI developersBuild AI agents that query and analyze blockchain data from The Graph via subgraphs.
Data scientists / researchersQuery and analyze indexed blockchain data using subgraphs for research and analytics.
Subgraph developers / integratorsIntegrate MCP-based querying into applications that rely on The Graph subgraphs.

Tags

The GraphsubgraphGraphQLMCP serverAI agentsblockchain dataindexed data