Skip to main content
Glama
mabdullah679

Apollo MCP Demo

by mabdullah679

Apollo MCP デモ

このフォルダーは、Apollo が MCP 用にデモンストレーションしているコアアーキテクチャを構築します。

  1. 通常の GraphQL API

  2. その手前に配置された Apollo MCP サーバー

  3. MCP ツールとなる GraphQL 操作の小さな許可リスト

このバージョンでは、GraphOS の認証情報なしでローカルで簡単に実行できるように、rover init --mcp ウィザードの代わりにスタンドアロンの Apollo MCP サーバーコンテナを使用しています。

開始されるもの

  • api: http://localhost:4001/ で動作する小さな Apollo Server

  • mcp: http://localhost:8000/mcp で動作する Apollo MCP サーバー

Related MCP server: mcp4gql

アーキテクチャ図

flowchart LR
    subgraph LocalMachine["Local machine"]
        Client["MCP client\nInspector / Codex / Cursor"]

        subgraph Docker["docker compose"]
            MCP["Apollo MCP Server\n:8000/mcp"]
            API["Apollo GraphQL API\n:4001"]
        end

        Ops["graphql/operations/*.graphql\nApproved operations"]
        Schema["graphql/api.graphql\nSchema snapshot"]
    end

    Client -->|"MCP over Streamable HTTP"| MCP
    Ops -->|"tool definitions"| MCP
    Schema -->|"schema metadata"| MCP
    MCP -->|"GraphQL queries/mutations"| API
    API -->|"GraphQL JSON response"| MCP
    MCP -->|"MCP tool results"| Client

実行方法

cd C:\Users\muham\Documents\apollo-mcp
npm install
docker compose up --build

別のターミナルで、MCP サーバーを検査します:

npx @modelcontextprotocol/inspector

次に、表示されたインスペクターの URL を開き、以下を選択します:

  • Transport Type: Streamable HTTP

  • URL: http://127.0.0.1:8000/mcp

Connect をクリックし、次に List Tools をクリックします。

以下から派生した MCP ツールが表示されるはずです:

  • GetBooks

  • GetBookById

  • GetBooksByGenre

オプションのクライアント設定

mcp-remote を使用する MCP クライアントの場合、ローカル設定の形式は以下の通りです:

{
  "mcpServers": {
    "apollo-demo": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://127.0.0.1:8000/mcp"
      ]
    }
  }
}

実際に何が起きているのか

GraphQL API は依然として実際のデータサービスです。スキーマを把握し、フィールドを解決し、GraphQL クエリに対して JSON を返します。

Apollo MCP サーバーはその API を置き換えるものではありません。その手前に位置し、承認された GraphQL 操作を AI クライアントが発見して呼び出せる MCP ツールに変換します。

重要なファイルは以下の通りです:

  • mcp-config.yaml: GraphQL エンドポイントの場所、スキーマファイルの場所、許可された操作の場所、および MCP を HTTP 経由で公開する方法を Apollo MCP サーバーに伝えます。

  • graphql/api.graphql: Apollo MCP サーバーがツールを正しく記述できるように使用されるスキーマのスナップショットです。

  • graphql/operations/GetBooks.graphql: 1 つの MCP ツールとなる承認済みのクエリです。

  • src/server.mjs: 実際の GraphQL API 実装です。

  • docker-compose.yml: 両方のサービスを 1 つのローカルネットワーク上で同時に実行します。

リクエストの流れは以下の通りです:

  1. MCP クライアントが http://localhost:8000/mcp に接続します。

  2. Apollo MCP サーバーが .graphql 操作ファイルに基づいてツールをアドバタイズします。

  3. クライアントが引数を指定してそれらのツールのいずれかを呼び出します。

  4. Apollo MCP サーバーがそのツール呼び出しを基盤となる GraphQL 操作に変換します。

  5. Apollo MCP サーバーがその GraphQL リクエストを http://api:4001/ に送信します。

  6. GraphQL API がクエリを実行し、データを返します。

  7. Apollo MCP サーバーが結果を MCP 形式で MCP クライアントに返します。

リクエストフロー図

sequenceDiagram
    autonumber
    participant C as MCP Client
    participant M as Apollo MCP Server
    participant O as Operation Files
    participant G as GraphQL API

    C->>M: Connect to http://localhost:8000/mcp
    M->>O: Load approved .graphql operations
    O-->>M: GetBooks / GetBookById / GetBooksByGenre
    M-->>C: Advertise MCP tools
    C->>M: Invoke tool with arguments
    M->>M: Convert tool call to GraphQL operation
    M->>G: Send GraphQL request to http://api:4001/
    G-->>M: Return GraphQL JSON data
    M-->>C: Return MCP-formatted tool result

なぜここにルーターがないのか

Apollo Router は以下の場合に役立ちます:

  • フェデレーションされたスーパーグラフを提供している場合

  • Apollo の GraphOS 管理ランタイムを使用したい場合

  • または、GraphQL と MCP を Apollo Runtime にバンドルしたい場合

既存の GraphQL API が 1 つあるシンプルなローカルデモの場合、Apollo のデプロイメントドキュメントでは、そのエンドポイントに対してスタンドアロンの Apollo MCP サーバーコンテナを直接使用することがサポートされています。このプロジェクトではそれを使用しています。

ソース

F
license - not found
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    A MCP server that exposes GraphQL schema information to LLMs like Claude. This server allows an LLM to explore and understand large GraphQL schemas through a set of specialized tools, without needing to load the whole schema into the context
    70
    47
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    GraphQL MCP Server that acts as a bridge allowing MCP clients (like Cursor or Claude Desktop) to interact with target GraphQL APIs through standard tools for schema introspection and operation execution.
    2
    15
    3
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A generic MCP (Model Context Protocol) server that bridges any GraphQL API to Claude Code. It introspects your GraphQL schema and exposes each query and mutation as an individual tool, letting Claude interact with your API directly.
    2
    52
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • MCP server for AI access to Swagger by SmartBear.

  • MCP server for AI access to SmartBear tools, including BugSnag, Reflect, Swagger, PactFlow, QTM4J.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mabdullah679/apollo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server