Skip to main content
Glama

Minecraft Ops MCP

minecraft-ops-mcp is an MCP service for Minecraft server management and operations, supporting stdio, legacy HTTP+SSE, and current Streamable HTTP. It uses MCSManager as the primary control plane and provides:

  • Instance lifecycle management, logs, files, uploads, and downloads via MCSManager;

  • Legacy or command-based operational tasks via per-instance RCON parsing;

  • Minecraft Java 1.21.9+ management via per-instance MSMP parsing;

  • Jar metadata, modlist snapshots, apply/rollback, and test logging for modpack development.

Current Backend Model

MCP clients only configure MCSManager. RCON and MSMP are instance-level configurations:

  • RCON is read from the target instance's MCSManager configuration: enableRcon, rconIp, rconPort, rconPassword.

  • MSMP is read from the target instance's server.properties: management-server-*.

Tool calls select the target instance via daemonId and uuid. A single MCP process can manage multiple servers because RCON/MSMP connections are dynamically resolved at each call, rather than reading fixed endpoints from client environment variables.

Related MCP server: mcp-cloudron

Installation and Execution

cd /home/damoc/codes/minecraft-ops-mcp
python3 -m pip install -e .
minecraft-ops-mcp

Default uses stdio transport. For development and debugging:

cd /home/damoc/codes/minecraft-ops-mcp
PYTHONPATH=src python3 -m minecraft_ops_mcp

HTTP remote access:

# 旧版 HTTP+SSE transport,兼容 MCP 2024-11-05 客户端
MINECRAFT_OPS_MCP_BEARER_TOKEN=replace-with-long-random-token \
PYTHONPATH=src python3 -m minecraft_ops_mcp \
  --transport sse \
  --host 0.0.0.0 \
  --port 8000 \
  --allowed-host mcsm-host.example:8000

# 当前 MCP 标准推荐的 Streamable HTTP transport,适合支持 --url 的客户端
MINECRAFT_OPS_MCP_BEARER_TOKEN=replace-with-long-random-token \
PYTHONPATH=src python3 -m minecraft_ops_mcp \
  --transport streamable-http \
  --host 0.0.0.0 \
  --port 8000 \
  --allowed-host mcsm-host.example:8000

Endpoint defaults:

  • SSE: GET /sse, client then POSTs to /messages/?session_id=....

  • Streamable HTTP: /mcp.

  • Health check: /health.

Register remote Streamable HTTP MCP in local Codex:

codex mcp add minecraft-ops --url http://mcsm-host.example:8000/mcp

If the HTTP MCP has a bearer token set, the local Codex also needs to be able to read the environment variable of the same name:

export MINECRAFT_OPS_MCP_BEARER_TOKEN=replace-with-long-random-token
codex mcp add minecraft-ops --url http://mcsm-host.example:8000/mcp --bearer-token-env-var MINECRAFT_OPS_MCP_BEARER_TOKEN

codex mcp add --url only registers the client configuration and does not start the remote service. HTTP mode requires keeping the service running on the host where the MCP resides using systemd, tmux, a container, or a process manager.

HTTP transport enables Host/Origin validation by default. Binding to non-local addresses also requires MINECRAFT_OPS_MCP_BEARER_TOKEN by default, unless MINECRAFT_OPS_MCP_ALLOW_UNAUTHENTICATED_HTTP=true is explicitly set. When deploying with a reverse proxy or public domain, --allowed-host or MINECRAFT_OPS_MCP_ALLOWED_HOSTS must be set; browser clients also require --allowed-origin or MINECRAFT_OPS_MCP_ALLOWED_ORIGINS.

Quick Codex Configuration

The repository provides a quick configuration script that installs the minecraft-ops-runbook skill and registers the MCP server via codex mcp add:

cd /home/damoc/codes/minecraft-ops-mcp
MCSM_BASE_URL=http://your-mcsm-host:23333 \
MCSM_API_KEY=replace-me \
MCSM_DEFAULT_DAEMON_ID=replace-me \
MCSM_DEFAULT_INSTANCE_UUID=replace-me \
scripts/quick_setup.py --write --replace

