Get the FREE Ultimate OpenClaw Setup Guide →

iTerm

MCP server from rishabkoul/iTerm-MCP-Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio rishabkoul-iterm-mcp-server npx iterm_mcp_server

How to use

This MCP server provides an integration layer for iTerm2 on macOS, enabling AI assistants to create and manage iTerm2 terminal sessions, run commands inside those sessions, read their output, and list or close active terminals. The server exposes a set of tools through the MCP interface: open_terminal to start a new iTerm2 session, execute_command to run a command inside a specific terminal, read_output to fetch terminal text, list_terminals to enumerate all active terminals, and close_terminal to terminate a session. To use it, start the MCP server (via the configured command) and then issue MCP requests targeting the terminal tool set. The server validates inputs with Zod schemas and executes commands within isolated terminal sessions to maintain safety and reliability.

How to install

Prerequisites:

  • Node.js 14.x or newer installed on macOS
  • iTerm2 installed on macOS
  • macOS environment (iTerm2 is macOS-only)

Installation steps:

  1. Ensure Node.js is installed. If needed, install via a package manager or from https://nodejs.org.

  2. Install or update the MCP server package that provides iterm_mcp_server (via npm or npx as per the configuration).

  3. Install iTerm2 on your Mac if it is not already installed.

  4. Start the MCP server using the configured command. For example:

    npm or npx-based start (as defined by your environment). If following the Cursor example, the server can be started via:

    npx iterm_mcp_server

  5. Once the server is running, you can begin sending MCP requests to manage iTerm2 terminals.

Note: If you plan to integrate with Cursor, ensure your Cursor config points to the mcpServers.terminal entry provided in the mcp_config section above.

Additional notes

Tips and considerations:

  • The server relies on iTerm2 being available on macOS; it will manage terminal sessions within iTerm2 windows or tabs.
  • If you encounter permissions or macOS privacy prompts when creating or controlling iTerm2 windows, grant the necessary accessibility permissions to the terminal or the Node.js process.
  • Use list_terminals to discover terminal IDs before issuing commands with execute_command or read_output.
  • Ensure proper input validation is in place in your MCP client to avoid injecting unsafe commands; the server uses Zod schemas for validation.
  • If running behind a proxy or in a restricted environment, verify that the MCP server can communicate with iTerm2 and that no sandboxing policies block terminal control.
  • For debugging, check the MCP server logs for errors related to terminal creation, command execution, or output capture.

Related MCP Servers

Sponsor this space

Reach thousands of developers