1. Examples
  2. GraphQL MCP Server

GraphQL MCP Server

Make your GraphQL API available to AI assistants like Claude and ChatGPT.

Deploy to Zuplo
Deploy to Zuplo

Prerequisite: You need a Zuplo account to run this example. Sign up for free

This is a Model Context Protocol (MCP) server built with Zuplo that demonstrates how to expose GraphQL APIs as MCP tools with built-in introspection capabilities.

About this example

This project implements an MCP Server for GraphQL APIs using the Rick & Morty GraphQL API as an example. It showcases:

MCP Tools

  • graphql_introspect - Introspect the GraphQL schema to understand available types, queries, and mutations
  • graphql_execute - Execute GraphQL queries and mutations against the API

Key Features

  • Automatic GraphQL schema introspection
  • Execute any GraphQL query or mutation through MCP
  • API key authentication for security
  • Easy to adapt to any GraphQL API

Key Components

  • OpenAPI-based Routes (config/routes.oas.json) - API routes with MCP GraphQL annotations
  • GraphQL Proxy - Proxies requests to the Rick & Morty GraphQL API
  • MCP GraphQL Integration - Built-in support for GraphQL introspection and execution

Prerequisites

  • A Zuplo account. You can sign up for free.

Getting Started

Locally

Working locally is the best way to explore and understand the code for this example. You can get a local version by using the Zuplo CLI:

Terminalbash
npx create-zuplo-api@latest --example mcp-server-graphql

Once you have the code on your local machine, start the development server:

Terminalbash
npm run dev

The API will be available at http://localhost:9000.

You can access:

  • API Gateway - http://localhost:9000
  • Local API Route Designer - http://localhost:9100
  • MCP Endpoint - http://localhost:9000/mcp (POST)
  • GraphQL Endpoint - http://localhost:9000/graphql (POST)

The dev server will automatically reload when you modify:

  • Route definitions in config/routes.oas.json
  • Policy configurations in config/policies.json

Deploying with Zuplo CLI

Install the Zuplo CLI

Terminalbash
npm install -g zuplo

Login to Zuplo

Terminalbash
zuplo login

Deploy to Zuplo

Deploy to a working copy environment:

Terminalbash
zuplo deploy

Using the MCP Server

Once deployed, you can connect to your MCP server using any MCP testing tool:

Model Context Protocol Inspector

Terminalbash
npx @modelcontextprotocol/inspector

MCPJam

Terminalbash
npx @mcpjam/inspector@latest

You can then test the MCP server locally, or point your inspector at a deployed version.

Local MCP Server

text
http://localhost:9000/mcp

Deployed

text
https://your-project.zuplo.app/mcp

The server will expose:

  • GraphQL introspection tool to explore the API schema
  • GraphQL execution tool to run queries and mutations

Example Usage

Add the MCP server to your tool of choice and ask "Which characters were in season 4, episode 6 of Rick & Morty, and what was the name of the episode?"

Learn More

  • Zuplo MCP Documentation
  • Zuplo GraphQL MCP Guide
  • Blog Post & Video Demo
  • Rick & Morty GraphQL API

Quick Links

View on GitHubDocumentation

Run Locally

Clone and run this example:

npx create-zuplo-api --example mcp-server-graphql

On This Page

Related Examples

Explore more examples in this category

OpenAI App

Model Context Protocol (MCP)

Build a ChatGPT App that connects to your API using MCP.

View Example

MCP Custom Tools

Model Context Protocol (MCP)

Create AI tools that combine multiple API calls into a single action.

View Example

MCP Server Prompts

Model Context Protocol (MCP)

Improve AI assistant interactions by adding guided prompts to your MCP Server.

View Example
Starter

Remote MCP Server with OAuth

Model Context Protocol (MCP)

Secure your MCP Server with OAuth authentication using Auth0.

View Example
Check all of our Examples

Scale your APIs with
confidence.

Start for free or book a demo with our team.
Book a demoStart for Free
SOC 2 TYPE 2High Performer Spring 2025Momentum Leader Spring 2025Best Estimated ROI Spring 2025Easiest To Use Spring 2025Fastest Implementation Spring 2025

Get Updates From Zuplo

Zuplo logo
© 2026 zuplo. All rights reserved.
Products & Features
API ManagementAI GatewayMCP ServersMCP GatewayDeveloper PortalRate LimitingOpenAPI NativeGitOpsProgrammableAPI Key ManagementMulti-cloudAPI GovernanceMonetizationSelf-Serve DevX
Developers
DocumentationBlogLearning CenterCommunityChangelogIntegrations
Product
PricingSupportSign InCustomer Stories
Company
About UsMedia KitCareersStatusTrust & Compliance
Privacy PolicySecurity PoliciesTerms of ServiceTrust & Compliance
Docs
Pricing
Sign Up
Login
ContactBook a demoFAQ
Zuplo logo
DocsPricingSign Up
Login