By default, the script writes sensitive configurations to $CODEX_HOME/minecraft-ops-mcp.env with 0600 permissions and generates $CODEX_HOME/bin/minecraft-ops-mcp-launch as the MCP launcher. The Codex config only saves the launcher path and does not directly save the API key.

Preview without writing:

scripts/quick_setup.py

Generate generic MCP JSON snippet:

scripts/quick_setup.py --print-json

Generate Streamable HTTP client snippet:

scripts/quick_setup.py --mcp-transport streamable-http --print-json

MCP Client Configuration

Minimal example:

{
  "mcpServers": {
    "minecraft-ops": {
      "command": "python3",
      "args": ["-m", "minecraft_ops_mcp"],
      "cwd": "/home/damoc/codes/minecraft-ops-mcp",
      "env": {
        "PYTHONPATH": "src",
        "MCSM_BASE_URL": "http://127.0.0.1:23333",
        "MCSM_API_KEY": "replace-me",
        "MCSM_DEFAULT_DAEMON_ID": "replace-me",
        "MCSM_DEFAULT_INSTANCE_UUID": "replace-me",
        "MINECRAFT_OPS_AUDIT_LOG": "/tmp/minecraft-ops-mcp-audit.jsonl"
      }
    }
  }
}

Production recommended configuration for security boundaries:

MINECRAFT_OPS_RAW_COMMAND_ALLOWLIST=list,time,help
MINECRAFT_OPS_RAW_COMMAND_DENYLIST=stop,op,deop,ban,ban-ip
MINECRAFT_OPS_MAX_BYTES=268435456
MINECRAFT_OPS_UPLOAD_ALLOWED_DIRS=/tmp/minecraft-ops-mcp-downloads,/srv/minecraft-staging
MINECRAFT_OPS_FILE_OPERATION_WHITELIST=server.properties,config,mods,logs,crash-reports
MINECRAFT_OPS_UPLOAD_URL_ALLOWED_DOMAINS=example.com,cdn.example.com
MINECRAFT_OPS_MODPACK_WORKSPACE=/srv/minecraft-ops/modpack-workspace

Optional protocol defaults:

MINECRAFT_OPS_RCON_TIMEOUT_SECONDS=5
MINECRAFT_OPS_RCON_ENCODING=utf-8
MINECRAFT_OPS_MSMP_TIMEOUT_SECONDS=8
MINECRAFT_OPS_MSMP_TLS_VERIFY=true

Optional MCP transport variables:

MINECRAFT_OPS_MCP_TRANSPORT=stdio
MINECRAFT_OPS_MCP_HOST=127.0.0.1
MINECRAFT_OPS_MCP_PORT=8000
MINECRAFT_OPS_MCP_ALLOWED_HOSTS=mcsm-host.example:8000
MINECRAFT_OPS_MCP_ALLOWED_ORIGINS=https://agent.example
MINECRAFT_OPS_MCP_BEARER_TOKEN=replace-with-long-random-token

See .env.example for full variables.

Tool Grouping

  • server.*: Instance status, lifecycle, logs, save, broadcast, console commands.

  • instance.*: Create, update, patch, clone, delete, reinstall, update tasks.

  • file.*: List directory, read/write, create, upload, download, copy, move, compress.

  • rcon.*: RCON configuration read/write, security wrapping, and raw RCON commands.

  • msmp.*: MSMP configuration read/write, status, players, bans, whitelist, OP, gamerule, server settings, raw JSON-RPC.

  • modpack.*: Jar check, modlist snapshot, diff, apply/rollback, startup classification, test records.

High-risk tools require dry_run=true or confirm=true. Raw commands are also subject to allowlist/denylist policies.

Common Workflows

Health check:

  1. server.get_instance

  2. server.get_logs

  3. msmp.config.get, call msmp.server.status / msmp.players.list after enabling

  4. rcon.config.get, call rcon.list_players / rcon.time_query when needed

