Usage Patterns

All commands in this skill use the native MCP SSE endpoint: https://subgraphs.mcp.thegraph.com/sse

This skill defaults to fixed link command thegraph-mcp-cli. Create it when missing:

command -v thegraph-mcp-cli
uxc auth credential set thegraph --secret-env THEGRAPH_API_KEY
uxc auth binding add --id thegraph-sse --host subgraphs.mcp.thegraph.com --path-prefix /sse --scheme https --credential thegraph --priority 100
uxc link thegraph-mcp-cli https://subgraphs.mcp.thegraph.com/sse
thegraph-mcp-cli -h

Notes:

Discover And Inspect

thegraph-mcp-cli -h
thegraph-mcp-cli <operation> -h

Use help-first inspection to identify the exact operation names exposed by the bridge in your current version.

Read-First Flow

Recommended workflow:

  1. Search candidate subgraphs or deployments
  2. Inspect schema for the chosen deployment/subgraph
  3. Run a minimal GraphQL query with limited fields and rows

Example Query Payload Pattern

Most query execution operations accept either key/value fields or positional JSON. Prefer positional JSON for GraphQL requests with embedded query text:

thegraph-mcp-cli <query-operation> '{"query":"{ _meta { deployment } }"}'

When the operation requires a deployment ID, subgraph ID, or IPFS hash, inspect -h first and include only the required identifier plus the GraphQL query.

Example Discovery Pattern

Search by keyword first, then pivot to schema:

thegraph-mcp-cli <search-operation> keyword=uniswap
thegraph-mcp-cli <schema-operation> deploymentId=Qm...

Contract-oriented discovery:

thegraph-mcp-cli <contract-discovery-operation> contractAddress=0x...

Practical Rules For GraphQL Through MCP

Output Parsing

Rely on envelope fields:

Fallback Equivalence