graphql-mcp

graphql-mcp

8

The GraphQL MCP Server is a TypeScript-based server that facilitates seamless integration with any GraphQL API through Claude AI. It features dynamic GraphQL integration, schema introspection, full mutation support, and strong type safety while being compliant with the Model Context Protocol standard.

GraphQL MCP Server

A strongly-typed TypeScript Model Context Protocol (MCP) server that provides seamless access to any GraphQL API through Claude AI.

Features

  • Strongly Typed: Built with TypeScript for improved code quality and type safety
  • Dynamic GraphQL Integration: Connect to any GraphQL API with automatic tool generation
  • Schema Introspection: Automatically discovers and exposes all GraphQL operations as tools
  • Full Mutation Support: First-class support for GraphQL mutations with proper handling
  • Query & Mutation Whitelisting: Optional whitelisting to control which GraphQL operations are exposed
  • Rich Type Support: Properly handles complex GraphQL types, input objects, and variables
  • MCP Standard Compliant: Follows the Model Context Protocol format for seamless Claude integration
  • Smart Query Generation: Builds efficient GraphQL queries with proper field selection
  • Authentication Support: Simple API key authentication

Prerequisites

  • Node.js 18 or later
  • TypeScript 5.x or later
  • Claude Desktop with MCP support
  • A GraphQL API endpoint

Installation

Option 1: From npm

  1. Install globally via npm.
  2. Run the server.

Option 2: Clone Repository

  1. Clone the repository.
  2. Install dependencies.
  3. Run the server.

Quick Start

  1. Setup Environment Variables
  2. Build and Run
  3. Claude Desktop Integration

Operation Whitelisting

  • Enable/Disable Mutations
  • Specify Whitelisted Queries and Mutations

Documentation

Development

  1. Modify the TypeScript source.
  2. Compile the TypeScript code.
  3. Run the compiled server.

License

This project is licensed under the Business Source License 1.1 (BSL 1.1).