/mcpylib:mcpylib-mcpfrom MCPyLib Skills
Installs, configures and uses mcpylib-mcp, the MCP server that exposes MCPyLib as 86 tools (blocks, players, world, entities, chat, scoreboard) for Claude Code, Claude Desktop, Cursor, VS Code, Codex and other MCP clients. Covers the uvx install, the MCPYLIB_HOST, MCPYLIB_PORT and MCPYLIB_TOKEN settings, per-client configuration, read-only mode, tool allow and deny lists, the per-call block limit, the text-layers build format, troubleshooting, and when to use MCP tools versus a Python script with the mcpylib library. Use when the user wants to connect an AI assistant or editor to a Minecraft server, mentions MCP, mcpylib-mcp, Model Context Protocol, uvx or claude mcp add, sees mcpylib tools such as get_blocks or build_from_layers, or asks whether to use tools or a script for a Minecraft task.
Ships in MCPyLib Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
MCP client --(stdio or HTTP)--> mcpylib-mcp --(TCP 65535 + token)--> MCPyLib plugin on Paper/Spigot
mcpylib-mcp (https://github.com/treeleaves30760/MCPyLib-mcp, version 0.1.0) wraps
the MCPyLib Python client as 86 typed MCP tools, three resources and two prompts. The
agent calls tools; nobody writes Python. For the underlying API and the server-side
setup, use the mcpylib skill.
/mcpylib token in the console (or in game with mcpylib.admin) and copy
the token.uvx), or use Python 3.11+ with
pip install mcpylib-mcp.uvx mcpylib-mcp --list-tools
uvx installs it from PyPI and caches it; add --refresh once to pick up a new
release, or pin one with uvx [email protected].Claude Code (options must come before the name, and another option must separate
--env from the name):
claude mcp add --env MCPYLIB_TOKEN=<token> --transport stdio mcpylib -- uvx mcpylib-mcp
Add --env MCPYLIB_HOST=<ip> for a remote server and --scope user for all projects.
Check with claude mcp list or /mcp.
| Client | Where the configuration goes |
|---|---|
| Claude Code | claude mcp add ..., or .mcp.json in the project with "MCPYLIB_TOKEN": "${MCPYLIB_TOKEN}" |
| Claude Desktop | claude_desktop_config.json (Settings > Developer > Edit Config), then restart |
| Cursor | ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project) |
| VS Code | .vscode/mcp.json with a promptString input for the token |
| Codex | [mcp_servers.mcpylib] in ~/.codex/config.toml, or codex mcp add |
Copy-ready configurations for each client, plus the HTTP transport, are in references/clients.md.
Token hygiene: put the token in an env block or environment variable, never in
args (command lines are visible to other users) and never in a committed file. Use
${MCPYLIB_TOKEN} in shared .mcp.json files.
Environment variables; flags of the same meaning take precedence.
| Variable | Default | Meaning |
|---|---|---|
MCPYLIB_TOKEN | required | Plugin token |
MCPYLIB_HOST / MCPYLIB_PORT | localhost / 65535 | Where the plugin listens (--mc-host, --mc-port) |
MCPYLIB_TIMEOUT | 30 | Seconds to wait for each plugin reply |
MCPYLIB_MAX_BLOCKS | 100000 | Most blocks one tool call may read or change |
MCPYLIB_READ_ONLY | false | Register only the 21 read-only tools |
MCPYLIB_ALLOWED_TOOLS / MCPYLIB_DENIED_TOOLS | all / none | Names, globs (get_*) or groups (group:blocks); the denylist wins |
MCPYLIB_TRANSPORT | stdio | stdio or http (streamable HTTP on MCPYLIB_HTTP_HOST:MCPYLIB_HTTP_PORT/mcp, default 127.0.0.1:8000) |
MCPYLIB_LOG_LEVEL | INFO | Logs go to stderr; DEBUG shows every plugin call |
Good presets:
MCPYLIB_READ_ONLY=true.MCPYLIB_ALLOWED_TOOLS="group:blocks get_players get_player_position".MCPYLIB_DENIED_TOOLS=run_command,kill_entities. run_command runs
any console command and bypasses the block limit.get_players, get_player_position, or the minecraft://server/status
resource. All block, world and particle tools act on the main overworld; Y is
-64..319.get_blocks (text layers) or get_height_map over the
site. Report what would be replaced and get confirmation before destructive
tools such as fill_region with air, kill_entities or clear_inventory.build_from_layers for designed structures, edit_blocks for 3D
arrays, fill_region for one material, set_block for a few blocks with states or
sign text. Then verify with get_blocks.clone_region.The layers format used by get_blocks and build_from_layers:
palette maps single characters to blocks, or to
{"block": ..., "block_state": {...}}.layers run bottom to top. Each layer is a list of rows from north to south, and
each row a string read west to east.. is air and a space leaves the existing block unchanged.{"x": 100, "y": 64, "z": -20,
"palette": {"#": "stone_bricks", "G": "glass"},
"layers": [["###", "#.#", "###"], ["#G#", "G.G", "#G#"]]}
Other habits:
give_item or
summon_entity may even have run twice. Check before repeating it.build_structure and survey_area prompts and the minecraft://guide/building
resource give a ready-made workflow.| Task | Use | Why |
|---|---|---|
| Questions and inspection (who is online, what is here, find flat ground) | MCP | One call, no code |
| One-off actions (time, weather, give, teleport, effects) | MCP | Instant, approvable |
| Small or medium designed builds (up to about 100,000 blocks) | MCP build_from_layers | Agent designs the layers directly |
| Large or procedural builds (spheres, terrain, pixel art from an image) | Python, mcpylib-building | Math in code, chunked batches, dry run and undo files |
| Anything that loops or reacts over time (minigames, timers, polling) | Python, mcpylib-minigames | MCP calls are request and response; a loop needs a running program |
| Repeatable jobs, sharing, version control | Python | Re-run the same script |
| Users without a terminal (Claude Desktop chat) | MCP | Nothing to install beyond the server entry |
They combine well: survey with MCP tools, then write a script for the heavy part. A
script and the MCP server can use the same token; each open connection takes one of
the plugin's server.max-connections slots (default 10).
references/tools.md lists every tool with the MCPyLib method it calls, which helps when moving a task from MCP tools to a script.
| Symptom | Fix |
|---|---|
no MCPyLib token configured | Set MCPYLIB_TOKEN in the client's env block |
Authentication failed ... rejected the token | Token wrong or regenerated: run /mcpylib token and update the config |
Cannot reach the MCPyLib plugin at host:port | Server down, plugin not loaded, wrong host or port, or a firewall |
Timed out after 30s ... | Use smaller regions, or raise MCPYLIB_TIMEOUT |
... more than the per-call limit ... | Split the region; raise MCPYLIB_MAX_BLOCKS only on purpose |
| No tools in the client | Run the configured command with --list-tools in a terminal; check allow and deny lists; Claude Desktop may need the full path to uvx (spawn uvx ENOENT) |
uvx cannot fetch the repository | Check the URL and network, or clone the repository and run uv run mcpylib-mcp |
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
4 skills in this plugin
/mcpylibControls a Minecraft Paper/Spigot server from Python with the MCPyLib library and its server plugin. Covers setup checks (plugin, token, .env), connecting, coordinates and the -64..319 build height, block ids with block_state and NBT, choosing between setblock, fill, edit bulk arrays, clone and getblocks, batching for speed, error handling, and safe read-before-write editing, plus players, entities, chat, world settings and the raw TCP JSON protocol for other languages. Use when the user mentions MCPyLib or mcpylib, wants a script that places, reads or changes blocks, players, entities or settings on a Minecraft server, or hits MCPyLib connection, token or plugin errors./mcpylib-buildingProcedural Minecraft building with MCPyLib in pure Python (no numpy). Generates spheres, domes, cylinders, cones, pyramids, tori, houses, towers, pixel art from images and heightmap or noise terrain as rectangular block arrays, then places them with edit() in chunk-sized batches with a dry-run plan, overwrite protection and an undo file. Use when the user asks to build, generate or draw something in a Minecraft world with code, such as shapes, buildings, statues, image or pixel art, landscapes, mazes or other large structures, or wants faster bulk placement than setblock loops. Builds on the mcpylib skill for connection and API details.npx claudepluginhub treeleaves30760/mcpylib-skills --plugin mcpylib