# kill_session

Source: https://libtmux.org/en/py/stable/mcp/tools/kill_session/

> Kill a tmux session.

tool MCPstable

MCP is in development

Server behavior and tool contracts may change. Tool availability depends on the server configuration.

* **kill_session**( [session_id](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session.input%2Fproperties%2Fsession_id)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), [session_name](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session.input%2Fproperties%2Fsession_name)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), [socket_name](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session.input%2Fproperties%2Fsocket_name)?: [string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"), )

  tool \[[source](https://github.com/tmux-python/libtmux-mcp/blob/4daddc0dfca96c43bf521d818bf91564e1434760/src/libtmux_mcp/tools/session_tools.py#L374)][¶](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session)

  Kill a tmux session.

  Destroys the session and all its windows and panes. Use [kill_window](https://libtmux.org/en/py/stable/mcp/tools/kill_window/) to remove a single window instead. Self-kill protection prevents killing the session containing this MCP process.

  * MCP request method

    `tools/call` Send `kill_session` as the tool name, with the arguments below.

  ## Arguments[#](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session.parameters)

  * **[`session_id`](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session.input%2Fproperties%2Fsession_id)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Session ID (e.g. ‘$1’) to look up.

  * **[`session_name`](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session.input%2Fproperties%2Fsession_name)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    Session name to look up.

  * **[`socket_name`](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session.input%2Fproperties%2Fsocket_name)**? = `null` ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)") | [null](https://json-schema.org/understanding-json-schema/reference/null "null (JSON Schema)"))

    tmux socket name. Defaults to LIBTMUX_SOCKET env var.

  No other arguments are accepted.

  ## Result[#](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session.result)

  Returns [object](https://json-schema.org/understanding-json-schema/reference/object "object (JSON Schema)")

  * **[`result`](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session.output%2Fproperties%2Fresult)** ([string](https://json-schema.org/understanding-json-schema/reference/string "string (JSON Schema)"))

  ## Annotations[#](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session.annotations)

  * [`destructiveHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#destructiveHint)

    `true`

  * [`idempotentHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#idempotentHint)

    `false`

  * [`openWorldHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#openWorldHint)

    `true`

  * [`readOnlyHint`](https://libtmux.org/en/py/stable/mcp/reference/glossary/#readOnlyHint)

    `false`

  ## Protocol data[#](https://libtmux.org/en/py/stable/mcp/tools/kill_session/#mcp.tool.kill_session.schemas)

  Use the complete advertised contract for validation and client integration.

  Input schema

  ```json
  {
    "additionalProperties": false,
    "properties": {
      "session_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Session ID (e.g. '$1') to look up."
      },
      "session_name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Session name to look up."
      },
      "socket_name": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "tmux socket name. Defaults to LIBTMUX_SOCKET env var."
      }
    },
    "type": "object"
  }
  ```

  Output schema

  ```json
  {
    "properties": {
      "result": {
        "type": "string"
      }
    },
    "required": [
      "result"
    ],
    "type": "object",
    "x-fastmcp-wrap-result": true
  }
  ```
