Skip to main content
Glama

restart_server

Destructive

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

NameRequiredDescriptionDefault
clean_envNoWhen ``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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.5.1
    • changedInput schema / properties / clean_env / description
      Previous value: -"Default: true."New value: +"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."
  2. Changed2 schema fields changedv1.5.0
    • removedInput schema / properties / clean_env / default
      Removed value: -true
    • addedInput schema / properties / clean_env / description
      Added value: +"Default: true."
  3. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Far exceeds the annotations (destructiveHint=true only signals mutation). It discloses that the stdio pipe and handshake survive, that the client's cached tool list goes stale until reconnect, that the exec fires ~0.5s after the return, and that a launcher wrapper is or isn't re-entered — including the failure mode where served code is stale while the restart reports success.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded correctly with the action first, then mechanism, then triggers, so an agent can stop reading early. However it runs several hundred words for a one-parameter tool, and the entire clean_env and :returns blocks duplicate the schema and restate result fields in prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description explains the meaningful return fields (keeps_connection, stripped env vars) and the timing of the exec, so an agent knows what it will observe. Given the destructive, process-replacing nature of the tool, the level of disclosure matches its complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the clean_env paragraph in the description is essentially verbatim identical to the schema's property description, so it adds no meaning beyond structured data. The rationale about the 'ghost env' shadowing config.yaml is genuinely explanatory but is duplicated in both places rather than being description-specific value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a precise verb+resource ('Restart the Kiln MCP server process') and immediately names the mechanism, os.execve, so the agent knows this is a process-level act rather than a config toggle. No sibling tool in the list does anything similar, so the action is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete triggers: after installing/updating kiln-pro plugins, changing environment variables, or modifying server code, and states the benefit (avoids restarting the whole MCP client). It does not state when a full client restart is still required, so it stops short of explicit alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools