Skip to main content
Glama

TheGraph MCP 서버

The Graph 의 색인화된 블록체인 데이터를 사용하여 AI 에이전트에 전력을 공급하는 MCP 서버입니다.

GitHub 라이센스GitHub 마지막 커밋파이썬 버전

사용 가능한 도구

1. getSubgraphSchema

지정된 하위 그래프의 스키마를 가져와서 AI 에이전트에게 GraphQL 쿼리를 생성하는 데 필요한 컨텍스트를 제공합니다.

매개변수:

  • subgraphId : 하위 그래프 ID(예: "QmZBQcF...")

  • asText : 출력 형식 플래그

    • true : 사람이 읽을 수 있는 GraphQL 스키마를 반환합니다.

    • false : JSON 스키마를 반환합니다(기본값)

2. 쿼리 서브그래프

지정된 하위 그래프에 대해 GraphQL 쿼리를 실행합니다. 쿼리는 일반적으로 AI에 의해 생성되지만, 직접 작성할 수도 있습니다.

매개변수:

  • subgraphId : 하위 그래프 ID

  • query : GraphQL 쿼리 문자열

Related MCP server: Subgraph Registry MCP

설치

  1. 저장소 복제

    지엑스피1

  2. 클라이언트 구성

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

예시 프롬프트

도구를 작동시키는 자연어 프롬프트는 다음과 같습니다.

스키마 쿼리

  • "읽을 수 있는 형식으로 하위 그래프 QmZBQcF의 스키마를 보여주세요"

  • "QmZBQcF... 하위 그래프의 구조는 무엇인가요? GraphQL 형식으로 표시해 주세요."

  • "QmZBQcF... 서브그래프의 데이터 모델을 이해해야 하는데, 스키마를 가져올 수 있나요?"

데이터 쿼리

  • "QmZBQcF 하위 그래프에서 지난 24시간 동안 거래량 기준 상위 5개 토큰을 찾으세요..."

  • "QmZBQcF 하위 그래프에서 유동성이 100만 달러 이상인 모든 쌍을 보여주세요..."

  • "QmZBQcF... 하위 그래프에서 토큰 심볼과 금액을 포함한 최신 10개 스왑 이벤트를 받으세요"

분석 작업

  • "QmZBQcF 하위 그래프를 사용하여 지난주 USDT 쌍의 거래량을 분석합니다..."

  • "QmZBQcF 하위 그래프에서 ETH와 USDC 쌍의 유동성을 비교하세요..."

  • "QmZBQcF 하위 그래프에서 지난 24시간 동안의 특이한 거래 패턴을 찾으세요..."

결합된 작업

  • "먼저 QmZBQcF의 스키마를 구한 다음, 고가 거래를 찾는 쿼리를 작성하는 데 도움을 주세요."

  • "QmZBQcF의 스키마를 확인하고 토큰 가격을 쿼리하는 데 사용할 수 있는 필드를 알려주세요."

  • "QmZBQcF... 하위 그래프를 사용하여 먼저 스키마를 이해한 다음 관련 이벤트를 쿼리하여 대규모 거래의 시장 영향을 분석합니다."

특허

이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 라이선스 파일을 참조하세요.

Available Tools

2 tools
getSubgraphSchemaA

Fetch the schema of a specified subgraph using GraphQL introspection.

Args: subgraphId (str): The ID of the subgraph to query. asText (bool): If True, return schema as GraphQL text; otherwise, return JSON.

Returns: str: Schema in JSON or GraphQL text format, or an error message.

ParametersJSON Schema
NameRequiredDescriptionDefault
subgraphIdYes
asTextNo

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses the return format options (JSON or GraphQL text) and mentions error messages, but lacks details about authentication requirements, rate limits, or what happens with invalid subgraph IDs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear purpose statement followed by Args and Returns sections. It's appropriately sized, though the 'Args' and 'Returns' labels could be more integrated with the flow rather than section headers.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 2 parameters, no annotations, and no output schema, the description provides good coverage of purpose, parameters, and return behavior. It could be more complete by addressing authentication or error scenarios, but covers the essentials adequately.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by clearly explaining both parameters: 'subgraphId' specifies which subgraph to query, and 'asText' controls the return format (text vs JSON). This adds essential meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Fetch the schema') and resource ('specified subgraph using GraphQL introspection'), distinguishing it from the sibling 'querySubgraph' which presumably executes queries rather than fetching schema metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for obtaining schema information via introspection, but does not explicitly state when to use this tool versus the sibling 'querySubgraph' or provide any exclusions or prerequisites for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

querySubgraphA

Execute a GraphQL query against a specified subgraph.

Args: subgraphId (str): The ID of the subgraph to query. query (str): The GraphQL query string to execute.

Returns: str: Query result in JSON format, or an error message.

ParametersJSON Schema
NameRequiredDescriptionDefault
subgraphIdYes
queryYes

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool executes queries and returns results or errors, which covers basic functionality. However, it doesn't mention authentication requirements, rate limits, timeout behavior, or whether queries are read-only or can mutate data. The description adds some value but lacks comprehensive behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly structured with a clear purpose statement followed by well-organized sections for Args and Returns. Every sentence earns its place, with no redundant information. The formatting with clear headings makes it easy to parse while remaining extremely concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of GraphQL query execution and the lack of both annotations and output schema, the description provides adequate but minimal information. It covers the basic purpose and parameters but doesn't explain the format of query results beyond 'JSON format', nor does it address error handling, authentication, or other operational considerations that would be helpful for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate for the lack of parameter documentation in the schema. It clearly explains that 'subgraphId' identifies which subgraph to query and 'query' is the GraphQL query string to execute, providing essential semantic meaning beyond the bare schema. However, it doesn't specify format requirements or constraints for these parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Execute a GraphQL query') and resource ('against a specified subgraph'), distinguishing it from the sibling tool 'getSubgraphSchema' which presumably retrieves schema information rather than executing queries. The verb+resource combination is precise and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying it's for executing GraphQL queries against subgraphs, but doesn't explicitly state when to use this tool versus alternatives like 'getSubgraphSchema' or other query methods. It provides clear context but lacks explicit comparison or exclusion guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updates
    • First observedgetSubgraphSchema
    • First observedquerySubgraph

TDQS

A3.9/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: getSubgraphSchema retrieves schema information via introspection, while querySubgraph executes actual GraphQL queries. There is no overlap in functionality, making it easy for an agent to select the correct tool based on the need for metadata versus data retrieval.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern (getSubgraphSchema, querySubgraph) using camelCase, which is predictable and readable. The naming convention is uniform across all tools, with no deviations or mixed styles.

Tool Count2/5

With only 2 tools, the server feels thin for interacting with The Graph protocol, which typically involves more operations like listing subgraphs, managing deployments, or handling subscriptions. This limited set may restrict agents from performing comprehensive tasks in the domain.

Completeness2/5

The tool surface is severely incomplete for a The Graph server, lacking essential operations such as listing available subgraphs, creating or updating subgraphs, and handling mutations or subscriptions. Agents will face dead ends when trying to perform basic lifecycle management or discover subgraphs beyond a known ID.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers