mcp4gql - GraphQL MCP サーバー

このプロジェクトは、Model Context Protocol(MCP)を実装したNode.js/TypeScriptサーバーです。MCPクライアント(Cursorなど)が対象のGraphQL APIとやり取りできるようにするブリッジとして機能します。
特徴
MCP サーバー:
@modelcontextprotocol/sdkから MCPServerクラスを実装します。**Stdio トランスポート:**標準入出力を介してクライアントと通信します。
GraphQL クライアント:
axiosを使用して、構成された GraphQL エンドポイントにリクエストを送信します。**汎用 GraphQL ツール:**次のツールを MCP クライアントに公開します。
introspectGraphQLSchema: イントロスペクションを使用してターゲットの GraphQL API スキーマを取得します。executeGraphQLOperation:query、オプションのvariables、およびオプションのoperationNameを入力として、ターゲット API に対して任意の GraphQL クエリまたはミューテーションを実行します。
構成
サーバーには次の環境変数が必要です。
GRAPHQL_ENDPOINT: ターゲット GraphQL API の URL。AUTH_TOKEN: GraphQL API で認証するためのオプションのAuthorization: Bearer <token>ヘッダーのベアラー トークン。
クライアント構成
Cursor や Claude Desktop などのクライアントがこのサーバーが提供するツールを使用できるようにするには、 npxコマンドを実行するようにクライアントを構成する必要があります。
カーソル
カーソルMCP設定に移動します(カーソル > 設定 > カーソル設定 > MCP)
新しいグローバルMCPサーバーを追加に移動します
カーソル MCP 構成に以下を追加します。
{ "mcpServers": { "mcp4gql": { "command": "npx", "type": "stdio", "args": ["-y", "mcp4gql"], "env": { "GRAPHQL_ENDPOINT": "YOUR_GRAPHQL_ENDPOINT_URL", "AUTH_TOKEN": "YOUR_OPTIONAL_AUTH_TOKEN" } } } }
クロードデスクトップ
Claude デスクトップの設定を開きます (Claude > 設定)。
「開発者 > 構成の編集」に移動します。
設定に追加:
{ "mcpServers": { "mcp4gql": { "command": "npx", "args": ["-y", "mcp4gql"], "env": { "GRAPHQL_ENDPOINT": "YOUR_GRAPHQL_ENDPOINT_URL", "AUTH_TOKEN": "YOUR_OPTIONAL_AUTH_TOKEN" } } } }
設定が完了すると、MCPクライアントは、このサーバーが提供するintrospectGraphQLSchemaおよびexecuteGraphQLOperationツールを必要に応じて一覧表示し、呼び出すことができるようになります。サーバーがAPIに接続できるように、必要な環境変数( GRAPHQL_ENDPOINTおよびオプションでAUTH_TOKEN )を設定してください。
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
GraphQL MCP サーバーはブリッジとして機能し、MCP クライアント (Cursor や Claude Desktop など) がスキーマ イントロスペクションと操作実行のための標準ツールを通じてターゲット GraphQL API と対話できるようにします。
Related Resources
Related MCP Servers
- Asecurity-licenseAqualityMCP for working with GraphQL servers.Last updated -2502296MIT License
- -security-license-qualityA 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 contextLast updated -1742MIT License
- -security-license-qualityAn MCP server that connects any MCP client (like Claude or Cursor) with the browser using browser-use, allowing clients to utilize existing LLMs without requiring additional API keys.Last updated -74Apache 2.0
- -security-license-qualityA server that allows you to explore the GitHub GraphQL schema and execute GraphQL queries through MCP client tools, enabling efficient data retrieval from GitHub with reduced token consumption.Last updated -4