Control iTerm2 Terminals with AI
MCP server that connects AI assistants to iTerm2 terminals on macOS, enabling command execution, output reading, and session management through the Model
Why it matters
Integrate AI assistants with your iTerm2 terminal on macOS. This asset allows AI to programmatically create, manage, and interact with terminal sessions, enabling automated command execution and output retrieval.
Outcomes
What it gets done
Open new iTerm2 terminal instances
Execute commands within specific terminals
Read and process terminal output
List and manage active terminal sessions
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-iterm-mcp-server | bash Capabilities
Tools your agent gets
Open a new terminal instance
Execute a command in a specific terminal
Read output from a specific terminal
Close a specific terminal
Display a list of all active terminals and their information
Overview
iTerm MCP Server
What it does
The iTerm MCP Server bridges AI assistants and iTerm2 terminal sessions through the Model Context Protocol. It exposes five core tools that let AI clients create terminal instances, execute shell commands, read output, list active sessions, and close terminals-all programmatically through a standardized interface.
How it connects
Use this connector when you need an AI assistant to interact with iTerm2 terminals on macOS. The server provides tools for opening terminals, executing commands, reading terminal output, listing active terminals, and closing terminals. This server requires macOS because iTerm2 is macOS-only. It also requires Node.js 14.x or higher.
Source README
ITerm MCP Server
A Model Context Protocol (MCP) server implementation for iTerm2 terminal integration. This server allows AI assistants to interact with iTerm2 terminals through the Model Context Protocol.
Features
- Create and manage iTerm2 terminal sessions
- Execute commands in terminals
- Read terminal output
- List active terminals
- Close terminals
Requirements
- Node.js >= 14.x
- iTerm2
- macOS (since iTerm2 is macOS-only)
Configuration
Standard Configuration
The server uses the standard MCP configuration options. No additional configuration is required.
Cursor Configuration
To use this server with Cursor, add the following configuration to your ~/.cursor/mcp.json file:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["iterm_mcp_server"]
}
}
}
Tools
open_terminal: Open a new terminal instanceexecute_command: Execute a command in a specific terminalread_output: Read the output from a specific terminalclose_terminal: Close a specific terminallist_terminals: List all active terminals and their information
Security Considerations
- The server validates all input using Zod schemas
- Commands are executed in isolated terminal sessions
- Proper error handling and input sanitization is implemented
Author
Rishab Koul
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.