Skip to main content
Glama

mcp4gql

by jorgeraad

mcp4gql - GraphQL MCP 服务器

mcp4gql

该项目是一个实现了模型上下文协议 (MCP) 的 Node.js/TypeScript 服务器。它充当桥梁,允许 MCP 客户端(例如 Cursor)与目标 GraphQL API 进行交互。

特征

  • **MCP 服务器:**@modelcontextprotocol/sdk实现 MCP Server类。
  • **Stdio Transport:**通过标准输入/输出与客户端通信。
  • **GraphQL 客户端:**使用axios向配置的 GraphQL 端点发送请求。
  • **通用 GraphQL 工具:**向 MCP 客户端公开以下工具:
    • introspectGraphQLSchema :使用自省获取目标 GraphQL API 模式。
    • executeGraphQLOperation :针对目标 API 执行任意 GraphQL 查询或变异,以query 、可选variables和可选operationName作为输入。

配置

服务器需要以下环境变量:

  • GRAPHQL_ENDPOINT :目标 GraphQL API 的 URL。
  • AUTH_TOKEN :用于使用 GraphQL API 进行身份验证的可选Authorization: Bearer <token>标头的承载令牌。

客户端配置

为了允许 Cursor 或 Claude Desktop 等客户端使用此服务器提供的工具,您需要配置它们以运行npx命令。

光标

  1. 转至光标 MCP 设置(光标 > 设置 > 光标设置 > MCP)
  2. 转至 + 添加新的全局 MCP 服务器
  3. 将以下内容添加到您的 Cursor MCP 配置中:
    { "mcpServers": { "mcp4gql": { "command": "npx", "type": "stdio", "args": ["-y", "mcp4gql"], "env": { "GRAPHQL_ENDPOINT": "YOUR_GRAPHQL_ENDPOINT_URL", "AUTH_TOKEN": "YOUR_OPTIONAL_AUTH_TOKEN" } } } }

克劳德桌面

  1. 打开 Claude 桌面设置(Claude > 设置)。
  2. 转到开发人员>编辑配置。
  3. 添加到配置:
    { "mcpServers": { "mcp4gql": { "command": "npx", "args": ["-y", "mcp4gql"], "env": { "GRAPHQL_ENDPOINT": "YOUR_GRAPHQL_ENDPOINT_URL", "AUTH_TOKEN": "YOUR_OPTIONAL_AUTH_TOKEN" } } } }

配置完成后,MCP 客户端应该能够列出并调用此服务器提供的introspectGraphQLSchemaexecuteGraphQLOperation工具(如有需要)。请务必在配置中设置所需的环境变量( GRAPHQL_ENDPOINT以及可选的AUTH_TOKEN ),以便服务器能够连接到您的 API。

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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 交互,以进行模式自省和操作执行。

  1. 特征
    1. 配置
      1. 客户端配置
        1. 光标
        2. 克劳德桌面

      Related MCP Servers

      • A
        security
        A
        license
        A
        quality
        MCP for working with GraphQL servers.
        Last updated -
        2
        733
        170
        TypeScript
        MIT License
        • Apple
      • -
        security
        F
        license
        -
        quality
        An MCP server that enables graph database interactions with Neo4j, allowing users to access and manipulate graph data through natural language commands.
        Last updated -
        Python
      • -
        security
        A
        license
        -
        quality
        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
        Last updated -
        58
        26
        JavaScript
        MIT License
        • Apple
        • Linux
      • -
        security
        A
        license
        -
        quality
        A Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.
        Last updated -
        733
        1
        MIT License
        • Apple

      View all related MCP servers

      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/jorgeraad/mcp4gql'

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