Automatically discovers and generates GraphQL queries for any GraphQL API through introspection, with support for pagination, filters, sorting, and table-formatted query generation
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP GraphQL Query Generatorlist all available GraphQL queries for my e-commerce API"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π MCP GraphQL Query Generator
A smart Model Context Protocol (MCP) server that automatically discovers and generates GraphQL queries for any API. Works with VS Code + GitHub Copilot, CLI, and REST API to make exploring and using GraphQL APIs effortless.
Perfect for VS Code integration with GitHub Copilot! π€
Quick Start β’ Features β’ VS Code Setup β’ API Reference β’ Examples
What is MCP?
The Model Context Protocol (MCP) is a new protocol that lets tools, APIs, and models talk to each other in a structured way. Instead of manually copying data into your IDE or chat window, MCP servers can: - Provide real-time API access directly inside VS Code or AI tools. - Enable natural language queries ("show me all products with pagination"). - Act as connectors between AI assistants (like Copilot) and external systems. This project is an MCP server for GraphQL APIs: - It introspects any GraphQL schema. - Generates queries automatically. - Exposes them through CLI, REST, and VS Code integration. In short: you donβt need to handcraft GraphQL queries anymore β just ask, and theyβre generated for you.
What is this?
This tool automatically introspects any GraphQL API and generates intelligent, production-ready queries with:
Auto-discovery of all available queries and types in your GraphQL API
Smart field selecion, including nested types
Table-formatted queries with pagination, filtering, and sorting
Natural language integration with GitHub Copilot
Zero configuration - just point it to your GraphQL endpoint
Multi-auth support (Bearer, API Key, Keycloak, etc.)
Multiple interfaces (CLI, REST API, MCP Server, Web UI)
Features
For Developers
Instant GraphQL exploration - No need to read documentation
Smart query generation - Automatically includes relevant fields
Production-ready queries - With proper pagination and error handling
Type-safe - Full TypeScript support
For AI Integration
GitHub Copilot integration - Ask questions in natural language
VS Code extension ready - Works globally across all projects
Context-aware - Understands your API structure
Intelligent suggestions - Based on your schema
For Teams
Consistent query patterns - Standardized across projects
Documentation generator - Auto-generates API insights
Multi-environment - Dev, staging, prod configurations
Docker ready - Easy deployment and scaling
Quick Start
Option 1: Global VS Code Installation (Recommended)
Transform VS Code into a GraphQL powerhouse in 2 minutes:
That's it! Now ask GitHub Copilot: "List available GraphQL queries"
Option 2: Local Development
VS Code Integration
Once installed, use natural language with GitHub Copilot:
Usage Options
1. CLI Interface
2. REST API
3. Programmatic Usage
Configuration
Environment Variables
Per-Project Configuration
Create .vscode/settings.json in your project:
Examples
Example Output - List Users Query
Example Output - Products with Categories
Architecture
Docker Deployment
API Compatibility
Works with any GraphQL API that supports introspection, including:
β Apollo Server - Full compatibility
β GraphQL Yoga - Full compatibility
β Hasura - Including metadata queries
β Postgraphile - Auto-generated CRUD
β AWS AppSync - With custom resolvers
β Shopify Admin API - E-commerce queries
β GitHub GraphQL API - Repository data
β Strapi GraphQL - Headless CMS
β Contentful - Content management
β Custom GraphQL APIs - Any introspection-enabled API
Development
Setup Development Environment
Project Scripts
Contributing
We welcome contributions! Here's how to get started:
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Make your changes with proper TypeScript types
Test your changes with a real GraphQL API
Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Contribution Guidelines
TypeScript - All code must be properly typed
Bun - Use Bun for package management and runtime
Testing - Include tests for new features
Documentation - Update README and inline docs
Code Style - Follow existing patterns
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Bun - For blazing fast JavaScript runtime
Model Context Protocol - For VS Code integration standard
GraphQL - For the amazing query language
GitHub Copilot - For AI-powered development
TypeScript - For type safety and developer experience
β Star this repo if it helped you! β