MCP server for Pyxel, a retro game engine for Python. Provides headless tools to observe Pyxel programs.
Project description
pyxel-mcp
An MCP server for observing programs built with Pyxel. It runs trusted local scripts headlessly and returns structured state, pixels, assets, audio, and frame differences.
The server deliberately reports facts rather than a universal quality score. The agent using it chooses the checks that matter for the game.
Install
With Claude Code:
claude mcp add pyxel -- uvx pyxel-mcp
For another MCP client, run uvx pyxel-mcp install or add:
{
"mcpServers": {
"pyxel": {
"command": "uvx",
"args": ["pyxel-mcp"]
}
}
}
Restart the client after changing its configuration. The server writes this diagnostic to stderr:
[pyxel-mcp] starting - 8 tools
Python 3.11+ is required, and Pyxel >= 2.9.6 is installed as a dependency. Script tools execute local Python in subprocesses to isolate Pyxel state, but they do not sandbox untrusted code. See SECURITY.md.
Tools
Every script argument is a file path, not Python source.
| Tool | Returns |
|---|---|
validate |
Syntax errors and recognizable Pyxel code patterns. |
run |
Headless frames, scheduled input, logs, and state, screen_image, screen_grid, or video snapshots. |
pyxel_info |
Installed versions, paths, examples, and resource URIs. |
read_palette |
Palette colors and image-bank indices in use. |
read_image |
Image-bank pixels and an optional PNG render. |
read_tilemap |
Tile coordinates, source bank, usage counts, bounds, and an optional render. |
read_audio |
A rendered sound or music WAV plus measurable audio data. |
diff_frames |
Pixel differences between two PNG files. |
All tools declare input and output schemas. Every result includes ok and errors.
Example
Capture state and the screen when a condition first becomes true:
{
"script": "/absolute/path/game.py",
"frames": 600,
"until": "score >= 1",
"snapshots": [
{"kind": "state", "frame": "end", "attrs": ["score", "player.x"]},
{"kind": "screen_image", "frame": "end", "output": "/tmp/goal.png"}
]
}
Use absolute artifact paths. Read log even when ok is true, and inspect captured images directly when appearance matters.
Resources
pyxel://run-snapshots-schema— completerun.snapshotsgrammar.pyxel://validation-patterns— categories reported byvalidate.pyxel://palette/default— default palette table.pyxel://examples/{name}— source for an example bundled with the installed Pyxel package; discover names withpyxel_info.
Full game-building guidance lives in the separate pyxel-skill project; this package contains only the MCP server.
Update
uvx caches packages. Force a refresh with:
uvx --refresh-package pyxel-mcp pyxel-mcp install
Troubleshooting
- If tools do not appear, look for the
starting - 8 toolsdiagnostic and restart the client. - If
runfails, inspecterrors,exit_status, andlog. - If a validation category is unfamiliar, read
pyxel://validation-patterns.
MCP Registry
mcp-name: io.github.kitao/pyxel-mcp
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyxel_mcp-1.2.0.tar.gz.
File metadata
- Download URL: pyxel_mcp-1.2.0.tar.gz
- Upload date:
- Size: 88.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d51d082e6787a09dcded63f2ad3e79db16e884e69f5352573e5ad6803956a72
|
|
| MD5 |
249dbe44667a9b6d5613b07c09750441
|
|
| BLAKE2b-256 |
5983229f453b514323c76d9fe4a23cb65619911d957f46a4a8c61ca5e8484b57
|
File details
Details for the file pyxel_mcp-1.2.0-py3-none-any.whl.
File metadata
- Download URL: pyxel_mcp-1.2.0-py3-none-any.whl
- Upload date:
- Size: 66.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60fc041a8c03aefcc2d3a7911d816a385d366802bb96c4985c292b6f3e8a9f1a
|
|
| MD5 |
0a11f1364ff421f77894982108c5f929
|
|
| BLAKE2b-256 |
e5bd1e795b2977d2ee25b6854dca24bfe3923f10ce3527075ac646bab823ef91
|