- Home
- MCP servers
- TheGraph
TheGraph
- python
7
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"kukapay-thegraph-mcp": {
"command": "uv",
"args": [
"--directory",
"path/to/thegraph-mcp",
"run",
"main.py"
],
"env": {
"THEGRAPH_API_KEY": "your_api_key_here"
}
}
}
}The Graph MCP Server powers AI agents with indexed blockchain data from The Graph, enabling you to fetch subgraph schemas and run queries to inform decisions, analytics, or automated workflows. It exposes practical tools to inspect and query subgraphs and integrates into your MCP client workflow for scalable AI-assisted data access.
How to use
You use the MCP server by running it in your environment and connecting your MCP client to it. The server provides two core capabilities: retrieving the subgraph schema to understand what you can query, and executing GraphQL queries against a specific subgraph. Your MCP client can then generate or customize queries based on the retrieved schema and the data you need.
How to install
Prerequisites you need before installation: a working Python environment, Git, and a compatible runtime for running MCP servers locally.
Step 1: Clone the MCP server repository.
git clone https://github.com/kukapay/thegraph-mcp.git
Step 2: Prepare your client configuration to connect to the MCP server. You will run the server via the MCP runner as shown in the configuration example.
{
"mcpServers": {
"thegraph-mcp": {
"command": "uv",
"args": ["--directory", "path/to/thegraph-mcp", "run", "main.py"],
"env": {
"THEGRAPH_API_KEY": "your_api_key_here"
}
}
}
}
Additional sections
This server exposes two main tools that you can invoke from your MCP client: getSubgraphSchema and querySubgraph. They enable you to fetch a readable or JSON GraphQL schema for a subgraph and to run GraphQL queries against a subgraph, respectively.
Notes on usage follow the concepts of schema discovery first and data querying second. Use getSubgraphSchema to understand available fields, types, and relationships, then craft queries or have your AI agent generate them based on the schema.
Available tools
getSubgraphSchema
Fetches the schema of a specified subgraph, providing the AI agent with context needed to generate GraphQL queries. It supports outputs as human-readable GraphQL schema or JSON schema depending on the asText flag.
querySubgraph
Executes GraphQL queries against a specified subgraph. While queries are typically generated by AI, you can also craft your own.