{"id":"339af8bc-29d0-4aec-a019-4c247b9e6124","slug":"limingzxc-command-mcp","kind":"mcp","name":"Command-MCP","summary":"","owner":"limingzxc","repoUrl":"https://github.com/limingzxc/Command-MCP","license":"GPL-3.0","licenseTier":"strong-copyleft","trust":"community","stars":1,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-08-15T14:22:54.000Z","addedAt":"2026-10-21T21:44:11.139Z","logoUrl":"https://avatars.githubusercontent.com/u/76505780?u=0046c8724ca417d2102569215e3df813e052c6d6&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["utilities"],"tags":[],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-23T00:06:12.418Z","sample":false,"url":"https://conduits.dev/tools/limingzxc-command-mcp","language":"Java","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# Command MCP\n\nEnglish | [简体中文](README.zh-CN.md)\n\nExpose your Minecraft server as an [MCP](https://modelcontextprotocol.io) (Model Context Protocol) server, so AI assistants such as Claude can operate your server remotely: search and run commands, use in-game Tab completion, and build datapacks — all through a standard MCP client.\n\nBuilt for Fabric with zero additional dependencies: the MCP server uses Streamable HTTP transport (`POST`/`GET`/`DELETE` `/mcp`) with JSON-RPC 2.0, implemented on the JDK's built-in `HttpServer` and Minecraft's bundled Gson.\n\n## Features\n\n- **Command access** — search registered commands (vanilla and mods), execute commands as console (OP level 4) on the server main thread with captured output, run read-only queries, and get Tab-completion suggestions that match in-game behavior.\n- **Datapack workflow** — inspect server info (version, `pack_format`, directory layout), list datapacks, read/write/delete datapack files, and reload with full error reporting (.mcfunction syntax errors, JSON errors, incompatible `pack_format`).\n- **Session management** — `Mcp-Session-Id` based sessions with idle timeout, SSE keepalive streams, and optional `Authorization: Bearer` token auth.\n- **In-game awareness** — chat notifications when an AI client connects or disconnects.\n- **Safe defaults** — binds to `127.0.0.1` only; datapack file writes can be disabled.\n\n## Requirements\n\n- Minecraft `1.20.1`\n- Fabric Loader `>= 0.19.3`\n- Fabric API\n- Java `>= 17`\n\n## Getting Started\n\n1. Drop the mod jar into your `mods` folder and start the game/server.\n2. The MCP server starts automatically:\n   - **Dedicated servers**: enabled by default.\n   - **Single-player / client**: disabled by default; set `enabled=true` in the config to turn it on.\n3. Point your MCP client at `http://127.0.0.1:8123/mcp` (Streamable HTTP).\n\nExample Claude Desktop configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"minecraft\": {\n      \"type\": \"http\",\n      \"url\": \"http://127.0.0.1:8123/mcp\",\n      \"headers\": {\n        \"Authorization\": \"Bearer <your-token>\"\n      }\n    }\n  }\n}\n```\n\n## Configuration\n\nConfig file: `config/command-mcp.properties` (created with defaults on first launch).\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `enabled` | `true` on dedicated servers, `false` in client environments | Whether the MCP HTTP server starts with the game. |\n| `host` | `127.0.0.1` | Bind address. Keep `127.0.0.1` unless you know what you are doing. |\n| `port` | `8123` | Bind port (0 = system-assigned). |\n| `authToken` | *(empty)* | When non-empty, requests must send `Authorization: Bearer <token>` or `X-Auth-Token: <token>`. |\n| `datapackWrite` | `true` | Allow `write_datapack_file` / `delete_datapack_file` to modify the world's `datapacks` folder. |\n\n## MCP Tools\n\n| Tool | Description |\n| --- | --- |\n| `list_commands` | Search registered commands by name/alias/help text; returns usage templates. |\n| `execute_command` | Execute a command as console (OP level 4) and return captured output. |\n| `query_command` | Run a read-only query command (`/list`, `/time query daytime`, `/data get`, ...). |\n| `get_command_completions` | Tab-completion suggestions for a partial command, matching in-game behavior. |\n| `get_server_info` | Minecraft version, `pack_format`, datapack directory layout, loaded mods. |\n| `list_datapacks` | Datapacks in the world folder: type, enabled state, provided namespaces. |\n| `read_datapack_file` | Read a UTF-8 text file inside the world's datapacks folder. |\n| `write_datapack_file` | Create/overwrite a datapack file; auto-creates `pack.mcmeta` and parent directories. |\n| `delete_datapack_file` | Delete a file/directory inside the datapacks folder. |\n| `reload_datapacks` | Reload datapacks and wait, then report success or captured errors/warnings. |\n\n## Security Notes\n\n- The server executes commands at **OP level 4** — treat MCP access as full server access.\n- By default the server only listens on `127.0.0.1`. If you expose it over a network, always set an `authToken`.\n- Set `datapackWrite=false` to keep the datapack tools read-only.\n\n## Development\n\n```shell\n./gradlew build\n```\n\nThe built jar lands in `build/libs/`.\n\n## License\n\nReleased under the [GPL-3.0 license](LICENSE). If you use this code in your project, your project must also be open-sourced under a compatible license.\n"}