GraphQL MCP Tools logo

GraphQL MCP Tools

by saewoohan

A Model Context Protocol (MCP) server that provides GraphQL API interaction capabilities. It enables AI assistants to interact with GraphQL APIs through standardized tools.

View on GitHub

Last updated: N/A

What is GraphQL MCP Tools?

This is a Model Context Protocol (MCP) server implementation designed to facilitate interactions with GraphQL APIs. It provides a set of tools that allow AI assistants to query and introspect GraphQL endpoints.

How to use GraphQL MCP Tools?

The server can be used with tools like Claude Desktop by configuring it with the npx command. You can specify the GraphQL endpoint, headers (including authentication tokens), timeout, and maximum query complexity. Configuration options can also be passed as command-line arguments.

Key features of GraphQL MCP Tools

  • GraphQL query execution with customizable variables, endpoint, headers, and timeout.

  • GraphQL schema introspection to explore available types and fields.

  • Configuration options for default endpoint, headers, timeout, and maximum query complexity.

  • Support for allowing or disallowing mutation operations.

  • Integration with tools like Claude Desktop via NPX.

Use cases of GraphQL MCP Tools

  • Enabling AI assistants to retrieve data from GraphQL APIs.

  • Allowing AI assistants to update data in GraphQL APIs (when mutations are allowed).

  • Exploring GraphQL schema information programmatically.

  • Integrating GraphQL APIs into AI-powered workflows.

FAQ from GraphQL MCP Tools

What is the default GraphQL endpoint?

The default GraphQL endpoint is http://localhost:4000/graphql.

How do I set custom headers for requests?

You can set custom headers using the --headers command-line argument, providing a JSON string of headers.

What is the default request timeout?

The default request timeout is 30000 milliseconds.

How can I control the complexity of GraphQL queries?

You can limit the maximum allowed query complexity using the --maxComplexity command-line argument.

How do I allow mutation operations?

The graphql_query tool has an allowMutations input. Set this to true to allow mutation operations.