by kukapay
Provides AI agents with access to indexed blockchain data from The Graph via schema retrieval and GraphQL query tools.
TheGraph Mcp Server powers AI agents by exposing indexed blockchain data from The Graph. It offers two core tools – one to fetch a subgraph’s schema (either as human‑readable GraphQL or JSON) and another to execute arbitrary GraphQL queries against a subgraph.
getSubgraphSchema
and querySubgraph
) from your AI agent or prompt interface, supplying the subgraph ID and relevant parameters.getSubgraphSchema
) – returns GraphQL or JSON schema for any subgraph ID.querySubgraph
) – runs any GraphQL query against the chosen subgraph.uv run main.py
with an API key.Q: Which blockchain networks are supported?
A: Any network that has an indexed subgraph on The Graph, as identification is based solely on the subgraph ID.
Q: Do I need a The Graph API key?
A: Yes, set THEGRAPH_API_KEY
in the server environment to authenticate requests.
Q: Can I customize the query tool?
A: The querySubgraph
tool accepts any valid GraphQL string, so you can tailor queries to your specific needs.
Q: What Python version is required?
A: Python 3.10 or newer.
Q: How is the server started?
A: Using the uv
command as configured in the serverConfig
section below.
An MCP server that powers AI agents with indexed blockchain data from The Graph.
Fetches the schema of a specified subgraph, providing AI agents with the context needed to generate GraphQL queries.
Parameters:
subgraphId
: The subgraph ID (e.g., "QmZBQcF...")asText
: Output format flag
true
: Returns human-readable GraphQL schemafalse
: Returns JSON schema (default)Executes GraphQL queries against a specified subgraph. While queries are typically generated by AI, you can also manually craft your own.
Parameters:
subgraphId
: The subgraph IDquery
: GraphQL query stringgit clone https://github.com/kukapay/thegraph-mcp.git
{
"mcpServers": {
"thegraph-mcp": {
"command": "uv",
"args": ["--directory", "path/to/thegraph-mcp", "run", "main.py"],
"env": {
"THEGRAPH_API_KEY": "your_api_key_here"
}
}
}
}
Here are some natural language prompts to trigger the tools:
This project is licensed under the MIT License. See the LICENSE file for details.
Please log in to share your review and rating for this MCP.
{ "mcpServers": { "thegraph-mcp": { "command": "uv", "args": [ "--directory", "path/to/thegraph-mcp", "run", "main.py" ], "env": { "THEGRAPH_API_KEY": "your_api_key_here" } } } }
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
An MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.
by danny-avila
Provides a self‑hosted ChatGPT‑style interface supporting numerous AI models, agents, code interpreter, image generation, multimodal interactions, and secure multi‑user authentication.
by block
Automates engineering tasks on local machines, executing code, building projects, debugging, orchestrating workflows, and interacting with external APIs using any LLM.
by RooCodeInc
Provides an autonomous AI coding partner inside the editor that can understand natural language, manipulate files, run commands, browse the web, and be customized via modes and instructions.
by pydantic
A Python framework that enables seamless integration of Pydantic validation with large language models, providing type‑safe agent construction, dependency injection, and structured output handling.
by lastmile-ai
Build effective agents using Model Context Protocol and simple, composable workflow patterns.
by mcp-use
A Python SDK that simplifies interaction with MCP servers and enables developers to create custom agents with tool‑calling capabilities.
by nanbingxyz
A cross‑platform desktop AI assistant that connects to major LLM providers, supports a local knowledge base, and enables tool integration via MCP servers.
by gptme
Provides a personal AI assistant that runs directly in the terminal, capable of executing code, manipulating files, browsing the web, using vision, and interfacing with various LLM providers.