HMCL MCP Server
Search, download, and install Minecraft modpacks from CurseForge using HMCL's embedded API key, including retrieving project details and specific versions.
Search, download, and install Minecraft modpacks from Modrinth, including retrieving project details and specific versions, all through HMCL's own addon repository.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@HMCL MCP Serverinstall Minecraft version 1.20.1"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
HMCL MCP Server
MCP (Model Context Protocol) server that lets AI agents drive HMCL (Hello Minecraft! Launcher, https://hmcl.huangyuhui.net) programmatically: install Minecraft versions, search/download/import modpacks (Modrinth + CurseForge), and launch/stop the game.
HMCL has no command line interface (no --launch, no --import, no headless mode), so this project injects a small javaagent into a headless HMCL JVM and drives HMCL's core classes directly. Modpack search/download/install all run through HMCL's own addon repositories inside the agent (Modrinth, and CurseForge with HMCL's embedded API key — no user key needed); listing installed versions/modpacks is a local filesystem scan.
Architecture
┌──────────────────────────────┐ stdio (JSON-RPC only) ┌────────────────────────────────┐
│ MCP client / AI agent │ ◀────────────────────────▶ │ Node MCP server (this repo) │
└──────────────────────────────┘ └───────────────┬────────────────┘
filesystem scans │ HTTP JSON API
<workdir>/versions/, │ 127.0.0.1:<port>
mcpacks/ (search/download) │ X-HMCL-Agent-Token
▼
┌────────────────────────────────┐
│ Headless HMCL JVM │
│ java -javaagent:hmcl-agent.jar │
│ -Dhmcl.gameDir=<workdir> … │
│ -cp HMCL.jar;javafx-*.jar │
│ hmcl.agent.AgentMain │
└────────────────────────────────┘Node MCP server (
src/, TypeScript, stdio transport): registers 13 tools, drives HMCL's own Modrinth/CurseForge modpack repositories for search/download/install, scans<workdir>/versions/on disk for installed versions and modpacks, and talks to the agent over loopback HTTP.Java agent (
agent/, compiled bynpm run build:agent): injected into HMCL with-javaagent; initializes HMCL core headlessly (SettingsManager.init()→DownloadProviders.init()→Accounts.init()) and exposes a loopback HTTP JSON API (/status,/versions/install,/modpack/install,/launch,/launch/stop,/shutdown) on127.0.0.1:<port>. A non-daemon HTTP thread keeps the JVM alive.No launcher GUI: the HMCL window never opens. When you launch the game, the game window itself opens normally (the game is a separate child process).
HMCL-compatible directory layout inside the workdir: versions/<id>/, libraries/, assets/, mcpacks/ (downloaded pack files), hmcl/ (HMCL.jar + hmcl-agent.jar + javafx jars), .hmcl/ (HMCL 3.16+ workspace config).
Related MCP server: Desktop Commander MCP Server
Requirements
Node.js 18+ (24 recommended) — MCP SDK 1.30.0,
npm installJDK 17+ with
javac(21 recommended) — HMCL itself requires Java 17;javacis needed to compile the agent jarInternet access on first run (HMCL jar, javafx jars, Minecraft versions/libraries/assets)
Tools (13)
Tool | Args | Description |
| — | Java path + version, workdir, hmcl dir contents (HMCL.jar / hmcl-agent.jar / javafx jars), agent running status, version/modpack counts |
| — | Download latest HMCL jar into |
| — | Start the headless HMCL JVM with the agent (no-op if already running) and return agent |
| — | Stop the headless HMCL JVM (agent |
| — | Scan |
|
| Install a vanilla Minecraft version through the agent's HMCL download pipeline |
|
| Search modpacks via HMCL's own repositories (CurseForge uses HMCL's embedded key — no user key needed) |
|
| Project details + latest version for one modpack (id = Modrinth slug or CurseForge numeric id) |
|
| Download the pack file into |
|
| Download (if |
| — | Scan |
|
| Launch an instance as an offline account; the game opens as a child process |
| — | Stop the running game process (agent |
All handlers return structured data on success and an error message on failure (MCP isError result) — they never crash the server.
Quick start
npm install # install dependencies
npm run build # compile the MCP server → dist/
npm run build:agent # download javafx jars + compile agent/build/hmcl-agent.jar (javac required)Register the server in your MCP client:
{
"mcpServers": {
"hmcl-mcp": {
"command": "node",
"args": ["D:/ProjectDir/AgentFarm/HMCL-MCP/dist/index.js"]
}
}
}Environment variables can be set in the client's env object, in your shell, or via a .env file — see .env.example and docs/setup.md.
Environment variables
Variable | Default | Description |
|
| HMCL working directory (game root + user data): |
|
| Directory holding |
|
| Java binary used to launch the headless HMCL JVM |
| (none) | Optional CurseForge API key override, passed to HMCL as |
|
| Agent HTTP port on |
|
| Shared token, sent as the |
Typical agent workflows
Modpack: search → install → launch
search_modpacks(query: "fabulously optimized")→get_modpack(id: "fabulously-optimized")→install_modpack(id: "fabulously-optimized", name: "fabulously-optimized")(downloads and installs in one step, all through HMCL) →launch_game(version: "fabulously-optimized", username: "Steve")— note:launch_game'sversionis the instance name frominstall_modpack/list_modpacks, not the Minecraft version numberVanilla: install a version → launch
install_version(mc_version: "1.21.4")→launch_game(version: "1.21.4", username: "Steve")First run / fresh setup
check_environment(verify java + hmcl dir) →install_hmcl(downloads HMCL.jar, builds the agent jar) →start_hmcl(boots the headless JVM, agent responds on/status)Cleanup
stop_game(stop the running game) →stop_hmcl(stop the headless JVM)
Troubleshooting
javac not found/ java missing: installing a JDK is the user's responsibility — install JDK 17+ (21 recommended) and make sure bothjavaandjavacare on PATH (or setHMCL_MCP_JAVA).First run downloads:
install_hmcldownloads HMCL.jar (~10 MB) from GitHub releases andnpm run build:agentdownloadsjavafx-base/javafx-graphicsfrom Maven Central — both need internet and can take a minute.install_hmclfails with HTTP 403/429: GitHub API rate limit — downloadHMCL-<version>.jarmanually and place it at<hmclDir>/HMCL.jar(seedocs/setup.md), then re-run.CurseForge errors (403): missing/invalid API key — CurseForge is optional; use Modrinth (keyless) for search/install.
Headless means no launcher window: only the game window appears, on
launch_game.Port conflict: change
HMCL_MCP_AGENT_PORTand restart; the agent binds127.0.0.1only.Paths containing
!: HMCL refuses to run when the working directory or jar path contains!— use a path without it.
Docs
docs/setup.md— manual HMCL install, workdir layout, reusing an existing game directory, security notesdocs/research/— research notes (MCP SDK, HMCL Java API, HMCL CLI/modpack formats, Modrinth/CurseForge APIs)src/types.ts— the shared contract (tools, types, cross-module interfaces)
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBqualityDmaintenanceA lightweight MCP server that provides a unified interface to various LLM providers including OpenAI, Anthropic, Google Gemini, Groq, DeepSeek, and Ollama.6737
- Alicense-qualityDmaintenanceA comprehensive MCP server that gives AI assistants full control over your desktop — monitor system resources, manage windows, capture screenshots, control the clipboard, launch applications, and more.MIT
- Alicense-qualityAmaintenanceAn MCP server that lets AI agents control iOS and Android devices (tap, scroll, type, take screenshots, read UI trees, and run code). Works with multiple devices at the same time.54238MIT
- AlicenseAqualityCmaintenance这是一个面向中文圈的MCP服务器,将中国互联网常用能力(如地图、快递、RSS、B站等)封装为标准MCP工具,方便AI Agent安全调用。132MIT
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
An MCP server that gives your AI access to the source code and docs of all public github repos
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/vfyjxf/HMCL-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server