Skip to main content
Glama
nickgnd

Tmux MCP Server

by nickgnd

kill-window

Terminate a tmux window by specifying its ID to remove unwanted terminal sessions and manage workspace organization.

Instructions

Kill a tmux window by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowIdYesID of the tmux window to kill

Implementation Reference

  • src/index.ts:259-284 (registration)
    Registration of the 'kill-window' MCP tool, including schema, description, and inline handler function that delegates to tmux.killWindow
    server.tool(
      "kill-window",
      "Kill a tmux window by ID",
      {
        windowId: z.string().describe("ID of the tmux window to kill")
      },
      async ({ windowId }) => {
        try {
          await tmux.killWindow(windowId);
          return {
            content: [{
              type: "text",
              text: `Window ${windowId} has been killed`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: `Error killing window: ${error}`
            }],
            isError: true
          };
        }
      }
    );
  • Helper function killWindow that executes the underlying tmux 'kill-window' command via executeTmux
    export async function killWindow(windowId: string): Promise<void> {
      await executeTmux(`kill-window -t '${windowId}'`);
    }
  • Inline handler function for the kill-window tool
    async ({ windowId }) => {
      try {
        await tmux.killWindow(windowId);
        return {
          content: [{
            type: "text",
            text: `Window ${windowId} has been killed`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: `Error killing window: ${error}`
          }],
          isError: true
        };
      }
    }
  • Input schema defining the windowId parameter for the tool
    {
      windowId: z.string().describe("ID of the tmux window to kill")
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nickgnd/tmux-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server