MCP server#

pyxel-config-mcp                  # runs over stdio
pyxel-config mcp                  # the same server, via the CLI
pyxel-config-mcp --allow-deep     # also let deep=true run pyxel.load()

The deep check is off unless the server is started with --allow-deep, because loading a config runs part of it and an assistant can pass in a config from anywhere; see The deep check.

Point any MCP-compatible client at that command. The eight MCP tools listed under “What it exposes” become callable by the model, so an assistant can check a config against the real schema instead of guessing, repair it, discover the valid models, and retrieve the real tutorial passages to cite.

The server imports cleanly on both the 1.x (FastMCP) and 2.x (MCPServer) line of the MCP SDK.

Building and fixing configs#

Two tools turn the server from a read-only checker into an active assistant:

  • list_pyxel_models(stage=None) enumerates every valid model function, optionally filtered to one pipeline stage. It reads the same schema the validator does, so the list is always the real, current set — an assistant can discover then build instead of guessing a name and validating it. Each entry carries the full func: path ready to drop into a config.

  • fix_pyxel_config(config) applies the func diagnostics automatically. It renames a typo’d model to its nearest valid match, moves a valid-but-misplaced model into its owning stage, and returns the corrected config alongside a structured change log (changes), anything it could not fix (unresolved), and the diagnostics that remain after the repair (remaining_diagnostics). It fixes func names only — it never invents required arguments, so a rename onto a model with required args will still surface those in remaining_diagnostics. The input is never mutated; a corrected copy is returned.