MSMP Console
一个服务端 Fabric 模组,通过提供与控制台交互的附加功能,扩展了 Minecraft Server Management Protocol (MSMP)。
本模组专为工具、仪表板、自动化系统、外部监控工具以及需要结构化访问服务器控制台而不依赖 RCON 或日志文件尾部跟踪的集成而设计。
安装
- 下载模组
.jar 文件并将其放入服务器的 mods/ 文件夹中。
- 在
server.properties 中启用管理服务器:
management-server-enabled=true
- 启动服务器。管理服务器默认将在
localhost:25576 上监听。
配置
首次启动时,模组会在 <server_root_dir>/config/msmp/console/config.yml 生成配置文件:
# MSMP Entity 的主配置文件。
# 与日志相关的设置配置。
log:
# 作为 console:notification/log/event 转发的最低日志级别。
# 低于此级别的事件将被完全忽略,永远不会发送给已连接的客户机。
# @possible: TRACE | DEBUG | INFO | WARN | ERROR | FATAL
# @default: 'INFO'
level: INFO
# 与发送相关的设置配置。
send:
# 启用控制台命令执行的日志记录,这将防止回显发送的命令。
# @default: true
log-command-execution: true
RPC 方法
该模组目前提供以下 MSMP RPC 方法。所有这些方法也可以通过标准的 rpc.discover MSMP 端点自动发现。
| 方法 |
描述 |
console:send |
以完整权限在服务器控制台上执行命令并返回其输出 |
如果您需要更多用于其他目的的方法或通知,请提交 Issue
RPC 通知
该模组还提供以下客户机可以订阅的 MSMP RPC 通知:
| 方法 |
描述 |
console:notification/log/event |
每当发生等于或高于配置 log.level 的服务器控制台日志事件时触发 |
方法参考
console:send
像操作员输入一样执行任意命令(拥有完整权限),并返回其文本反馈/错误输出以及成功指示符。命令可以带或不带前导 / 发送。
// 请求
{ "command": "say Hello" }
// 响应
{
"command": "say Hello",
"result": "",
"success": true
}
console:notification/log/event
每当发生等级等于或高于配置 log.level 的服务器控制台日志事件时触发。低于该级别的事件在到达已连接客户机之前会被丢弃。
{
"jsonrpc": "2.0",
"method": "console:notification/log/event",
"params": [{
"timestamp": "2026-03-21T15:06:06.146Z",
"level": "INFO",
"thread": "Server thread",
"logger": "net.minecraft.server.MinecraftServer",
"message": "Done (1.019s)! For help, type \"help\"",
"throwable": ""
}]
}
{
"jsonrpc": "2.0",
"method": "console:notification/log/event",
"params": [{
"timestamp": "2026-03-21T15:06:07.212Z",
"level": "ERROR",
"thread": "Server thread",
"logger": "net.minecraft.server.MinecraftServer",
"message": "Encountered an unexpected exception",
"throwable": "java.lang.NullPointerException: Cannot invoke ...\n\tat net.minecraft.server.MinecraftServer..."
}]
}
许可证
LGPL-3.0
MSMP Console
A server-side Fabric mod that extends the Minecraft Server Management Protocol (MSMP) by providing additional functions for interacting with the console.
This mod is designed for tooling, dashboards, automation systems, external monitoring tools, and integrations that need structured access to the server console without relying on RCON or log-file tailing.
Installation
- Download the mod
.jar and place it in your server's mods/ folder.
- Enable the Management Server in
server.properties:
management-server-enabled=true
- Start the server. The Management Server will listen on
localhost:25576 by default.
Configuration
On first start, the mod generates a configuration file at <server_root_dir>/config/msmp/console/config.yml:
# Main configuration file for MSMP Entity.
# Configuration for log related settings.
log:
# The minimum log level that gets forwarded as a console:notification/log/event.
# Events below this level are ignored entirely and never sent to connected clients.
# @possible: TRACE | DEBUG | INFO | WARN | ERROR | FATAL
# @default: 'INFO'
level: INFO
# Configuration for send related settings.
send:
# Enable logging for the execution of a command in the console, this prevents echoing the send command.
# @default: true
log-command-execution: true
RPC Methods
The mod currently provides the following MSMP RPC methods. All of these methods are also automatically discoverable through the standard rpc.discover MSMP endpoint.
| Method |
Description |
console:send |
Executes a command on the server console with full permissions and returns its output |
If you want more methods or notifications for other purposes, please open an issue
RPC Notifications
The mod also provides the following MSMP RPC notification that clients can subscribe to:
| Method |
Description |
console:notification/log/event |
Fired for every server console log event at or above the configured log.level |
Method Reference
console:send
Executes an arbitrary command as if typed by an operator (full permissions) and returns its textual feedback/error output together with a success indicator. The command may be sent with or without a leading /.
// Request
{ "command": "say Hello" }
// Response
{
"command": "say Hello",
"result": "",
"success": true
}
console:notification/log/event
Fired for every server console log event whose level is at or above the configured log.level. Events below that level are dropped before ever reaching connected clients.
{
"jsonrpc": "2.0",
"method": "console:notification/log/event",
"params": [{
"timestamp": "2026-03-21T15:06:06.146Z",
"level": "INFO",
"thread": "Server thread",
"logger": "net.minecraft.server.MinecraftServer",
"message": "Done (1.019s)! For help, type \"help\"",
"throwable": ""
}]
}
{
"jsonrpc": "2.0",
"method": "console:notification/log/event",
"params": [{
"timestamp": "2026-03-21T15:06:07.212Z",
"level": "ERROR",
"thread": "Server thread",
"logger": "net.minecraft.server.MinecraftServer",
"message": "Encountered an unexpected exception",
"throwable": "java.lang.NullPointerException: Cannot invoke ...\n\tat net.minecraft.server.MinecraftServer..."
}]
}
License
LGPL-3.0
评论 0
登录后参与评分
还没有评论,来抢沙发吧