Enable or modify RCON:

  1. rcon.config.get

  2. rcon.config.set {"dry_run": true, ...}

  3. rcon.config.set {"confirm": true, ...}

  4. Restart instance if new configuration needs to be loaded

  5. Verify with rcon.list_players

Enable or modify MSMP:

  1. msmp.config.get

  2. msmp.config.set {"dry_run": true, ...}

  3. msmp.config.set {"confirm": true, ...}

  4. Restart instance if new configuration needs to be loaded

  5. Verify with msmp.discover or msmp.server.status

Modpack compatibility testing:

  1. modpack.snapshot_modlist

  2. Agent retrieves candidate version information externally

  3. modpack.apply_modlist {"dry_run": true}

  4. modpack.apply_modlist {"confirm": true}

  5. Start test server and read logs

  6. modpack.classify_startup_result

  7. modpack.record_test_run

  8. modpack.rollback_snapshot if necessary

Testing

Local check:

PYTHONPATH=src python3 -B -m unittest discover -s tests
python3 -m compileall -q src scripts

Real backend probes require disposable MCSManager/Minecraft test environments:

python3 -B scripts/mcp_integration_probe.py > /tmp/minecraft-ops-mcp-probe-report.json
python3 -B scripts/msmp_temp_instance_probe.py > /tmp/minecraft-ops-mcp-msmp-probe-report.json
python3 -B scripts/multi_server_backend_probe.py > /tmp/minecraft-ops-mcp-multi-probe-report.json

Multi-server probes create two temporary instances to verify that the same MCP process can dynamically connect to different RCON/MSMP endpoints based on daemonId and uuid.

Documentation

Recommended for use with the minecraft-ops-runbook skill.

Available Tools

71 tools
file.compressFile CompressA

Create a zip archive in an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: source (required), targets (required), daemonId, uuid, +2 more. Returns: object

file.copyFile CopyA

Copy files in an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: targets (required), daemonId, uuid, confirm, +1 more. Returns: object

file.deleteFile DeleteA
Destructive

Delete files or folders from an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: targets (required), daemonId, uuid, confirm, +1 more. Returns: object

file.download_localFile Download LocalA

Download one MCSManager instance file to the MCP server local filesystem. Requires confirm=true or dry_run=true.

Inputs: file_name (required), daemonId, uuid, local_path, +4 more. Returns: object

file.download_prepareFile Download PrepareA

Create a temporary MCSManager daemon download token for one instance file.

Inputs: file_name (required), daemonId, uuid. Returns: object

file.listFile ListB
Read-onlyIdempotent

List files in an MCSManager instance directory.

Inputs: daemonId, uuid, target, page, +1 more. Returns: object

file.mkdirFile MkdirB

Create a folder in an MCSManager instance.

Inputs: target (required), daemonId, uuid. Returns: object

file.moveFile MoveA

Move or rename files in an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: targets (required), daemonId, uuid, confirm, +1 more. Returns: object

file.readFile ReadB
Read-onlyIdempotent

Read a text file from an MCSManager instance.

Inputs: target (required), daemonId, uuid. Returns: object

file.touchFile TouchB

Create an empty file in an MCSManager instance.

Inputs: target (required), daemonId, uuid. Returns: object

file.uncompressFile UncompressA
Destructive

Extract a zip archive in an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: source (required), target (required), daemonId, uuid, +3 more. Returns: object

file.upload_localFile Upload LocalA

Upload a local file into an MCSManager instance directory. Requires confirm=true or dry_run=true.

Inputs: upload_dir (required), local_path (required), daemonId, uuid, +4 more. Returns: object

file.upload_prepareFile Upload PrepareB

Create a temporary MCSManager daemon upload token for one instance directory.

Inputs: upload_dir (required), daemonId, uuid. Returns: object

file.upload_urlFile Upload UrlA

Download a remote URL on the MCP server and upload it into an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: url (required), upload_dir (required), daemonId, uuid, +5 more. Returns: object

file.writeFile WriteA

Write a text file in an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: target (required), text (required), daemonId, uuid, +2 more. Returns: object

