tmux-mcp-server

tmux-mcp-server

MCP server for tmux enabling AI assistants to manage tmux sessions, windows, panes, layouts, and execute commands securely through natural language. Supports multiple profiles including read-only and full tool sets.

Category
访问服务器

README

tmux-mcp

Model Context Protocol (MCP) server for tmux, written in Python and distributed via uvx.

Exposes 37 granular tools covering sessions, windows, panes, layouts, status inspection, and secure command execution using event-driven pipe-pane + wait-for primitives.


Key Features & Security Design

  • No Shell Injection Vulnerabilities: All tmux interactions execute strictly via argv parameter arrays without shell=True.
  • Event-Driven Execution Engine: Uses pipe-pane streams and tmux wait-for events instead of polling or scrollback regex. Captures exact return codes and complete output streams (>50,000 lines tested without truncation).
  • Interactive App Guard: Automatically blocks non-shell panes (e.g. vim, htop, python) from accidental command injection, prompting the caller to use keypress tools (send_keys) instead.
  • Strict Protocol & Output Purity: Zero stray stdout prints to prevent corrupting the MCP stdio JSON-RPC transport stream (logging strictly routed to sys.stderr).
  • Portable Flat Tool Schemas: Compatible with all MCP clients (Claude Code, Claude Desktop, OpenCode, Cursor, Windsurf, Zed, Continue, VS Code) by enforcing flat JSON schemas without unsupported $ref/$defs/anyOf constructs.

Quick Start

Run instantly without installing Python dependencies using uvx:

# Run with standard profile (default 22 tools)
uvx tmux-mcp-server

# Run with full profile (all 37 tools including destructive actions)
uvx tmux-mcp-server --tools=full

# Run in read-only mode (13 read tools)
uvx tmux-mcp-server --read-only

Tool Profiles

Profile Tools Count Description
standard (default) 22 All read, interact, split, resize, layout, and command execution tools (excludes destructive kill-* tools).
full 37 Complete set of 37 tools, including destructive operations (kill_session, kill_window, kill_pane).
read 13 Read-only inspection tools. Safe for unrestricted agent usage.
Custom N Comma-separated list of tool names (e.g. --tools=list_sessions,read_pane,run_command).

Client Configuration Examples

Watch the package name. This project is tmux-mcp-server. Do not configure "args": ["tmux-mcp"] — tmux-mcp is an unrelated, already-published PyPI package, and uvx would silently download and run that one instead.

Working on the code? Point the client at your checkout so edits take effect immediately:

"args": ["run", "--directory", "/absolute/path/to/tmux-mcp-server", "tmux-mcp-server"]

with "command": "uv". Note that uvx --from <path> caches the built wheel per version, so local edits are not picked up until you bump version in pyproject.toml — uv run --directory has no such caching.

1. Claude Code

Add to ~/.claude.json or .claude.json:

{
  "mcpServers": {
    "tmux": {
      "command": "uvx",
      "args": ["tmux-mcp-server"]
    }
  }
}

2. Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "tmux": {
      "command": "uvx",
      "args": ["tmux-mcp-server"]
    }
  }
}

3. OpenCode

Add to ~/.config/opencode/opencode.json (or project .opencode/mcp.json):

{
  "mcpServers": {
    "tmux": {
      "command": "uvx",
      "args": ["tmux-mcp-server"]
    }
  }
}

4. Cursor

Add to Settings -> Features -> MCP:

  • Name: tmux
  • Type: command
  • Command: uvx tmux-mcp-server

5. Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "tmux": {
      "command": "uvx",
      "args": ["tmux-mcp-server"]
    }
  }
}

6. Zed

Add to ~/.config/zed/settings.json:

{
  "context_servers": {
    "tmux": {
      "command": {
        "path": "uvx",
        "args": ["tmux-mcp-server"]
      }
    }
  }
}

7. Continue

Add to ~/.continue/config.json:

{
  "mcpServers": [
    {
      "name": "tmux",
      "command": "uvx",
      "args": ["tmux-mcp-server"]
    }
  ]
}

8. VS Code (Roo Code / Cline)

Add to .vscode/mcp.json:

{
  "mcpServers": {
    "tmux": {
      "command": "uvx",
      "args": ["tmux-mcp-server"]
    }
  }
}

9. Generic Stdio Client

Any MCP-compliant client can launch via stdio:

{
  "command": "uvx",
  "args": ["tmux-mcp-server"]
}

Tool Reference (37 Tools)

Sessions (6)

  • list_sessions
  • get_session
  • create_session
  • rename_session
  • switch_client
  • kill_session ⚠️

Windows (6)

  • list_windows
  • create_window
  • rename_window
  • select_window
  • move_window
  • kill_window ⚠️

Panes — Read & Interact (7)

  • list_panes
  • get_pane_info
  • read_pane
  • search_pane
  • send_keys
  • send_special_key
  • clear_pane

Panes — Layout & Sizing (9)

  • split_pane
  • select_pane
  • resize_pane
  • zoom_pane
  • swap_panes
  • move_pane
  • break_pane
  • set_layout
  • kill_pane ⚠️

Command Execution (5)

  • run_command
  • get_command_result
  • wait_command
  • list_commands
  • cancel_command

Server & Inspection (4)

  • server_info
  • list_clients
  • display_message
  • show_options

Development & Testing

Run all unit and integration tests (using an isolated test socket -L tmux-mcp-test):

uv run pytest

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选