Minecraft RCON MCP Server
Connects AI agents to Minecraft servers via RCON to execute commands, monitor logs, and perform read-only SQLite database queries. It is specifically designed to facilitate AI-assisted plugin development, live debugging, and automated testing workflows.
README
⛏️ Minecraft RCON MCP Server
An MCP (Model Context Protocol) server that connects AI agents to Minecraft servers through RCON. Execute commands, monitor logs, query databases, and check plugin health — all from your AI coding assistant.
Built and battle-tested during real AI-assisted Minecraft plugin development.
Features
- RCON Command Execution — Run any server command with automatic reconnection on failure
- Command + Log Capture — Execute a command and capture the server log output that follows (unique and powerful for plugin debugging)
- Server Log Reading — Tail the latest server log
- Filtered Log Monitoring — Read logs by configurable prefix (e.g.
[TEST],[DEBUG]) with incremental position tracking for efficient polling - SQLite Database Queries — Safe read-only SELECT queries against plugin databases, with write-operation blocking
- Plugin Health Checks — Combined RCON connectivity + error log scan + database status in one call
Quick Start
1. Install
# From PyPI (when published)
pip install minecraft-rcon-mcp
# Or from source
git clone https://github.com/YOUR_USERNAME/minecraft-rcon-mcp.git
cd minecraft-rcon-mcp
pip install .
2. Configure
Copy .env.example to .env and fill in your server details:
cp .env.example .env
RCON_HOST=localhost
RCON_PORT=25575
RCON_PASSWORD=your_password
SERVER_DIR=/path/to/minecraft/server
# Optional
DATABASE_PATH=/path/to/plugin.db
LOG_PREFIX=[TEST]
Make sure RCON is enabled in your server.properties:
enable-rcon=true
rcon.port=25575
rcon.password=your_password
3. Run
# Direct
minecraft-rcon-mcp
# Or as a module
python -m minecraft_rcon_mcp
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
RCON_HOST |
No | localhost |
RCON server hostname |
RCON_PORT |
No | 25575 |
RCON server port |
RCON_PASSWORD |
Yes | — | RCON password |
SERVER_DIR |
Yes | — | Minecraft server root directory |
DATABASE_PATH |
No | — | Path to plugin SQLite database |
LOG_PREFIX |
No | [TEST] |
Prefix for filtered log reading |
Tools
| Tool | Description | Read-Only |
|---|---|---|
run_command |
Execute an RCON command on the server | No |
run_command_with_log |
Execute a command and capture subsequent server log output | No |
read_server_log |
Read the last N lines from the server log | Yes |
read_test_log |
Read prefix-filtered log entries with incremental position tracking | Yes |
query_database |
Execute a read-only SELECT query on the plugin SQLite database | Yes |
check_plugin_status |
Check RCON connectivity, recent errors, and database status | Yes |
Usage with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"minecraft-rcon": {
"command": "minecraft-rcon-mcp",
"env": {
"RCON_HOST": "localhost",
"RCON_PORT": "25575",
"RCON_PASSWORD": "your_password",
"SERVER_DIR": "/path/to/minecraft/server",
"DATABASE_PATH": "/path/to/plugin.db"
}
}
}
}
Usage with Claude Code
Add to your .mcp.json:
{
"mcpServers": {
"minecraft-rcon": {
"command": "minecraft-rcon-mcp",
"env": {
"RCON_HOST": "localhost",
"RCON_PORT": "25575",
"RCON_PASSWORD": "your_password",
"SERVER_DIR": "/path/to/minecraft/server",
"DATABASE_PATH": "/path/to/plugin.db"
}
}
}
}
Find your server.properties
rcon.password= rcon.port= enable-rcon=true
Use Cases
AI-Assisted Plugin Testing
The run_command_with_log + read_test_log combo enables a powerful automated testing loop:
Agent writes plugin code
→ Build & deploy to server
→ run_command_with_log("mytest run")
→ read_test_log(event_filter="FAIL")
→ Agent fixes failures
→ Repeat
Live Debugging
check_plugin_status() → Is the plugin loaded? Any errors?
run_command("mycommand arg") → Execute plugin commands
read_server_log(lines=100) → Check what happened
query_database("SELECT ...") → Inspect plugin data
Incremental Log Monitoring
# First call — read all test logs
result = read_test_log() # returns position=12345
# After running more tests — only get NEW entries
result = read_test_log(since_position=12345)
Development
git clone https://github.com/YOUR_USERNAME/minecraft-rcon-mcp.git
cd minecraft-rcon-mcp
pip install -e .
中文说明
这是一个 MCP (Model Context Protocol) 服务器,通过 RCON 协议将 AI Agent 连接到 Minecraft 服务器。
核心功能
- RCON 命令执行 — 支持自动重连
- 命令 + 日志捕获 — 执行命令后自动抓取服务器日志输出
- 日志过滤读取 — 按前缀过滤日志,支持增量读取(位置追踪)
- 数据库只读查询 — 安全的 SQLite SELECT 查询,自动拦截写操作
- 插件健康检查 — RCON 连通性 + 错误日志 + 数据库状态一键检查
典型工作流
AI Agent 编写插件代码
→ 构建部署到服务器
→ run_command_with_log("cvtest all") ← 执行测试
→ read_test_log(event_filter="SUMMARY") ← 查看结果
→ read_test_log(event_filter="FAIL") ← 查看失败详情
→ Agent 修复问题 → 重复
这个 MCP 服务器在真实的 AI 辅助 Minecraft 插件开发中经过了充分验证(248 个测试用例全部通过)。
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。