HeadlessMc

io.github.headlesshq由 GitHub 账号 headlesshq 发布v0.1.0更新于 Nov 2, 2026

Install, launch and control Minecraft: Java Edition clients and servers, also headless.

概览

AI 生成的概览

让 AI 助手安装、启动并控制 Minecraft Java 版客户端与服务器的 MCP 服务器,支持无头运行。

可以做什么
  • 执行 HeadlessMc 命令行并轮询长时间运行的任务
  • 安装版本、加载器、Java 与 Modrinth 模组,启动客户端和服务器(可无头)
  • 管理配置文件,列出所有运行中实例及其状态
  • 读取实例日志并向服务器发送控制台命令
  • 读取并操作游戏界面:获取界面与状态、点击、输入、按键、聊天、连接服务器
  • 等待游戏事件并执行游戏内命令
适用场景
适合让助手端到端地搭建和操作 Minecraft Java 客户端或服务器,例如测试模组、在 CI 或 Docker 中无显示运行客户端,或自动化游戏内操作与服务器管理。
运行要求
以 stdio 在本地运行,可用 npm 包或发布的 jar/原生可执行文件;jar 需要 Java 25 或更高版本。Minecraft 账号通过微软设备代码流程登录。需要网络访问以下载版本、库、模组以及 HMC-Specifics 与桥接模组。
安装前请注意
会安装并启动软件,并从外部来源下载模组和 jar。可启动和停止服务器与客户端、发送控制台和聊天命令,并删除配置文件及其文件,具有破坏性。启动服务器需接受 Minecraft EULA。项目自称为原型。桥接模组会在回环地址上开启本地 HTTP 服务,由随机令牌保护。

安装

在 SourceWeft 中

  1. 打开 控制台中的 HeadlessMc,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

HeadlessMc - MCP

An MCP server for HeadlessMc: install, launch and control Minecraft: Java Edition from AI agents.

[logo]

HMC | HMC-Specifics | HMC-Skill

[!WARNING] This is a prototype. We are looking forward to feedback and feature requests.

[Screenshot]

With this MCP server, Claude Code, Codex, Cursor and other MCP clients can:

  • install vanilla, Fabric, Forge and NeoForge versions, Java, and mods from Modrinth (everything HeadlessMc can do),
  • launch several clients and servers at the same time, optionally headless (no display or GPU, e.g. in CI or Docker), each client in its own profile (game directory with its own mods, config and worlds),
  • control running clients: read the screen, click buttons, type, chat, run commands, connect to servers, etc.
  • read the logs of every instance and send console commands to servers.

Setup

AgentInstall
Claude Code/plugin install headlessmc-mcp --marketplace headlesshq/headlessmc-mcp
OpenAI Codexcodex plugin marketplace add headlesshq/headlessmc-mcp, then /plugins, tab HeadlessMc MCP, Install plugin
GitHub Copilot CLIcopilot plugin marketplace add headlesshq/headlessmc-mcp, then copilot plugin install headlessmc-mcp@headlessmc-mcp
Cursorclone this repository and copy plugin to ~/.cursor/plugins/local/headlessmc-mcp, then Developer: Reload Window
Gemini CLIgemini extensions install https://github.com/headlesshq/headlessmc-mcp

For instructions on HeadlessMc itself (installing it, mod testing in CI with MC-Runtime-Test), install the headlessmc-skill as well.

Tools

ToolDescription
hmcRun any HeadlessMc command line, e.g. version install fabric 1.21.5, mod search sodium, login. Long commands keep running, poll them with hmc_job.
hmc_jobOutput and status of a running hmc command.
launch_clientInstall and launch a client (version, loader or profile, headless, offline, server to join, JVM args) and wait until it shows the main menu.
start_serverCreate and start a Paper/Fabric/Purpur/Forge/NeoForge/vanilla server and wait until it has loaded the world.
list_profiles, create_profile, delete_profileManage profiles: client setups with their own game directory.
list_instancesAll launched clients and servers with their status.
instance_logThe latest lines of an instance's output, optionally filtered by a regex.
server_commandWrite a console command to a server and return what it prints.
stop_instanceQuit a client or stop a server (or kill it).
get_screenThe current screen as JSON: buttons and text fields with ids, texts, positions.
get_stateJSON: in world, dead, screen, and metrics like position, health, dimension, server, ping, TPS, players.
click, set_text, press_keyInteract with the current screen. click returns the screen it leads to.
chatSend a chat message or a /command.
connect, disconnectJoin or leave a server.
wait_forWait for in_world, menu, screen:<Name>, log:<regex> or exit.
game_commandRun any HMC-Specifics command inside the game (help, metrics, render, respawn, commands of other mods).

Resource template: hmc://instances/{id}/log.

Several clients at once

Every running client needs its own game directory, otherwise they overwrite each other's files and share a mods folder. launch_client takes an optional profile: a HeadlessMc profile with its own game directory, created in <HeadlessMc data dir>/client/<profile> if it does not exist. Without a profile, a client uses the default game directory of its version, and if another client of that version is already running there, the MCP server creates a new profile (fabric-1.21.8-2, ...) automatically. Versions, libraries and assets are shared between all profiles. Agents can keep profiles for different setups and add mods to them with mod add mod <slug> <profile>.

