Back to Developer Portal

Model Context Protocol (MCP) & AI Integration

Connect AI coding agents (Claude, Cursor, ChatGPT, and custom LLM tools) directly to your local PocketMC daemon via loopback REST API endpoints.

1. Direct Local REST Endpoint Bridge

PocketMC operates a local Kestrel web server on port 25580. AI tools and MCP wrappers issue HTTP requests to local endpoints:

{
  "mcpServers": {
    "pocketmc": {
      "command": "node",
      "args": ["mcp-bridge.js"],
      "env": {
        "POCKETMC_API_URL": "http://localhost:25580"
      }
    }
  }
}

2. Machine-Readable Contracts

AI agents consume standard OpenAPI and metadata manifests to infer available server tools:

Daemon URL: http://localhost:25580
OpenAPI Spec: https://pocketmc.github.io/docs/openapi.json
MCP Manifest: https://pocketmc.github.io/.well-known/mcp.json

3. Supported AI Agent Tool Actions

list_instances (GET /api/instances) Returns all configured server instances with engine types and status.
start_instance (POST /api/instances/{id}/start) Launches server process with isolated Adoptium Java runtime.
stop_instance (POST /api/instances/{id}/stop) Initiates world save and graceful process termination.
send_command (POST /api/instances/{id}/console/command) Executes in-game RCON or console commands programmatically.
create_backup (POST /api/instances/{id}/backups) Creates local ZIP world snapshots with SHA-256 integrity verification.