If you’ve ever wanted to ask blockchain data questions in plain English without worrying about GraphQL syntax, query limits, or which subgraph to use, know Subgraph MCP is the missing piece.
In this guide, you’ll learn how to:
- Get an API key from The Graph Marketplace
- Configure Subgraph MCP in Cursor or Claude Desktop
- Understand how this unlocks ~15,000 subgraphs for natural‑language querying
No custom queries. No rate‑limit anxiety. Just ask questions.
What is Subgraph MCP?
Subgraph MCP (Model Context Protocol) lets large language models (LLMs) reason about and query subgraphs on your behalf.
Instead of writing GraphQL yourself, you:
- Ask a question in natural language
- The LLM selects the best subgraph or you can ask it to use a subgraph based on deployment ID
- It generates and runs the query. It reads the schema to know what content each subgraph has.
- You get structured results back
All powered by The Graph’s decentralized data layer.
Why Subgraph MCP Matters
Without MCP:
- You must know which subgraph to use. This requires a lot of filtering and searching.
- You must write correct GraphQL query.
- You must manage API limits and errors.
With Subgraph MCP:
- One API key gives access to ~15,000 subgraphs
- The LLM chooses the right schema automatically
- Queries are handled safely and efficiently
- You focus on questions, not infrastructure
This is what makes “chatting with blockchain data” actually practical.
Step 1: Get an API Key from The Graph Marketplace
Subgraph MCP uses an API key.
1. Create an API Key with The Graph
https://medium.com/media/376d9fbba1e2db2c1dafd44cc9b99c05/href
⚠️ Treat this like a password. Anyone with this token can query on your behalf.
Step 2: Download Cursor
Graph Docs
https://thegraph.com/docs/en/ai-suite/subgraph-mcp/cursor/
Cursor Quickstart docs
https://cursor.com/docs/get-started/quickstart
Head to settings:
Click on Tools and MCPs:
Cursor supports MCP via a simple JSON config.
Paste the following JSON and replace Bearer GATEWAY_API_Key
*use your API Key from above
{
"mcpServers": {
"subgraph": {
"command": "npx",
"args": ["mcp-remote", "--header", "Authorization:${AUTH_HEADER}", "https://subgraphs.mcp.thegraph.com/sse"],
"env": {
"AUTH_HEADER": "Bearer GATEWAY_API_KEY"
}
}
}
}
Step 4. Save and Restart Cursor
Once enabled, Cursor can now:
- Discover subgraph schemas
- Generate queries automatically
- Execute them securely
Claude Desktop uses the same MCP concept with a local config file.
Graph Docs for Claude
https://thegraph.com/docs/en/ai-suite/subgraph-mcp/claude/
1. Install Claude Desktop
https://medium.com/media/05df3b28f86791fefa297db1aeb48254/href
2. Add the Subgraph MCP Server
Paste the following JSON and replace Bearer GATEWAY_API_Key
*use your API Key from above
{
"mcpServers": {
"subgraph": {
"command": "npx",
"args": ["mcp-remote", "--header", "Authorization:${AUTH_HEADER}", "https://subgraphs.mcp.thegraph.com/sse"],
"env": {
"AUTH_HEADER": "Bearer GATEWAY_API_KEY"
}
}
}
}https://medium.com/media/5d8398ebce74de2ba11bd7f9c4c976b5/href
3. Restart Claude Desktop
Claude will now be able to:
- Inspect thousands of subgraph schemas
- Choose the correct one automatically
- Run queries safely on your behalf
https://medium.com/media/aa414b5222748ce81b82969ed63e520c/href
What You Can Ask Once It’s Set Up
After setup, you can ask questions like:
- “What was Uniswap v3 volume on Base yesterday?”
- “Show me the top token holders for this ERC‑20.”
- “How many users interacted with this contract last week?”
- “What’s the TVL change for this protocol over 30 days?”
You don’t need to:
- Know the subgraph name
- Know the deployment ID (it does help to point AI to deployment ID).
- Write queries
The LLM handles all of it.
Final Thoughts
Subgraph MCP turns The Graph into a conversational data layer.
With a single question:
- You unlock ~15,000 subgraphs
- You eliminate boilerplate queries
- You let LLMs do what they’re good at: reasoning
If you’re building dashboards, bots, research tools, or just exploring on‑chain data this is the fastest path from question to answer.
Talk to 15,000+ Subgraphs: Setting Up Subgraph MCP in Cursor or Claude Desktop was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact service@support.mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.