file.write_newFile Write NewA

Create a text file with touch -> write, optionally refusing to overwrite existing files. Requires confirm=true or dry_run=true.

Inputs: target (required), text (required), daemonId, uuid, +3 more. Returns: object

instance.clone_from_templateInstance Clone From TemplateA

Create a new MCSManager instance from an existing instance config. Requires confirm=true or dry_run=true.

Inputs: source_uuid (required), source_daemonId, daemonId, nickname, +4 more. Returns: object

instance.createInstance CreateA

Create an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: config (required), daemonId, confirm, dry_run. Returns: object

instance.deleteInstance DeleteA
Destructive

Delete MCSManager instances. Requires confirm=true or dry_run=true.

Inputs: uuids (required), daemonId, deleteFile, confirm, +1 more. Returns: object

instance.reinstallInstance ReinstallA
Destructive

Reinstall an MCSManager instance from a package URL. Requires confirm=true or dry_run=true.

Inputs: targetUrl (required), title (required), daemonId, uuid, +3 more. Returns: object

instance.run_update_taskInstance Run Update TaskA

Run the configured MCSManager update task. Requires confirm=true or dry_run=true.

Inputs: daemonId, uuid, confirm, dry_run. Returns: object

instance.update_configInstance Update ConfigA

Update an MCSManager instance config. Requires confirm=true or dry_run=true.

Inputs: config (required), daemonId, uuid, confirm, +1 more. Returns: object

instance.update_config_patchInstance Update Config PatchA

Read the current MCSManager instance config, deep-merge a patch, and update it. Requires confirm=true or dry_run=true.

Inputs: patch (required), daemonId, uuid, confirm, +1 more. Returns: object

msmp.allowlist.addMSMP Allowlist AddA

Add players to the allowlist through MSMP. Requires confirm=true or dry_run=true.

Inputs: players (required), confirm, dry_run. Returns: object

msmp.allowlist.clearMSMP Allowlist ClearA
Destructive

Clear the allowlist through MSMP. Requires confirm=true or dry_run=true.

Inputs: confirm, dry_run. Returns: object

msmp.allowlist.getMSMP Allowlist GetC
Read-onlyIdempotent

Get the allowlist through MSMP.

Inputs: no named parameters. Returns: object

msmp.allowlist.removeMSMP Allowlist RemoveA

Remove players from the allowlist through MSMP. Requires confirm=true or dry_run=true.

Inputs: players (required), confirm, dry_run. Returns: object

msmp.allowlist.setMSMP Allowlist SetA

Replace the allowlist through MSMP. Requires confirm=true or dry_run=true.

Inputs: players (required), confirm, dry_run. Returns: object

msmp.bans.addMSMP Bans AddA

Add player bans through MSMP. Requires confirm=true or dry_run=true.

Inputs: players (required), reason, source, expires, +2 more. Returns: object

msmp.bans.clearMSMP Bans ClearA
Destructive

Clear the player ban list through MSMP. Requires confirm=true or dry_run=true.

Inputs: confirm, dry_run. Returns: object

msmp.bans.getMSMP Bans GetA
Read-onlyIdempotent

Get the player ban list through MSMP.

Inputs: no named parameters. Returns: object

msmp.bans.removeMSMP Bans RemoveA

Remove player bans through MSMP. Requires confirm=true or dry_run=true.

Inputs: players (required), confirm, dry_run. Returns: object

msmp.bans.setMSMP Bans SetA

Replace the player ban list through MSMP. Requires confirm=true or dry_run=true.

Inputs: players (required), reason, source, expires, +2 more. Returns: object

msmp.callMSMP CallA

Call an arbitrary MSMP JSON-RPC method. Set read_only=true for safe reads; otherwise confirm=true is required.

Inputs: method (required), params, read_only, confirm, +1 more. Returns: object

msmp.discoverMSMP DiscoverC
Read-onlyIdempotent

Call rpc.discover on the Minecraft Server Management Protocol endpoint.

Inputs: no named parameters. Returns: object

