iTerm MCP Server

iterm-mcp

A Model Context Protocol server that provides access to your iTerm session.

Features

  • Efficient Token Use: Only the visible content of the terminal is passed to the model. The model can retrieve content that's not visible if necessary.
  • Supports Long-Running Processes: iterm-mcp knows when the terminal is waiting for user input. Long-running processes are handled gracefully.
  • Interrupt When Needed: Send control characters to the terminal to interrupt processes.
  • Inspect Terminal Activity: Gives the model visibility into the current terminal content.

<a href="https://glama.ai/mcp/servers/h89lr05ty6"><img width="380" height="200" src="https://glama.ai/mcp/servers/h89lr05ty6/badge" alt="iTerm Server MCP server" /></a>

Tools

  • write_to_terminal - Writes to the active iTerm terminal, often used to run a command.
  • read_terminal_output - Reads the output from the active iTerm terminal.
  • send_control_character - Sends a control character to the active iTerm terminal.

Installation

To use with Claude Desktop, add the server config:

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

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

Installing via Smithery

To install iTerm for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install iterm-mcp --client claude

Development

Install dependencies:

yarn install

Build the server:

yarn run build

For development with auto-rebuild:

yarn run watch

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

yarn run inspector yarn debug

The Inspector will provide a URL to access debugging tools in your browser.

A
security – no known vulnerabilities (report Issue)
A
license - permissive license
A
quality - confirmed to work

This MCP server enables users to execute shell commands in the current iTerm2 session through integration with Claude Desktop, facilitating seamless command execution via the Model Context Protocol.

  1. Features
    1. Tools
      1. Installation
        1. Installing via Smithery
        2. Development
          1. Debugging