Game Control

Game control works on every Minecraft version and modloader that HMC-Specifics supports (1.7.10 to 26.x, Forge, Fabric, NeoForge). The server downloads the matching HMC-Specifics jar and puts it, together with the version independent hmc-mcp-bridge mod, into the mods folder of the client before launching it.

  • The root project (src/) is the MCP server, a Quarkus application. It uses HeadlessMc's CDI beans and picocli commands directly, like headlessmc-web. stdout is the MCP channel, so HeadlessMc's console output and progress bars are captured and returned as tool results instead.
  • hmc-mcp-bridge is a mod that is not tied to a Minecraft version. It uses the HMC-Specifics API and starts a small HTTP server on the loopback interface once HMC-Specifics has initialized. The MCP server passes it a random token and a port file with -Dhmc.mcp.token and -Dhmc.mcp.portFile. Without a token the mod does nothing. Command output comes back separately from the game log, and JSON commands make the screen and state machine-readable.

Agents can also control clients you start yourself, with any launcher (the Minecraft Launcher, Prism, MultiMC, your IDE's run configuration, ...). Put two mods into the mods folder:

  • HMC-Specifics for your Minecraft version and modloader,
  • hmc-mcp-bridge from the releases, one jar for every version and modloader.

When a game with these mods was not launched by the MCP server, the bridge creates a random token, listens on a free port of 127.0.0.1 and registers the game in headlessmc-mcp/instances/<pid>.json in the user's state directory ($XDG_STATE_HOME, else ~/.local/state on Linux, ~/Library/Application Support on macOS, %LOCALAPPDATA%\state on Windows). The file is only readable by you and is deleted when the game exits. list_instances picks up these registrations, so the game appears as an attached instance, and the game tools work as for launched clients. The log comes from logs/latest.log. The MCP server never stops attached games on its own, and they have no console for server_command. Launch the game with -Dhmc.mcp.enabled=false to turn the bridge off.

Asking the user

Some things need the user, not the agent. The MCP server uses elicitation when the MCP client supports it:

  • Minecraft EULA: start_server asks the user to accept the EULA with a checkbox before a server is started for the first time. Without elicitation support, the agent has to ask and pass acceptEula.
  • Microsoft login: the login command asks the client to open Microsoft's device code page (URL mode), so the user signs in in their browser and the agent never sees credentials.
  • Prompts of HeadlessMc commands are shown to the user as a form. Passwords and tokens are never requested, the MCP specification forbids that for form elicitation.
  • Deleting a profile with its files asks for confirmation.

Long installs and launches send progress notifications, and cancelling a tool call in the client cancels the HeadlessMc command.

Installing

Download the latest release from GitHub Releases:

FilePlatform
headlessmc-mcp.jarAny platform with Java 25 or newer: java -jar headlessmc-mcp.jar
headlessmc-mcp-windows-x64.exeWindows x64
headlessmc-mcp-linux-x64, headlessmc-mcp-linux-arm64Linux (e.g. Ubuntu) x64 and arm64
headlessmc-mcp-macos-arm64, headlessmc-mcp-macos-x64macOS on Apple silicon and Intel

Building

Requires JDK 25:

sh
git clone --recurse-submodules https://github.com/headlesshq/headlessmc-mcp.gitcd headlessmc-mcp./gradlew build# -> build/headlessmc-mcp-<version>-runner.jar (includes the hmc-mcp-bridge mod)# -> hmc-mcp-bridge/build/libs/hmc-mcp-bridge-<version>.jar
# native executable for the current platform, needs GraalVM 25 (or add -Dquarkus.native.container-build=true for Linux)./scripts/build-native.sh# -> build/headlessmc-mcp-<version>-runner

Configuration

PropertyDefaultDescription
hmc.mcp.specifics.version3.0.1HMC-Specifics release to install into clients.
hmc.mcp.specifics.urlGitHub releasesDownload URL template with {tag}, {mc} and {loader}.
hmc.files.game-for-each-versiontrueSeparate game directory per version, so mods folders do not clash.
hmc.mcp.registry<state dir>/headlessmc-mcp/instancesWhere games from other launchers register, set it for the game as well.

All HeadlessMc properties (hmc.*) work as well, as system properties or in HeadlessMc's config file.

The hmc-mcp-bridge mod reads hmc.mcp.token, hmc.mcp.portFile, hmc.mcp.host (127.0.0.1), hmc.mcp.port (0, any free port), hmc.mcp.registry and hmc.mcp.enabled (true) from system properties. Without hmc.mcp.token it registers the game for attaching.

Privacy and terms

The MCP server runs locally and sends no telemetry. See the Privacy Policy and the Terms of Use. HeadlessMc - MCP is not an official Minecraft product and is not approved by or associated with Mojang or Microsoft.

来源:README.md,提交 2a91a2e

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Oct 19, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分