GS

graphops/subgraph-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

8 stars 6 forks 品質 58 トレンド 7Apache-2.0

LLM がグラフネットワーク上で利用可能なサブグラフと対話できるモデルコンテキストプロトコル(MCP)サーバー.

概要

LLM がグラフネットワーク上で利用可能なサブグラフと対話できるモデルコンテキストプロトコル(MCP)サーバー。 - 任意のサブグラフ/デプロイメントのGraphQLスキーマを入手 - 任意のサブグラフ/デプロイメントに対してGraphQLのクエリを実行 - 特定のチェーン上のコントラクトアドレスのためのトップサブグラフの展開を検索 - キーワードでサブグラフを検索 - サブグラフのデプロイメントのための30日間のクエリボリュームを取得する - MCPリソース、ツール、プロンプトをサポート - STDIOモードまたはSSE(Server-Sent Events)サーバーとして実行できます subgraph-mcp サーバは、グラフネットワークとやり取りする2つの主要な方法を提供しています。 はじめる一番早い方法です。 MCP クライアント (例、Claude Desktop) を構成して、ホストされているサブグラフ mcp サービスに接続できます。 - グラフネットワークのゲートウェイAPIキー。 クライアントの構成ファイル(例、claude desktop config.json)に以下を追加します。 実際のゲートウェイ API キーで your GATEWAY API KEY を置換します。 設定を追加した後、MCP クライアントを再起動します.

概要(AI 翻訳)

LLM がグラフネットワーク上で利用可能なサブグラフと対話できるモデルコンテキストプロトコル(MCP)サーバー。

##特徴

  • 任意のサブグラフ/deployment の GraphQL スキーマを取得する
  • 任意のサブグラフ/deployment に対して GraphQL クエリを実行
  • 特定のチェーン上のコントラクトアドレスのためのトップのサブグラフの展開を見つける
  • キーワードで検索
  • サブグラフの展開のための30日間のクエリボリュームを取得します
  • MCP リソース、ツール、プロンプトをサポート
  • STDIOモードまたはSSE(サーバー・セント・イベント)サーバーとして実行できます

使用法

[subgraph-mcp]サーバーは、グラフネットワークと相互作用する2つの主要な方法を提供しています。

1。 リモートホストMCPサービスに接続(ほとんどのユーザーに推奨) 2.サーバーをローカルにビルドして実行

##リモートホストMCPサービスに接続する

はじめる一番早い方法です。 ホストされている subgraph-mcp サービスに接続するには、MCP クライアント (Claude Desktop など) を設定できます。

要件

  • グラフネットワークのゲートウェイAPIキー。
設定

クライアントの構成ファイル(例、[claude_desktop_config.json])に以下を追加します。

実際の Gateway API キーで [YOUR_GATEWAY_API_KEY] を置換します.

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Subgraph MCP Server

A Model Context Protocol (MCP) server that allows LLMs to interact with Subgraphs available on The Graph Network.

Features

  • Get the GraphQL schema for any subgraph/deployment
  • Execute GraphQL queries against any subgraph/deployment
  • Find the top subgraph deployments for a contract address on a specific chain
  • Search for subgraphs by keyword
  • Get 30-day query volume for subgraph deployments
  • Supports MCP resources, tools, and prompts
  • Can run in STDIO mode or as an SSE (Server-Sent Events) server

Usage

The subgraph-mcp server offers two primary ways to interact with The Graph Network:

  1. Connecting to the Remote Hosted MCP Service (Recommended for most users)
  2. Building and Running the Server Locally

Connecting to the Remote Hosted MCP Service

This is the quickest way to get started. You can configure your MCP client (e.g., Claude Desktop) to connect to our hosted subgraph-mcp service.

Requirements

  • A Gateway API key for The Graph Network.

Configuration

Add the following to your configuration file of your client (e.g.,claude_desktop_config.json):

{
  "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" // <-- Replace with your actual key
      }
    }
  }
}

Replace YOUR_GATEWAY_API_KEY with your actual Gateway API key. After adding the configuration, restart your MCP client.

Once configured, you can skip to the “Available Tools” or “Natural Language Queries” sections to learn how to interact with the service.

Building and Running the Server Locally

This option is for users who prefer to build, run, and potentially modify the server on their own machine.

Requirements (for Local Execution)

  • Rust (latest stable version recommended: 1.75+).
    You can install it using the following command on macOS, Linux, or other Unix-like systems: \
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
    Follow the on-screen instructions. For other platforms, see the official Rust installation guide.
  • A Gateway API key for The Graph Network.

Installation (for Local Execution)

# Clone the repository
git clone [email protected]:graphops/subgraph-mcp.git
cd subgraph-mcp

# Build the project
cargo build --release

Configuration (for Local Execution)

Add the following to your configuration file of your client (e.g.,claude_desktop_config.json):

{
  "mcpServers": {
    "subgraph-mcp": {
      "command": "/path/to/your/subgraph-mcp/target/release/subgraph-mcp", // <-- Replace this with the actual path!
      "env": {
        "GATEWAY_API_KEY": "YOUR_GATEWAY_API_KEY" // <-- Replace with your actual key
      }
    }
  }
}
GitHub で README 全文を見る

インストール

npx mcp-remote --header Authorization:${AUTH_HEADER} https://subgraphs.mcp.thegraph.com/sse
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "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" // <-- Replace with your actual key } } } }