search_subgraphs_by_keywordLABSCO SUMMARY
The hard part is picking the right subgraph, and most of these tools exist for that.
Several of the tools are there purely so the model lands on an active deployment before it queries — keyword search, then a volume check, then the schema — because the same protocol has many stale copies indexed. The instructions resource makes that sequence mandatory, so ask your client to load it; without it a model tends to query the first result it sees.
What it is
A server over The Graph Network. It finds subgraphs by keyword, checks which deployment is actually being used, fetches its GraphQL schema, and runs your query against it.
What you get
- Subgraphs found by keyword in their display names, ordered by signal (search_subgraphs_by_keyword)
- Recent query volume for a set of deployments, which is how you tell a live subgraph from an abandoned one (get_deployment_30day_query_counts)
- The GraphQL schema for a deployment, whichever identifier you hold — subgraph ID, deployment ID or IPFS hash (get_schema_by_subgraph_id, get_schema_by_deployment_id, get_schema_by_ipfs_hash)
- Your GraphQL query executed against a deployment named any of those same three ways (execute_query_by_subgraph_id, execute_query_by_deployment_id, execute_query_by_ipfs_hash)
- The busiest deployments indexing a given contract address on a chain, ordered by query fees (get_top_subgraph_deployments)
- A server-instructions resource that spells out the selection workflow, plus prompts for most of the tools
- Prometheus metrics for tool calls and gateway requests when it runs as an HTTP service
Requirements
A Gateway API key for The Graph Network. You can point at the hosted service through a remote bridge, or build the Rust binary and run it yourself; the request timeout is configurable on a local instance.
Setup effort
One command plus a key — npx mcp-remote --header Authorization:${AUTH_HEADER} https://subgraphs.mcp.thegraph.com/sse
USE CASES
Answering a question about a protocol you have not indexed yourself
Search by protocol name, check which deployment is actually being queried, read its schema, then run the query.
Starting from a contract address
Get the deployments indexing that address on the chain you name, then verify recent activity before querying any of them.
Writing a query without the docs open
Fetch the schema first, so entity and field names come from the deployment rather than from memory.
Choosing between two versions of the same protocol
Compare recent query volume across the candidates and take the one people actually use.
9 tools
Listed in project docs. Your client may show a different list.
get_deployment_30day_query_countsget_schema_by_deployment_idget_schema_by_subgraph_idget_schema_by_ipfs_hashexecute_query_by_deployment_idexecute_query_by_subgraph_idexecute_query_by_ipfs_hashget_top_subgraph_deploymentsBEFORE YOU INSTALL
What to know first
Tools you get
9 tools named in the project's documentation.
Requires
- npx on PATH
- Rust
- GATEWAY_API_KEY in your environment
INSTALLATION
Connect your client
Server setup
npx
npx mcp-remote --header Authorization:${AUTH_HEADER} https://subgraphs.mcp.thegraph.com/sseHosted endpoint
https://subgraphs.mcp.thegraph.com/sseAdd this hosted endpoint to your MCP client using the credentials listed under Requirements.
MCP Clients
Claude Desktop — remote
{
"mcpServers": {
"subgraph-mcp": {
"command": "npx",
"args": [
"mcp-remote",
"--header",
"Authorization:${AUTH_HEADER}",
"https://subgraphs.mcp.thegraph.com/sse"
],
"env": {
"AUTH_HEADER": "Bearer <YOUR_GATEWAY_API_KEY>"
}
}
}
}Claude Desktop — local build
git clone https://github.com/graphops/subgraph-mcp
cd subgraph-mcp
cargo build --release{
"mcpServers": {
"subgraph-mcp": {
"command": "<YOUR_PATH_TO_SUBGRAPH_MCP>/target/release/subgraph-mcp",
"env": {
"GATEWAY_API_KEY": "<YOUR_GATEWAY_API_KEY>"
}
}
}
}<YOUR_PATH_TO_SUBGRAPH_MCP> is the absolute path of your clone (run pwd inside it). The binary is target/release/subgraph-mcp. Needs Rust 1.75+.