用于使 Claude Desktop 能够与 tmux 会话内容进行交互和查看的 Model Context Protocol 服务器。此集成允许 AI 助手读取、控制并观察您的终端会话。
观看这段短视频以了解更多信息!
</br>将此 MCP 服务器添加到您的 Claude Desktop 配置中:
"mcpServers": {
"tmux": {
"command": "npx",
"args": ["-y", "tmux-mcp"]
}
}
您可以选择指定您正在使用的命令行 shell,如果未指定,默认为 bash
"mcpServers": {
"tmux": {
"command": "npx",
"args": ["-y", "tmux-mcp", "--shell-type=fish"]
}
}
当执行命令时,MCP 服务器需要知道 shell 类型,以便正确读取其退出状态。
tmux://sessions - 列出所有 tmux 会话tmux://pane/{paneId} - 查看特定 tmux 面板的内容tmux://command/{commandId}/result - 执行命令的结果list-sessions - 列出所有活动的 tmux 会话find-session - 根据名称查找 tmux 会话list-windows - 列出 tmux 会话中的窗口list-panes - 列出 tmux 窗口中的面板capture-pane - 从 tmux 面板捕获内容create-session - 创建新的 tmux 会话create-window - 在 tmux 会话中创建新的窗口split-pane - 水平或垂直分割 tmux 面板,并可选指定大小kill-session - 根据 ID 终止 tmux 会话kill-window - 根据 ID 终止 tmux 窗口kill-pane - 根据 ID 终止 tmexecute-command - 在 tmux 面板中执行命令get-command-result - 获取已执行命令的结果