msmp.gamerules.getMSMP Gamerules GetB
Read-onlyIdempotent

Get game rules through MSMP.

Inputs: no named parameters. Returns: object

msmp.gamerules.updateMSMP Gamerules UpdateA

Update a game rule through MSMP. Requires confirm=true or dry_run=true.

Inputs: rule (required), value (required), confirm, dry_run. Returns: object

msmp.ip_bans.addMSMP Ip Bans AddA

Add IP bans through MSMP. Requires confirm=true or dry_run=true.

Inputs: ips (required), reason, source, expires, +2 more. Returns: object

msmp.ip_bans.clearMSMP Ip Bans ClearA
Destructive

Clear the IP ban list through MSMP. Requires confirm=true or dry_run=true.

Inputs: confirm, dry_run. Returns: object

msmp.ip_bans.getMSMP Ip Bans GetA
Read-onlyIdempotent

Get the IP ban list through MSMP.

Inputs: no named parameters. Returns: object

msmp.ip_bans.removeMSMP Ip Bans RemoveA

Remove IP bans through MSMP. Requires confirm=true or dry_run=true.

Inputs: ips (required), confirm, dry_run. Returns: object

msmp.ip_bans.setMSMP Ip Bans SetA

Replace the IP ban list through MSMP. Requires confirm=true or dry_run=true.

Inputs: ips (required), reason, source, expires, +2 more. Returns: object

msmp.operators.addMSMP Operators AddA

Add operators through MSMP. Requires confirm=true or dry_run=true.

Inputs: players (required), permission_level, bypasses_player_limit, confirm, +1 more. Returns: object

msmp.operators.clearMSMP Operators ClearA
Destructive

Clear operators through MSMP. Requires confirm=true or dry_run=true.

Inputs: confirm, dry_run. Returns: object

msmp.operators.getMSMP Operators GetC
Read-onlyIdempotent

Get operators through MSMP.

Inputs: no named parameters. Returns: object

msmp.operators.removeMSMP Operators RemoveA

Remove operators through MSMP. Requires confirm=true or dry_run=true.

Inputs: players (required), confirm, dry_run. Returns: object

msmp.operators.setMSMP Operators SetA

Replace the operator list through MSMP. Requires confirm=true or dry_run=true.

Inputs: players (required), permission_level, bypasses_player_limit, confirm, +1 more. Returns: object

msmp.players.kickMSMP Players KickA

Kick one or more players through MSMP. Requires confirm=true or dry_run=true.

Inputs: players (required), message, confirm, dry_run. Returns: object

msmp.players.listMSMP Players ListA
Read-onlyIdempotent

List connected players through MSMP.

Inputs: no named parameters. Returns: object

msmp.server.saveMSMP Server SaveA

Save server state through MSMP. Requires confirm=true or dry_run=true.

Inputs: flush, confirm, dry_run. Returns: object

msmp.server_settings.getMSMP Server Settings GetA
Read-onlyIdempotent

Get one server setting through MSMP, for example difficulty or motd.

Inputs: setting (required). Returns: object

msmp.server_settings.listMSMP Server Settings ListA
Read-onlyIdempotent

Discover readable and writable MSMP server settings from rpc.discover.

Inputs: no named parameters. Returns: object

msmp.server_settings.setMSMP Server Settings SetA

Set one server setting through MSMP. Requires confirm=true or dry_run=true.

Inputs: setting (required), value (required), confirm, dry_run. Returns: object

msmp.server.statusMSMP Server StatusC
Read-onlyIdempotent

Get server status through MSMP.

Inputs: no named parameters. Returns: object

msmp.server.stopMSMP Server StopA
Destructive

Stop server through MSMP. Requires confirm=true or dry_run=true.

Inputs: confirm, dry_run. Returns: object

rcon.commandRCON CommandA

Send a raw RCON command. Requires confirm=true or dry_run=true.

Inputs: command (required), confirm, dry_run. Returns: object

rcon.list_playersRCON List PlayersA
Read-onlyIdempotent

List online players through RCON using the fixed list command.

