返回顶部
t

thegraph-mcp-skillTheGraph子图MCP

Use The Graph Subgraph MCP through UXC via native SSE with a fixed linked command for subgraph discovery, schema retrieval, deployment selection, and GraphQL query execution with help-first inspection and explicit auth handling.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
253
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

thegraph-mcp-skill

The Graph MCP 技能

使用此技能通过 uxc 利用原生 SSE MCP 端点运行 The Graph Subgraph MCP 操作。

复用 uxc 技能进行通用协议发现、信封解析和错误处理规则。

前提条件

  • - uxc 已安装并可在 PATH 中使用。
  • 可访问 https://subgraphs.mcp.thegraph.com/sse 的网络连接。
  • 拥有用于认证调用的 The Graph Gateway API 密钥。

核心工作流(The Graph 专用)

最终确定前的端点候选输入:

  • - 官方远程 MCP 端点:

- https://subgraphs.mcp.thegraph.com/sse

  1. 1. 从官方来源验证协议/路径并进行探测:
- 官方来源:https://thegraph.com/docs/en/ai-suite/subgraph-mcp/introduction/ - 使用以下命令探测候选端点: - uxc https://subgraphs.mcp.thegraph.com/sse -h - 确认协议为 MCP(信封中 protocol == mcp)。
  1. 2. 明确检测认证要求:
- 运行主机帮助或最小读取调用并检查信封。 - 此端点需要以 Authorization: Bearer 形式发送 The Graph Gateway API 密钥。
  1. 3. 默认注册凭据并使用固定链接命令:
- uxc auth credential set thegraph --secret-env THEGRAPHAPIKEY - uxc auth binding add --id thegraph-sse --host subgraphs.mcp.thegraph.com --path-prefix /sse --scheme https --credential thegraph --priority 100 - command -v thegraph-mcp-cli - 如果缺失,则创建: - uxc link thegraph-mcp-cli https://subgraphs.mcp.thegraph.com/sse - thegraph-mcp-cli -h - 如果检测到命令冲突且无法安全复用,则停止并请技能维护者选择其他固定命令名称。
  1. 4. 执行前检查操作模式:
- thegraph-mcp-cli -h - thegraph-mcp-cli -h
  1. 5. 优先使用发现/模式操作:
- 查找候选子图或部署 - 检查模式 - 仅在理解标识符和模式后执行查询

能力图谱

  • - 发现:
- 按关键词搜索子图 - 查找合约的顶级部署 - 检查部署流行度/30天查询量
  • - 模式:
- 按部署ID获取模式 - 按子图ID获取模式 - 按IPFS哈希获取模式
  • - 查询执行:
- 按部署ID执行GraphQL查询 - 按子图ID执行GraphQL查询 - 按IPFS哈希执行GraphQL查询

防护措施

  • - 保持自动化使用JSON输出信封;不依赖 --text。
  • 首先解析稳定字段:ok、kind、protocol、data、error。
  • 使用 thegraph-mcp-cli 作为默认命令路径。
  • 当配置相同认证绑定时,thegraph-mcp-cli ... 等同于 uxc https://subgraphs.mcp.thegraph.com/sse ...。
  • 仅在链接设置不可用时,临时使用直接 uxc ... 作为后备方案。
  • 在查询执行前优先进行发现和模式检查。
  • 对于生产/稳定工作流,优先选择面向部署的选择,而非频繁变化的版本引用。
  • 首次通过时保持GraphQL查询范围较小:
- 添加过滤器 - 添加限制 - 仅获取必要字段
  • - 如果认证失败:
- 确认 uxc auth credential info thegraph 成功 - 确认 uxc auth binding match https://subgraphs.mcp.thegraph.com/sse 解析为 thegraph - 重新运行 thegraph-mcp-cli -h

测试过的真实场景

以下流程已通过 uxc 针对实时端点成功执行:

  • - 搜索 uniswap 子图
  • 使用 getdeployment30dayquerycounts 比较候选
  • 选择最高流量的候选
  • 获取所选子图的模式
  • 执行最小化的 _meta GraphQL查询

该次运行中选择的候选是:

  • - 子图ID:5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV
  • 部署IPFS哈希:QmTZ8ejXJxRo7vDBS4uwqBeGoxLSWbhaA7oXa1RvxunLy7

已验证的最小查询格式为:

graphql
{
_meta {
deployment
hasIndexingErrors
}
}

参考

  • - 调用模式:
- references/usage-patterns.md

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 thegraph-mcp-skill-1776193946 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 thegraph-mcp-skill-1776193946 技能

通过命令行安装

skillhub install thegraph-mcp-skill-1776193946

下载

⬇ 下载 thegraph-mcp-skill v1.0.0(免费)

文件大小: 5.51 KB | 发布时间: 2026-4-15 13:43

v1.0.0 最新 2026-4-15 13:43
thegraph-mcp-skill 1.0.0: Initial release.

- Provides The Graph Subgraph MCP integration via UXC, using the native SSE endpoint.
- Supports subgraph discovery, schema retrieval, deployment selection, and GraphQL query execution.
- Enforces help-first inspection and explicit Bearer auth setup with The Graph Gateway API key.
- Includes robust guardrails: stable JSON envelope parsing, credential and command setup, schema-first workflow, and fallback options.
- Documents a full tested scenario querying Uniswap subgraphs with verified query shape.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部