TheGraph MCP Server logo

TheGraph MCP Server

by kukapay

TheGraph MCP Server powers AI agents with indexed blockchain data from The Graph. It provides tools to fetch subgraph schemas and execute GraphQL queries against specified subgraphs.

View on GitHub

Last updated: N/A

What is TheGraph MCP Server?

TheGraph MCP Server is a tool that allows AI agents to interact with blockchain data indexed by The Graph. It provides functionalities to retrieve subgraph schemas and execute GraphQL queries, enabling AI to understand and query blockchain data effectively.

How to use TheGraph MCP Server?

To use the server, first clone the repository. Then, configure your client with the server details, including the command to run the server (e.g., using uv and main.py) and any necessary environment variables like the THEGRAPH_API_KEY. You can then use natural language prompts to trigger the available tools, such as fetching subgraph schemas or querying data from specific subgraphs.

Key features of TheGraph MCP Server

  • getSubgraphSchema (fetches subgraph schema)

  • querySubgraph (executes GraphQL queries)

  • Supports human-readable and JSON schema formats

  • Enables AI-driven data analysis

  • Facilitates natural language interaction with blockchain data

Use cases of TheGraph MCP Server

  • AI-powered blockchain data analysis

  • Automated GraphQL query generation

  • Building intelligent agents for DeFi applications

  • Monitoring and analyzing on-chain events

  • Creating custom dashboards and reports based on subgraph data

FAQ from TheGraph MCP Server

What is a subgraph?

A subgraph is a decentralized API that indexes and makes blockchain data easily accessible using GraphQL.

What is the purpose of getSubgraphSchema?

getSubgraphSchema fetches the schema of a specified subgraph, providing AI agents with the context needed to generate GraphQL queries.

What is the purpose of querySubgraph?

querySubgraph executes GraphQL queries against a specified subgraph, allowing AI agents to retrieve specific data from the blockchain.

How do I configure the server?

You need to clone the repository and configure your client with the server details, including the command to run the server and any necessary environment variables.

What kind of prompts can I use?

You can use natural language prompts to trigger the available tools, such as asking for the schema of a subgraph or querying data from a specific subgraph.