MCP Server GraphQL Endpoints
The MCP Server Handler supports GraphQL endpoints through the
x-zuplo-mcp-graphql
OpenAPI extension. This allows you to expose GraphQL APIs
as MCP tools with automatic schema introspection and query execution
capabilities.
When you configure a route with the GraphQL extension, the MCP server automatically generates two tools:
- Introspection tool - Fetches the GraphQL schema so AI systems can understand available queries, mutations, and types
- Execute tool - Executes GraphQL queries against the endpoint
This enables AI systems to dynamically discover and interact with GraphQL APIs without requiring manual tool definitions for each query.
GraphQL endpoint support for MCP Server is currently in beta. The API may change in future releases.
Quick Start
1. Configure a GraphQL Endpoint
Add a route that forwards to your GraphQL endpoint and include the
x-zuplo-mcp-graphql
extension:
Code
2. Add to Your MCP Server
Include the GraphQL route in your MCP Server configuration:
Code
This configuration automatically creates:
graphql_introspect
- Tool to fetch the GraphQL schemagraphql_execute
- Tool to execute GraphQL queries
Configuration Options
The x-zuplo-mcp-graphql
extension supports the following options:
enabled
- defaulttrue
: whether the GraphQL MCP capabilities are enabled.introspectionToolName
- the custom name of the introspection tool.introspectionToolDescription
- the custom description of the introspection tool.executeToolName
- the custom name of the query execute tool.executeToolDescription
- the custom description of the query execute tool.
For example:
Code
Custom GraphQL Tools
For more complex scenarios like bounded mutations or queries with complex logic,
you can create custom GraphQL tools as endpoints using the Zuplo
custom MCP tool patterns and the graphql
library.
Here's a simple example of a custom bounded GraphQL query that expects an id
input from the MCP client:
Code
In your handler (modules/get-ship.ts
):
Code
For more complex custom tools with validation, error handling, and multi-step workflows, see the Custom Tools documentation.
See Also
- MCP Server Handler - Main MCP Server documentation
- Custom Tools - Build custom MCP tools with complex logic
- GraphQL Best Practices - GraphQL.org recommendations