Back to MCP Directory
Thegraph
Model Context Protocol moderate risk

Thegraph

TheGraph MCP server provides AI agents with access to indexed blockchain data via GraphQL queries, enabling analysis and insights.

Connections & Capabilities

Connects To

GitHub

Capabilities

read

Quickstart

Config

{
  "mcpServers": {
    "thegraph-mcp": {
      "command": "uv",
      "args": ["--directory", "path/to/thegraph-mcp", "run", "main.py"],
      "env": {
        "THEGRAPH_API_KEY": "your_api_key_here"
      }
    }
  }
}

Exposed MCP Tools (2)

safe
getSubgraphSchema

Fetches the schema of a specified subgraph, enabling AI to understand the data structure.

Read-only operation, no data modification.

safe
querySubgraph

Executes a GraphQL query against a specified subgraph, retrieving indexed blockchain data.

Read-only operation, retrieves data based on the query.

Safety Assessment

This server is relatively safe for read-only access to blockchain data. The primary risks involve query construction and API key management. It's crucial to monitor query patterns and secure the API key to prevent abuse.

  • Read-only access to blockchain data
  • Queries are executed against The Graph's infrastructure, not locally
  • No direct modification of blockchain state
  • Schema introspection available for query construction
  • Potential for poorly constructed queries to overload The Graph's infrastructure
  • Exposure of subgraph data to AI agents
  • Reliance on The Graph's security and availability
  • API key required, needs secure storage