Labsco
ctkadvisors logo

GraphQL MCP Server

โ˜… 12

from ctkadvisors

A strongly-typed MCP server that provides seamless access to any GraphQL API.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

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

Repository Structure

graphql-mcp/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ graphql-mcp-server.ts     # Main server implementation (TypeScript)
โ”œโ”€โ”€ dist/                         # Compiled JavaScript (generated)
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ GETTING_STARTED.md         # Setup and usage guide
โ”‚   โ”œโ”€โ”€ PROJECT_STATUS.md          # Current project status
โ”‚   โ””โ”€โ”€ TECHNICAL.md               # Technical documentation
โ”œโ”€โ”€ .env.development               # Environment variables
โ”œโ”€โ”€ .env.sample                    # Sample environment template
โ”œโ”€โ”€ claude_desktop_sample_config.json  # Sample Claude Desktop config
โ”œโ”€โ”€ package.json                   # Project dependencies
โ”œโ”€โ”€ tsconfig.json                  # TypeScript configuration
โ”œโ”€โ”€ run-graphql-mcp.sh             # Script to run the server
โ””โ”€โ”€ README.md                      # This file

Documentation

For more detailed information, see:

Development

To make changes to the server:

  1. Modify the TypeScript source in src/graphql-mcp-server.ts
  2. Compile the TypeScript code: npm run build
  3. Run the compiled server: node dist/graphql-mcp-server.js

Publishing to npm

To publish this package to npm:

# Make sure you're logged in to npm
npm login

# Build the project
npm run build

# Publish to npm
npm publish

The package will include the pre-built JavaScript files in the dist directory, making it ready to use without additional build steps.