MCP.so
登录
G

Graphql To Mcp

@Docat0209

关于 Graphql To Mcp

暂无概览

基本信息

分类

其他

传输方式

stdio

发布者

Docat0209

提交者

CHENG-SHIANG HO

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "mcp-graphql-docat0209": {
      "command": "npx",
      "args": [
        "graphql-to-mcp",
        "https://countries.trevorblades.com/graphql"
      ]
    }
  }
}

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is Graphql To Mcp?

Graphql To Mcp turns any GraphQL API into MCP (Model Context Protocol) tools with zero configuration. By pointing it at a GraphQL endpoint, it automatically discovers all queries and mutations via introspection and generates one MCP tool per operation. It works with Claude Desktop, Cursor, Windsurf, and any MCP client.

How to use Graphql To Mcp?

Run it directly with npx graphql-to-mcp <graphql-endpoint-url> (no install needed) or add it to a Claude Desktop or Cursor config file under mcpServers. Optional flags include --bearer, --api-key, --include, --exclude, --prefix, --timeout, --max-retries, and --transport. It can also be used programmatically via the createServer function.

Key features of Graphql To Mcp

  • Zero configuration – just provide a GraphQL endpoint URL
  • Auto-introspection discovers all queries and mutations
  • Flat parameter schemas improve LLM accuracy
  • Smart truncation handles large responses (array slicing, depth limiting, character cap)
  • Auth support: Bearer tokens, API keys, and custom headers
  • Include/exclude filters to control which operations are exposed

Use cases of Graphql To Mcp

  • Give an LLM like Claude access to query and mutate a GraphQL API
  • Combine multiple GraphQL APIs in one MCP client using the --prefix option
  • Pair with mcp-openapi to expose both GraphQL and REST endpoints to the same LLM
  • Securely expose a subset of operations to an AI assistant using include/exclude filters

FAQ from Graphql To Mcp

How does Graphql To Mcp handle large responses?

GraphQL responses are automatically truncated: arrays are sliced to 20 items (with metadata showing total count), object depth is limited to 5 levels, and a hard cap of 50,000 characters is applied to prevent overwhelming LLM context windows.

Does Graphql To Mcp support authentication?

Yes. It supports Bearer tokens (via --bearer), API keys (via --api-key specifying name, value, and location), and arbitrary custom headers (via --header or the -H flag).

Can I expose only specific queries or mutations?

Yes. Use the --include <pattern> flag to include only operations matching a pattern, and --exclude <pattern> to hide matching operations. Patterns support wildcards (e.g., get*).

What transport protocols does Graphql To Mcp support?

It supports both stdio (default) and sse (Server-Sent Events) transport, selectable via the --transport option.

Is there any code or configuration required to get started?

No. Just run npx graphql-to-mcp https://your-api.com/graphql and the server is ready. The only dependencies are Node.js (required to run npx) and network access to the GraphQL endpoint.

评论

其他 分类下的更多 MCP 服务器