tmux_kill_session
Terminate a tmux session and all its windows and panes by specifying the session name. Use this tool to clean up unused terminal sessions in the Tmux MCP Server environment.
Instructions
Kill/terminate a tmux session and all its windows and panes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_name | Yes | Name of the tmux session to kill |
Implementation Reference
- src/index.js:362-379 (handler)Executes the tmux_kill_session tool by running the tmux kill-session command asynchronously and returns a success message or throws an error.async killSession(args) { const { session_name } = args; try { await execAsync(`tmux kill-session -t "${session_name}"`); return { content: [ { type: "text", text: `Killed tmux session: ${session_name}`, }, ], }; } catch (error) { throw new Error(`Failed to kill session: ${error.message}`); } }
- src/index.js:118-127 (schema)Input schema for the tmux_kill_session tool, requiring a session_name string parameter.inputSchema: { type: "object", properties: { session_name: { type: "string", description: "Name of the tmux session to kill", }, }, required: ["session_name"], },
- src/index.js:114-128 (registration)Registers the tmux_kill_session tool in the ListTools response, including name, description, and input schema.{ name: "tmux_kill_session", description: "Kill/terminate a tmux session and all its windows and panes.", inputSchema: { type: "object", properties: { session_name: { type: "string", description: "Name of the tmux session to kill", }, }, required: ["session_name"], }, },
- src/index.js:199-200 (registration)Dispatches to the killSession handler in the CallToolRequest switch statement.case "tmux_kill_session": return await this.killSession(args);