restart_server
Restart the Kiln MCP server process to apply plugin updates, environment changes, or code edits without restarting the MCP client. Optionally strips stale printer environment variables to prevent config shadowing.
Instructions
Restart the Kiln MCP server process.
Replaces the current process with a fresh instance using
``os.execve``. The MCP client (Claude Code, etc.) should detect
the connection drop and automatically reconnect.
WHAT A RESTART REFRESHES depends on how this server was launched,
and the result says which happened. A launcher script that
exported ``KILN_SERVE_WRAPPER`` is re-entered whole, so whatever
that script does before serving — syncing code, healing installs —
runs again. Without it the restart re-execs ``python -m kiln
serve`` in place: a fresh process over however this interpreter
resolves ``kiln``, which picks up edits to those files but runs no
launcher logic. (Measured 2026-08-19: an operator launcher synced
two runtime clones on every start, and a restart through this tool
silently skipped the sync — the served code was two revisions
stale while the restart reported success.)
Use after installing or updating kiln-pro plugins, changing
environment variables, or modifying server code — avoids the
need to fully restart the MCP client application.
:param clean_env: When ``True`` (default), strips ``KILN_PRINTER_*``
environment variables from the child process if
``~/.kiln/config.yaml`` has a printer configured. This defeats
the "ghost env" footgun where a stale ``KILN_PRINTER_API_KEY``
inherited from a past shell session silently shadows config.yaml
edits for the lifetime of the MCP parent process. Without this,
every edit to config.yaml looks like it does nothing and the
printer rejects MQTT auth with no hint why. Set to ``False`` to
preserve the full env (useful for CI or pure env-driven workflows
where config.yaml is absent or deliberately overridden).
:returns: Confirmation that the restart is imminent, plus the list
of env vars that were stripped (for debugging transparency).
The connection will drop within ~0.5 seconds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clean_env | No |