restart_server
Reload the Kiln server process in place after installing plugins, changing environment variables, or editing server code, so updates take effect without restarting the MCP client.
Instructions
Restart the Kiln MCP server process.
Replaces the current process with a fresh instance using
``os.execve``. The exec keeps the stdio pipe, so the MCP client sees
no disconnect and repeats no ``initialize`` handshake; the fresh
process takes up the handshake this connection already made, so the
client's next call simply works. The client keeps the tool list it
cached when it connected: tools the new code adds reach it when it
reconnects. The result's ``keeps_connection`` says whether the
handshake was handed on.
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. (A launcher that syncs code on every start is
skipped by an in-place restart: the served code can be stale while
the restart reports success, which is why the result says which
happened.)
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 exec happens ~0.5 seconds after this returns.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "restart_server"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clean_env | No | 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). Default: true. |