Skip to content

Commit 8a1d5d2

Browse files
Added AGENTS.md file
1 parent 8f0d76a commit 8a1d5d2

3 files changed

Lines changed: 87 additions & 1 deletion

File tree

nginx.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ http {
174174
rewrite ^/docs/en/ai-suite/substreams-skills/$ $scheme://$http_host/docs/en/substreams/skills/ permanent;
175175
rewrite ^/docs/en/ai-suite/substreams-mcp/$ $scheme://$http_host/docs/en/substreams/substreams-mcp/ permanent;
176176
rewrite ^/docs/en/ai-suite/$ $scheme://$http_host/docs/en/ai-overview/ permanent;
177+
rewrite ^/docs/AGENTS.md$ $scheme://$http_host/docs/en/AGENTS.md permanent;
177178

178179
# Token API redirects
179180
rewrite ^/docs/en/token-api/quick-start/$ https://app.pinax.network/docs/api/ permanent;

website/src/AGENTS.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# AGENTS.md — The Graph
2+
3+
> Machine-readable guide for autonomous AI agents that want to access blockchain data through The Graph at runtime. The Graph indexes and serves on-chain data across 60+ networks. Agents can consume it three ways: native MCP servers (recommended) and an x402-enabled Subgraph gateway.
4+
5+
**Audience:** AI agents, LLM tools, and autonomous systems integrating The Graph as a data source. **Last updated:** 2026-05-29 **Related files:** [/llms.txt](https://thegraph.com/llms.txt) · [/pricing.md](https://thegraph.com/pricing.md) · [/robots.txt](https://thegraph.com/robots.txt)
6+
7+
---
8+
9+
## Recommended: MCP server
10+
11+
The Graph publishes Model Context Protocol (MCP) servers — the preferred interface for agents. They work with Claude, Cursor, Cline, and any MCP-compatible client.
12+
13+
### Subgraph MCP
14+
15+
Search, inspect, and query 15,000+ Subgraphs on The Graph Network in natural language.
16+
17+
- **Endpoint:** `https://subgraphs.mcp.thegraph.com/sse`
18+
- **Transport:** SSE (remote)
19+
- **Auth:** `Authorization: Bearer <GATEWAY_API_KEY>` — get a Gateway API key from [Subgraph Studio](https://thegraph.com/studio/)
20+
- **Docs:** https://thegraph.com/docs/en/ai-suite/subgraph-mcp/introduction/
21+
22+
**Tools:** | Tool | Purpose | |---|---| | `search_subgraphs_by_keyword` | Find Subgraphs by protocol/keyword | | `get_top_subgraph_deployments` | Rank deployments for a keyword by activity | | `get_deployment_30day_query_counts` | Check 30-day query volume (verify a deployment is live before querying) | | `get_schema_by_subgraph_id` / `get_schema_by_deployment_id` / `get_schema_by_ipfs_hash` | Fetch the GraphQL schema | | `execute_query_by_subgraph_id` / `execute_query_by_deployment_id` / `execute_query_by_ipfs_hash` | Run a GraphQL query against a deployment |
23+
24+
**Recommended agent workflow:** identify the protocol → `search_subgraphs_by_keyword``get_deployment_30day_query_counts` to confirm an active deployment → `get_schema_by_*` → build and `execute_query_by_*`.
25+
26+
**Cursor / Claude config:**
27+
28+
```json
29+
{
30+
"mcpServers": {
31+
"subgraph": {
32+
"command": "npx",
33+
"args": ["mcp-remote", "--header", "Authorization:${AUTH_HEADER}", "https://subgraphs.mcp.thegraph.com/sse"],
34+
"env": { "AUTH_HEADER": "Bearer GATEWAY_API_KEY" }
35+
}
36+
}
37+
}
38+
```
39+
40+
### Subgraphs via Subgraph (GraphQL) gateway
41+
42+
Query any Subgraph on the decentralized network directly over GraphQL.
43+
44+
- **URL pattern:** https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>
45+
- **Method:** POST (GraphQL). If you get a 405 on GET, switch to POST.
46+
- **Auth:** API key from Subgraph Studio embedded in the URL path
47+
- **Discovery:** find <SUBGRAPH_ID> via Graph Explorer or the Subgraph MCP search_subgraphs_by_keyword tool
48+
- **Docs:** https://thegraph.com/docs/en/subgraphs/querying/from-an-application/
49+
- **Skills:** https://thegraph.com/docs/en/subgraphs/skills/
50+
51+
Example:
52+
53+
```
54+
curl -X POST \
55+
"https://gateway.thegraph.com/api/<API_KEY>/subgraphs/id/<SUBGRAPH_ID>" \
56+
-H "Content-Type: application/json" \
57+
-d '{"query":"{ tokens(first: 5) { id symbol } }"}'
58+
```
59+
60+
### Substreams via The Graph Market
61+
62+
High-throughput, real-time streaming data pipelines. Served via a provider marketplace; discovery and packages are MCP-accessible.
63+
64+
- **Marketplace:** https://thegraph.market
65+
- **Substreams registry / discovery:** Substreams.dev lets you search packages, inspect modules, and get sink configs programmatically
66+
- **Docs:** https://thegraph.com/docs/en/substreams/quick-start/
67+
- **Skills:** https://thegraph.com/docs/en/substreams/skills/
68+
69+
### Authentication summary
70+
71+
| Surface | Credential | Where to get it |
72+
| ------------------------ | ------------------------ | ------------------------- |
73+
| Subgraph MCP | Gateway API key (Bearer) | Subgraph Studio |
74+
| Subgraph GraphQL gateway | API key (in URL) | Subgraph Studio |
75+
| Substreams | JWT access token | thegraph.market dashboard |
76+
77+
### Rate limits & cost
78+
79+
Pricing and rate limits are documented in /pricing.md. Subgraph queries: 100,000/month free, then $2 per 100,000. Requests over a plan's rate limit return HTTP 429.
80+
81+
### Support
82+
83+
Docs: https://thegraph.com/docs/en/ AI Suite overview: https://thegraph.com/docs/en/ai-suite/ai-introduction/ Discord: https://discord.gg/graphprotocol

website/src/pages/en/about.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ description: This page summarizes the core concepts and basics of The Graph Netw
55

66
## What is The Graph?
77

8-
The Graph is a suite of blockchain data infrastructure products that extract, process, and deliver scalable blockchain data solutions across 60+ networks. The Graph enables application developers, data analysts, AI agents, and enterprise teams that need structured, reliable, and real-time access to blockchain data. Products include Subgraphs, Substreams, and Amp. As of early 2026, The Graph has served over 1.27 trillion queries to more than 75,000 projects, powered by 50+ independent Indexer nodes worldwide. To learn more about The Graph from a non-technical perspective, visit [The Graph Overview](https://thegraph.com/what-is-the-graph/).
8+
The Graph is a suite of blockchain data infrastructure products that extract, process, and deliver scalable blockchain data solutions across 60+ networks. The Graph enables application developers, data analysts, AI agents, and enterprise teams that need structured, reliable, and real-time access to blockchain data. Products include Subgraphs, Substreams, and Amp. As of early 2026, The Graph has served over 1.27 trillion queries to more than 75,000 projects, powered by 50+ independent Indexer nodes worldwide.
9+
10+
To learn more about The Graph from a non-technical perspective, visit [The Graph Overview](https://thegraph.com/what-is-the-graph/).
911

1012
## Why Blockchain Data is Difficult to Index
1113

0 commit comments

Comments
 (0)