Skip to main content
The MCMP GraphQL API provides a flexible, efficient way to query and manage your Minecraft servers. Unlike REST APIs, GraphQL allows you to request exactly the data you need in a single request, reducing over-fetching and improving performance.

Key Features

  • Flexible Queries: Request only the data you need
  • Real-time Subscriptions: Get live updates on server status and player activity
  • Type Safety: Strongly typed schema with comprehensive documentation
  • Single Endpoint: All operations through one GraphQL endpoint
  • Powerful Introspection: Explore the schema and test queries interactively

Getting Started

Endpoint

https://graphql.mcmp.app/graphql

Authentication

All GraphQL requests require authentication using a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_TOKEN

Basic Query Example

query GetServerInfo($serverId: ID!) {
  server(id: $serverId) {
    id
    name
    status
    players {
      online
      max
    }
    version
  }
}

Real-time Subscriptions

subscription ServerStatusUpdates($serverId: ID!) {
  serverStatusChanged(serverId: $serverId) {
    id
    status
    players {
      online
      max
    }
  }
}

Schema Overview

The GraphQL schema includes:
  • Servers: Query and manage server instances
  • Players: Access player information and history
  • Configuration: Manage server settings
  • Events: Real-time notifications and updates
  • Analytics: Server performance and usage data

Interactive Playground

Explore the GraphQL API interactively using our built-in playground:
The GraphQL Playground provides an interactive environment where you can:
  • Write and test GraphQL queries, mutations, and subscriptions
  • Explore the complete schema with auto-completion
  • View real-time documentation
  • Test authentication and see live results

Benefits Over REST

Fetch multiple related resources in a single request instead of multiple REST calls.
Request only the fields you need, reducing payload size and improving performance.
Built-in subscription support for live data without polling.
Strongly typed schema prevents runtime errors and improves developer experience.

Next Steps