mcp4gql

by jorgeraad
MIT License
0
1

Integrations

  • Uses Axios to send requests to GraphQL endpoints, allowing for authenticated API interactions with configurable authorization tokens.

  • Acts as a bridge to any GraphQL API, providing tools to introspect schemas and execute arbitrary queries or mutations against the target GraphQL endpoint.

  • Built on Node.js to implement the Model Context Protocol server functionality, enabling GraphQL API interactions through standard I/O.

mcp4gql - GraphQL MCP 服务器

该项目是一个实现了模型上下文协议 (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。

You must be authenticated.

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

GraphQL MCP 服务器充当桥梁,允许 MCP 客户端(如 Cursor 或 Claude Desktop)通过标准工具与目标 GraphQL API 交互,以进行模式自省和操作执行。

  1. Features
    1. Configuration
      1. Client Configuration
        1. Cursor
        2. Claude Desktop

      Related MCP Servers

      • A
        security
        A
        license
        A
        quality
        MCP for working with GraphQL servers.
        Last updated -
        2
        536
        103
        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
        F
        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 -
        14
        1
        JavaScript
        • 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 -
        536
        1
        MIT License
        • Apple

      View all related MCP servers

      ID: bfuylp4yph