Inputs: no named parameters. Returns: object

rcon.save_allRCON Save AllB

Save the world through RCON using save-all or save-all flush.

Inputs: flush. Returns: object

rcon.time_queryRCON Time QueryB
Read-onlyIdempotent

Query server time through RCON using time query daytime/gametime/day.

Inputs: query. Returns: object

server.broadcastServer BroadcastA

Broadcast a system chat message using MSMP, RCON, or MCSManager.

Inputs: message (required), backend, targets, overlay, +2 more. Returns: object

server.get_daemon_systemServer Get Daemon SystemA
Read-onlyIdempotent

Get MCSManager daemon system status summary.

Inputs: no named parameters. Returns: object

server.get_instanceServer Get InstanceB
Read-onlyIdempotent

Get MCSManager instance details.

Inputs: daemonId, uuid. Returns: object

server.get_logsServer Get LogsB
Read-onlyIdempotent

Read MCSManager instance output logs.

Inputs: daemonId, uuid, size. Returns: object

server.killServer KillA
Destructive

Force-kill an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: daemonId, uuid, confirm, dry_run. Returns: object

server.list_daemonsServer List DaemonsA
Read-onlyIdempotent

List MCSManager daemon nodes.

Inputs: no named parameters. Returns: object

server.list_instancesServer List InstancesB
Read-onlyIdempotent

List instances on an MCSManager daemon.

Inputs: daemonId, page, page_size, instance_name, +1 more. Returns: object

server.restartServer RestartA

Restart an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: daemonId, uuid, confirm, dry_run. Returns: object

server.save_worldServer Save WorldB

Save the Minecraft world using MSMP, RCON, or MCSManager.

Inputs: backend, daemonId, uuid, flush. Returns: object

server.send_commandServer Send CommandA

Send a raw console command through MCSManager. Requires confirm=true or dry_run=true.

Inputs: command (required), daemonId, uuid, confirm, +1 more. Returns: object

server.startServer StartA

Start an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: daemonId, uuid, confirm, dry_run. Returns: object

server.stopServer StopA
Destructive

Stop an MCSManager instance. Requires confirm=true or dry_run=true.

Inputs: daemonId, uuid, confirm, dry_run. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 71 tools

    Disambiguation4/5

    The tools are well-organized into clear categories (file, instance, msmp, rcon, server) with distinct purposes within each category. However, there is some potential for confusion between similar operations like server.save_world and rcon.save_all, or between different save methods. Overall, the hierarchical naming helps agents distinguish between tools effectively.

    Naming Consistency5/5

    The tool names follow an extremely consistent pattern of category.verb_noun throughout (e.g., file.list, msmp.allowlist.get, server.start). All tools use snake_case with clear hierarchical organization, making the naming scheme predictable and easy to understand.

    Tool Count2/5

    With 71 tools, this server has far too many tools for effective agent use. While the domain (Minecraft server management) is complex, the tool count creates overwhelming complexity and redundancy (e.g., multiple ways to save worlds, multiple player listing methods). A more streamlined set would be more appropriate.

    Completeness5/5

    The tool surface provides comprehensive coverage of Minecraft server management operations. It includes complete CRUD for files, instances, player management (allowlist, bans, operators), server control (start/stop/restart), configuration management, and multiple communication protocols (MSMP, RCON, MCSManager). No obvious gaps exist for the stated purpose.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      An MCP server that enables programmatic management and monitoring of development servers through a unified interface and interactive TUI. It provides tools for process control, log streaming, and experimental browser automation via Playwright.
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server for managing Cloudron instances that enables monitoring and controlling self-hosted applications, backups, and infrastructure. It provides tools for listing installed apps, retrieving system status, and performing administrative tasks through the Model Context Protocol.
      19
      12 npm
      1
      MIT
    • A
      license
      A
      quality
      Not graded
      maintenance
      MCP server for Pterodactyl and Pelican game server panels. 73 tools for server management, power control, file operations, backups, schedules, databases, users, nodes, and eggs.
      34
      14 npm
      -