Tmux MCP MCP server

Interact with and view tmux session content.
Back to servers
Provider
Nicola Giancecchi
Release date
Mar 17, 2025
Language
TypeScript
Package
Stats
341 downloads
39 stars

This MCP server enables Claude Desktop to interact with and observe tmux terminal sessions. By integrating with tmux, AI assistants can view terminal content, execute commands, and manage tmux sessions, providing powerful terminal access capabilities to Claude.

Installation

Prerequisites

  • Node.js
  • tmux installed and running

Installation

The tmux MCP server can be installed and run using npx. No separate installation step is required as it will be started by Claude Desktop automatically.

Configuration

Adding to Claude Desktop

To add the tmux MCP server to your Claude Desktop, modify your Claude configuration:

"mcpServers": {
  "tmux": {
    "command": "npx",
    "args": ["-y", "tmux-mcp"]
  }
}

Specifying Shell Type

You can optionally specify which command-line shell you're using (defaults to bash):

"mcpServers": {
  "tmux": {
    "command": "npx",
    "args": ["-y", "tmux-mcp", "--shell-type=fish"]
  }
}

The shell type is only needed when executing commands, as it helps the MCP server properly read exit status information.

Using Tmux MCP with Claude

Once configured, Claude can interact with tmux through various tools and resources.

Available Resources

The MCP server provides these resources:

  • tmux://sessions - Lists all available tmux sessions
  • tmux://pane/{paneId} - Shows the content of a specific tmux pane
  • tmux://command/{commandId}/result - Returns results from executed commands

Available Tools

Claude can use the following tools to interact with your tmux sessions:

  • Session Management

    • list-sessions - View all active tmux sessions
    • find-session - Search for a specific tmux session by name
    • create-session - Create a new tmux session
  • Window Management

    • list-windows - View windows in a tmux session
    • create-window - Create a new window in a tmux session
  • Pane Operations

    • list-panes - View panes in a tmux window
    • capture-pane - Get the content from a tmux pane
  • Command Execution

    • execute-command - Run a command in a tmux pane
    • get-command-result - Retrieve the result of a previously executed command

Usage Examples

Claude can now interact with your terminal sessions to help you with terminal-based tasks. For example, you can ask Claude to:

  • "Show me what's in my current terminal session"
  • "Run 'ls -la' in my terminal and explain the output"
  • "Create a new tmux session for a project"
  • "Help me understand the error message in my terminal"

When you ask these types of requests, Claude will use the appropriate tools to interact with your tmux sessions.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later