Skip to main content
Glama
inrok872-cyber

minecraft-paper-mcp

minecraft-paper-mcp

MCP 服务器,用于管理 Paper Minecraft 服务器的后台 — 与 Minecraft 服务器运行在同一台机器上(可直接访问文件并直接操作进程),并通过 RCON 提供游戏内命令。

功能

  • 进程控制server_startserver_stopserver_restartserver_status

  • RCON / 游戏内命令rcon_command(任意原始命令)、players_listserver_tpsserver_sayplayer_kickplayer_banplayer_pardonplayer_opplayer_deopwhitelist_addwhitelist_removegive_itemteleport_playerset_gameruleset_weatherset_time

  • 读取文件whitelist_listops_listbanned_players_listbanned_ips_listserver_properties_getserver_properties_set(需重启后才生效)

  • 日志logs_tail(查看最近 N 行日志)、logs_search(使用正则表达式 grep)

Related MCP server: Minecraft Server MCP

安装

需要 Node.js 18 或更高版本

cd minecraft-mcp
npm install
npm run build

准备 Paper server

  1. 在 Paper 服务器的 server.properties 中启用 RCON:

enable-rcon=true
rcon.port=25575
rcon.password=ใส่รหัสผ่านที่ตั้งเอง_อย่าใช้ค่าว่าง
  1. 重要:如果 RCON 端口可能对外暴露,必须用防火墙阻止 — RCON 未加密。如果 MCP 服务器与 Minecraft 服务器运行在同一台机器上,应让 RCON 只监听 127.0.0.1(默认值)。

  2. 重启一次 Paper 服务器,使 RCON 配置生效。

设置环境变量

可以参考 .env.example 文件 — 将其复制为 .env 并填入真实值(.env 文件已被加入 .gitignore,不会提交到 GitHub)。MCP 服务器本身不会自动加载 .env(未使用 dotenv)— 请通过 claude_desktop_config.json 中的 env 进行设置,或在实际运行前导出变量。.env 仅供自己记录配置值。

变量

默认值

说明

MC_SERVER_DIR

当前目录

Paper 服务器文件夹的路径(包含 paper.jarserver.properties 等)

MC_START_COMMAND

java -Xmx4G -Xms2G -jar paper.jar nogui

用于启动服务器的命令(根据实际的 RAM/jar 名称调整)

MC_RCON_HOST

127.0.0.1

RCON 的主机

MC_RCON_PORT

25575

RCON 的端口

MC_RCON_PASSWORD

(空)

RCON 密码 — 必须与 server.properties 中的设置一致

MC_PID_FILE

<MC_SERVER_DIR>/.mc-server.pid

存储已启动进程 PID 的文件

在 Claude Desktop 中设置

claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "minecraft-paper": {
      "command": "node",
      "args": ["/absolute/path/to/minecraft-mcp/build/index.js"],
      "env": {
        "MC_SERVER_DIR": "/absolute/path/to/paper-server",
        "MC_START_COMMAND": "java -Xmx6G -Xms2G -jar paper-1.21.jar nogui",
        "MC_RCON_PASSWORD": "รหัสผ่านเดียวกับใน server.properties"
      }
    }
  }
}

然后重启 Claude Desktop

CI

有一个 GitHub Actions workflow(.github/workflows/build.yml),每次向 main 推送或开启 PR 时,都会在 Node 18.x 和 20.x 上运行 npm install + npm run build,以检查项目能否构建通过。如果要用 npm ci 代替 npm install,请先在本地运行一次 npm install 生成 package-lock.json,然后提交该文件到仓库。

备注 / 注意事项

  • server_start/server_restart 会以分离(detached)方式生成进程,并将 PID 保存在 MC_PID_FILE 中 — 如果要以正式服务(systemd)的方式运行,也仍然可以使用,但 MCP 本身无法识别 systemd 自行创建的进程。请选择其中一种方式(让这个 MCP 自己负责启动/停止,或让 systemd 管理,只使用依赖 RCON/文件的工具)。

  • server_stop 会先尝试通过 RCON 发送 stop 命令(优雅停止),如果无法连接 RCON,则回退为发送 SIGTERM

  • server_properties_set 直接修改文件,需要自行重启服务器后才会生效(不会自动重启)。

  • ban/kick/whitelist 命令通过 RCON 执行,不会直接修改 json 文件 — 在服务器运行期间更安全。

Install Server
F
license - not found
B
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    B
    quality
    D
    maintenance
    Provides comprehensive administrator-level control for Minecraft Java Edition servers, allowing AI to manage world generation, server configuration, and player moderation. It enables remote execution of RCON commands, NBT data parsing, and automated backup management through the Model Context Protocol.
    40
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Enables AI assistants to interact with and manage Minecraft servers through a standardized interface, supporting server monitoring, player management, log analysis, and command execution.
    11
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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/inrok872-cyber/minecraft-paper-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server