MC-World-MCP
Offline MCP server for reading and writing Minecraft server files, including level data, datapacks, regions, and structures, with safety checks and backups.
README
MC-World-MCP
Offline-only MCP tools for operating on a Minecraft server directory.
This MCP intentionally does not use RCON, sockets, online player queries, or server start/stop controls. It only reads and writes local files such as level.dat, datapacks, structure templates, logs, and Anvil region files.
The complete write path targets Java Edition / Arclight 1.20.1 worlds with
DataVersion 3465. Other Java Anvil worlds are detected and exposed for
best-effort reads, but world writes are rejected unless the version adapter marks
them as fully supported. Bedrock LevelDB worlds are detected as unsupported.
Run
When this project lives at E:/VC/mc-world-mcp and a server workspace lives two levels below E:/VC, the workspace .vscode/mcp.json starts the server with:
{
"command": "python",
"args": ["-m", "mc_world_mcp.server"],
"env": {
"PYTHONPATH": "${workspaceFolder}/../../mc-world-mcp/src",
"MC_SERVER_ROOT": "${workspaceFolder}"
}
}
MC_SERVER_ROOT should point at the Arclight server root that contains server.properties and world/. If it is omitted, the server tries the current working directory first.
World selection follows server.properties level-name, so a server using
level-name=world_regen_source is operated through that directory rather than a
hardcoded world/. Set MC_WORLD_NAME to override this explicitly.
Safety
All write tools:
- reject paths outside
MC_SERVER_ROOT - reject writes when a server or unknown
java/javawprocess is running; recognized Minecraft client Java processes are ignored - reject Java world writes unless the selected world is DataVersion 3465
- back up every modified file under
backup/mc_world_mcp/<timestamp>/ - write a
manifest.jsondescribing the changed files
Read tools are allowed while the server is running.
Tool Groups
- Server/files: summaries, safe file read/write, logs, version/platform detection
- Source worlds: local world inventory, server-generation workflow guidance, source/target chunk comparison, and offline chunk import
- NBT:
level.dat, player data, world data, structure NBT - Datapacks: folder and zip datapack listing, validation, search, read, write
- Worldgen: datapack/mod/plugin interface listing, resource checks, source-world simulation, and report summaries
- Regions: scan, inspect chunks, get/read/set/fill/replace blocks, block state strings
- World diagnostics: dimensions, world coverage, chunk palettes, log issue grouping
- World data: block entities, external entity regions, POI regions, biome boxes, heightmap clearing, chunk pruning
- Templates: list/read/write
.nbtstructure templates, export/place blocks with block entities and best-effort entities - Preview: offline PNG map, slice, and structure-template previews under
backup/mc_world_mcp/previews/ - Safety: offline checks, backup listing, backup restore
Optional Preview Acceleration
Preview rendering and source-world generation simulation have pure-Python fallbacks and can optionally use a compiled Cython module for hot loops such as block-state index decoding, chunk surface projection, source-world floor projection, and structure-template projection.
On Windows, compile the extension in place:
python setup.py build_ext --inplace
The source distribution includes generated C code, so Cython is optional for
normal builds. Install mc-world-mcp[preview-accel] or python -m pip install Cython only when you want to regenerate the C file from _preview_accel.pyx.
For wheel builds, set MC_WORLD_MCP_BUILD_ACCEL=1 to opt in to compiling the
extension.
This creates a platform-specific mc_world_mcp._preview_accel.pyd next to the
Python sources. If the compiled module is present, preview and simulation tools
load it automatically; otherwise they continue using the pure-Python
implementation.
Building the .pyd requires the Microsoft C++ Build Tools matching the active
Python version.
The repository may include a prebuilt
src/mc_world_mcp/_preview_accel.cp311-win_amd64.pyd for Windows x64 CPython
3.11. Other Python versions, platforms, or architectures should rebuild the
extension locally.
Assistant MCP Instructions
AI assistants working on this Minecraft workspace should use MCP tools in this order:
-
Read MCP-provided instructions.
- The
mc-worldserver exposes this guidance in its server instructions. - Call
assistant_instructions()first when tool choice or workflow is unclear. - MCP clients that support resources can read
mc-world://assistant-instructions. - MCP clients that support prompts can use
mc_world_assistant_instructions.
- The
-
Read project context first.
- Read Copilot repo memory when available, especially project overview, datapacks, tool reference, gotchas, change history, and MCP server notes.
- Then read local files such as
README.md,.github/copilot-instructions.md,server.properties, datapack files, and logs as needed.
-
Use
minecodefor Minecraft reference lookups.- Command syntax: call
get_wiki_command_info, thenspyglass_get_commandswhen exact 1.20.1 syntax matters. - IDs and registries: call
spyglass_get_registriesfor blocks, items, entities, biomes, enchantments, and other registries. - Vanilla JSON: call Misode tools such as
misode_get_preset_data,misode_get_presets,misode_get_loot_tables, andmisode_get_recipes. - Wiki background: call
search_wiki, thenget_wiki_page_content.
- Command syntax: call
-
Use
mc-worldfor local server and world operations.- Start with
server_summary(),detect_world_version(),world_summary(), andcheck_offline_safety(). - For datapacks, use
list_datapacks(),validate_datapacks(),search_datapack_files(),read_datapack_file(), andwrite_datapack_file(). - For worldgen diagnosis, use
list_generation_interfaces(),worldgen_report(),list_worldgen_resources(), andvalidate_worldgen_references(). - For logs, use
analyze_latest_log(),read_server_log(), andgrep_server_log(). - For Anvil data, use
scan_regions(),scan_world_coverage(),inspect_chunk(),summarize_chunk_palette(),get_block(),read_block_box(),set_block(),fill_blocks(), andreplace_blocks(). - For NBT edits, use
read_level_dat(),write_level_dat_value(),read_nbt_file(),write_nbt_value(), andwrite_chunk_nbt_value(). - For entities, block entities, POI, biomes, and heightmaps, use
list_entities(),add_entity(),edit_entity(),delete_entities(),add_block_entity(),edit_block_entity(),list_poi(),delete_poi(),set_biome_box(), andrefresh_heightmaps(). - For structures, use
list_structure_templates(),read_structure_template(),write_structure_template(),write_structure_template_value(),export_region_to_template(), andplace_template_to_region(). - For previews, use
render_map_preview(),render_slice_preview(), andrender_template_preview(). - For backups, use
create_backup(),list_backups(), andrestore_backup_manifest().
- Start with
-
Respect the
mc-worldsafety boundary.- Do not use RCON, sockets, online player queries, or server start/stop controls.
- Read tools may run while the server is online.
- Write tools require the server to be offline and will reject writes while server or unknown
java/javawprocesses are running. Recognized Minecraft client Java processes are ignored. - World writes are supported only for Java Anvil
DataVersion3465. - Every write creates a backup under
backup/mc_world_mcp/<timestamp>/withmanifest.json.
-
Use source worlds for real datapack, mod, or plugin worldgen.
mc-worlddoes not execute biome modifiers, jigsaw placement, datapack worldgen, mod worldgen, or plugin worldgen.list_generation_interfaces()exposes the open datapack, mod jar, and plugin jar generation inputs visible to the server.- Generate chunks in Minecraft/Arclight first, then stop the server.
- Select the target world with
MC_WORLD_NAME, for exampleMC_WORLD_NAME=world. - Use
worldgen_source_plan("world_regen_source"),list_local_worlds(),simulate_worldgen_generation(...), andcompare_world_chunks(...)before importing. - Use
import_chunks_from_world("world_regen_source", chunks, confirm=true)only after confirming the source and target are different worlds.
-
Recommended diagnosis workflows.
- Datapack load issue:
validate_datapacks()->worldgen_report()->analyze_latest_log()->search_datapack_files()->read_datapack_file(). - Structure generation issue:
list_generation_interfaces()->worldgen_report()->list_worldgen_resources(type="worldgen/structure")->validate_worldgen_references()->simulate_worldgen_generation(...)->read_level_dat("Data.WorldGenSettings")->grep_server_log("structure"). - Map visual check:
scan_world_coverage()->render_map_preview(..., "top")->render_map_preview(..., "ocean_floor")->inspect_chunk()orsummarize_chunk_palette(). - Offline edit:
check_offline_safety()-> create or rely on automatic backup -> perform one focused write -> render or inspect the affected area.
- Datapack load issue:
Current Server Workflow
For the current Arclight 1.20.1 server workspace, server.properties uses
level-name=world_regen_source. With the README MCP config above, all world
tools automatically target that active world instead of the default world/.
This MCP still does not execute Minecraft worldgen. Datapack biome modifiers, jigsaw structures, mod structures, plugin-provided generation, coral placement, and sand dunes must be generated by Minecraft/Arclight in a source world first. The MCP can then inspect that generated source world offline, simulate the result from the generated files, and copy selected generated chunks into the active target world.
For import work, launch the MCP with the target world selected, for example
MC_WORLD_NAME=world, and pass the generated source world as
source_world_name="world_regen_source". The source and target worlds must be
different local directories.
Useful checks:
worldgen_report()summarizes datapacks, worldgen resources, validation findings, and log-derived resource issues.list_generation_interfaces()summarizes datapack resources plus mod/plugin jar generation interfaces and metadata.validate_worldgen_references()finds common missing same-namespace worldgen and structure references.list_local_worlds()lists source and target world directories under the server root.worldgen_source_plan("world_regen_source")explains the safe source-world generation/import workflow.simulate_worldgen_generation("world_regen_source", min_cx, min_cz, max_cx, max_cz)treats server-generated source chunks as a simulation sample, returns success/completeness signals, Cython acceleration status, block/height summaries, and preview PNG paths.compare_world_chunks("world_regen_source", min_cx, min_cz, max_cx, max_cz)shows which generated source chunks exist and which target chunks would be overwritten.import_chunks_from_world("world_regen_source", [{"cx": 0, "cz": 0}], confirm=true)copies terrain, entity, and POI chunk records from an already-generated source world into the active world.write_chunk_nbt_value(cx, cz, path, snbt_value)edits one chunk NBT path while offline.add_block_entity(x, y, z, block_state, block_entity_snbt)places a block and writes its block entity NBT.add_entity(entity_snbt)appends an entity to an existing external entity chunk selected by itsPos.
Offline visual checks:
render_map_preview(x1, z1, x2, z2, "surface")renders a top-down PNG.y_modealso acceptstop,ocean_floor,seafloor, or an integer Y level such as"26". Previews can render up to 1,048,576 output pixels; passsample=2or higher for faster downsampled overviews of larger areas.render_slice_preview("x", fixed, min_z, max_z, min_y, max_y)renders a vertical slice.render_template_preview(template_path)renders a structure.nbtprojection.
Preview tools are read-only against the world data and write PNG files under
backup/mc_world_mcp/previews/<timestamp>/.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。