Skip to main content
Glama
mc-ai-mcp

mc-ai-mcp

by nawin54

mc-ai-mcp

MCP-first world-building bridge for Minecraft — AI agents (Claude, Codex, Qoder, any MCP host) build large structures through guarded MCP tools on Paper/Purpur, Fabric, NeoForge, and Bedrock (BDS).

License: Apache-2.0 Release

Phase 1 MVP (v0.1.0) ships the full control plane + Paper data plane, validated end-to-end on a real Paper 1.21.1 server: a house was built through MCP tools, TPS held ~20.0 under load, and a kill -9 mid-build resumed from the server watermark.


Architecture

AI / Agent Host (LLM, API key, model, effort)      <- keys never leave this layer
        │ MCP protocol (Streamable HTTP, bearer)
        ▼
MCP Server (Node 22 + SQLite)                      <- control plane: 14 tools,
        │ WebSocket (adapters dial out)               sessions, op queue, guardrails
        ▼
World Adapter (data plane)                         <- writes blocks, dual budget,
  Paper/Purpur │ Fabric* │ NeoForge* │ Bedrock*      snapshot/undo, watermark resume
  • MCP Server never calls an LLM. base_url / api_key / model / effort live on the agent host; the game only ever sees throwaway per-server tokens.

  • Two-layer guardrails: every tool call is validated server-side (schema, session, extent, quotas, rate) and re-validated adapter-side (bounds, budget, physics-off writes).

  • Bulk rule: agents build with fill_box / clone_region / paste_template. set_block is a quota-capped fine-edit tool.

Related MCP server: Minecraft MCP Server Pro

MCP tools (14)

Group

Tools

Session & QA

session_start, session_end, get_status, get_heightmap

Building

fill_box, clone_region, paste_template, save_template, list_templates, clear_foundation, set_block (quota)

Safety & vision

queue_control, undo_last, capture_view (ir / heightmap, topdown_png = Java Phase 4)

Quickstart (Paper)

  1. Run the broker (any Node 22 host):

    npm ci
    (cd mcp-server && npx tsc -p tsconfig.json)
    MCP_PORT=8876 MCP_AUTH_TOKENS=<agent-token> \
    ADAPTER_TOKENS='{"paper-1":"<adapter-token>"}' \
    node mcp-server/dist/server.js

    or docker compose up (see docker-compose.yml, .env.example).

  2. Install the plugin — download mc-ai-mcp-paper-0.1.0.jar from the v0.1.0 release into plugins/, start Paper 1.21.x with:

    MC_AI_CONNECTOR_URL=ws://127.0.0.1:8876/adapter \
    MC_AI_ADAPTER_TOKEN=<adapter-token> MC_AI_ADAPTER_ID=paper-1 \
    java -Xmx2G -jar paper.jar nogui

    Expect [mc-ai-mcp] mc-ai-mcp adapter connected as paper-1.

  3. Connect your agent host to http://<broker>:8876/mcp with Authorization: Bearer <agent-token> (Streamable HTTP MCP). Then call session_start → fill_box → get_heightmap → session_end.

Config precedence: env > config file (plugins/mc-ai-mcp/config.properties); the adapter token is env-only and is never read from files. In-game /aibuild panel is admin-only (mc-ai-mcp.admin).

Build & test

npm test                              # 42 JS tests (schemas, sessions, queue, guardrails, hub, e2e)
bash ./gradlew build --no-daemon      # java core + paper adapter (+ shadow fat jar)
bash ./gradlew :java:platform-paper:shadowJar   # plugins/mc-ai-mcp jar

Phase 1 exit-gate evidence (real runtime)

Gate

Result

House via MCP

shed template = 374 real blocks (200 stone bricks, 105 planks, 4 torches)

TPS soak (10 min, 3 builds)

60 samples, TPS ≈ 20.0, MSPT ≈ 0.13

kill -9 resume

reconnect in 24 s → queue drained → 98 replayed stone blocks at far pad

Guardrails

out_of_extent + fine_edit_quota enforced

Secret audit

gitleaks full history (65 commits): no leaks; GitHub push protection enabled

Release

v0.1.0, repo public

Runbook: docs/runbooks/phase1-gate.md · Design: docs/specs/2026-12-05-mc-ai-mcp-design.md

Roadmap

  • Phase 2 — large builds: module templates, bigger extents, soak/stress matrix.

  • Phase 3 — Fabric + NeoForge adapters (*.jar, same core journal/queue) — assets will be attached to their own releases; not yet built.

  • Phase 4 — Bedrock BDS adapter (.mcaddon behavior pack + WS bridge) and Java-only topdown_png vision — not yet built; .mcaddon will be attached when Phase 4 ships.

Release assets in v0.1.0: Paper plugin jar only. Fabric/NeoForge jars and the Bedrock .mcaddon are Phase 3/4 deliverables and are intentionally not attached yet — no placeholder binaries.

Security

  • AI provider keys live only on the agent host (env/keychain). Never in-game, never in this repo.

  • Game adapters hold a scoped, rotatable broker token (env-only); Bedrock will use BDS server-admin variables.

  • Repo hygiene: gitleaks pre-commit + CI, GitHub Secret Scanning + Push Protection, Apache-2.0 SPDX files, and .agent/ (AHP) journaling with hash-chained, secret-free handoffs.

Contributing

Contributions are welcome under DCO (git commit -s). See CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md.

License & disclaimer

Apache-2.0 — see LICENSE / NOTICE. Not affiliated with, endorsed by, or sponsored by Mojang Studios or Microsoft. “Minecraft” is a trademark of Mojang Studios. No Minecraft game assets are distributed in this repository.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers