
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
iterminator-mcp
Advanced tools
MCP server for iTerm2 terminal automation. Enables AI assistants to open terminals, execute commands, read output, and interact with TUI applications through keyboard input. Supports VS Code and other Electron-based editors.
A powerful Model Context Protocol (MCP) server that puppeteers iTerm2 terminals. iTerminator enables AI assistants to fully control iTerm2 terminals - executing commands, interacting with TUI applications, and handling complex terminal workflows through the Model Context Protocol.
For full changelog, see CHANGELOG.md
npm install -g iterminator-mcp
git clone https://github.com/oetiker/iterminator-mcp.git
cd iterminator-mcp
npm install
npm link
The easiest way to add this server to Claude Code:
claude mcp add iterminator-mcp npx iterminator-mcp
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"iterminator": {
"command": "npx",
"args": ["iterminator-mcp"]
}
}
}
For Cursor IDE, add to ~/.cursor/mcp.json:
{
"mcpServers": {
"iterminator": {
"command": "npx",
"args": ["iterminator-mcp"]
}
}
}
iterminator-openOpens a new iTerm2 terminal window.
Returns: Terminal ID for subsequent operations
Example Response:
{
"terminalId": "iterm-12345-1"
}
iterminator-typeSend text and keystrokes to a terminal. This is the universal input method that replaces the old execute-command, send-keys, and clear-terminal tools.
Parameters:
terminalId (string, required): ID of the terminalinput (string | number | object | array): Input to send, can be:
"ls -la")32 for space, 169 for ©){key: 'name'} (e.g., {key: "enter"})Supported Special Keys:
tab, shift-tab, enter, return, escape, esc, backspace, deleteup, down, left, righthome, end, pageup, pagedownctrl-a through ctrl-zf1 through f12Examples:
// Simple command execution
{
"terminalId": "iterm-12345-1",
"input": ["ls -la", {"key": "enter"}]
}
// Navigate in TUI
{
"terminalId": "iterm-12345-1",
"input": [{"key": "up"}, {"key": "up"}, {"key": "enter"}]
}
// Complex typing with special characters
{
"terminalId": "iterm-12345-1",
"input": ["Hello", 32, "world", {"key": "backspace"}, "!", 169]
}
// Clear terminal
{
"terminalId": "iterm-12345-1",
"input": {"key": "ctrl-l"}
}
iterminator-readReads output from a terminal session. Can read either the visible viewport or the entire scrollback buffer.
Parameters:
terminalId (string, required): ID of the terminallines (number, optional): Number of lines to read from the bottomvisible_only (boolean, optional): If true, returns only what's visible on screen (viewport). If false or omitted, returns the entire scrollback buffer. Essential for TUI debugging.Examples:
// Read entire scrollback (default)
{
"terminalId": "iterm-12345-1"
}
// Read only visible screen (for TUI debugging)
{
"terminalId": "iterm-12345-1",
"visible_only": true
}
// Read last 10 lines from scrollback
{
"terminalId": "iterm-12345-1",
"lines": 10
}
iterminator-closeCloses the iTerm2 window associated with the terminal ID.
Parameters:
terminalId (string, required): ID of the terminaliterminator-listLists all currently open iTerm2 terminal sessions.
Returns: List of active terminal IDs and iTerm status
// Open a new terminal
const terminal = await use_mcp_tool("iterminator", "iterminator-open");
// Returns: { terminalId: "iterm-12345-1" }
// Execute a command
await use_mcp_tool("iterminator", "iterminator-type", {
terminalId: "iterm-12345-1",
input: ["ls -la", {key: "enter"}]
});
// Read the output
const output = await use_mcp_tool("iterminator", "iterminator-read", {
terminalId: "iterm-12345-1"
});
// Clear the terminal
await use_mcp_tool("iterminator", "iterminator-type", {
terminalId: "iterm-12345-1",
input: {key: "ctrl-l"}
});
// Close when done
await use_mcp_tool("iterminator", "iterminator-close", {
terminalId: "iterm-12345-1"
});
// Open terminal and run a TUI app
const terminal = await use_mcp_tool("iterminator", "iterminator-open");
await use_mcp_tool("iterminator", "iterminator-type", {
terminalId: "iterm-12345-1",
input: ["vim test.txt", {key: "enter"}]
});
// Navigate and edit
await use_mcp_tool("iterminator", "iterminator-type", {
terminalId: "iterm-12345-1",
input: [
"i", // Enter insert mode
"Hello, World!", // Type text
{key: "escape"}, // Exit insert mode
":wq", // Save and quit command
{key: "enter"} // Execute command
]
});
// Read the visible TUI state (not scrollback)
const tuiState = await use_mcp_tool("iterminator", "iterminator-read", {
terminalId: "iterm-12345-1",
visible_only: true // Only get what's on screen for TUI debugging
});
// Run sudo command
await use_mcp_tool("iterminator", "iterminator-type", {
terminalId: "iterm-12345-1",
input: ["sudo apt update", {key: "enter"}]
});
// Type password (won't be visible)
await use_mcp_tool("iterminator", "iterminator-type", {
terminalId: "iterm-12345-1",
input: ["mypassword", {key: "enter"}]
});
// Type text with special characters using ASCII codes
await use_mcp_tool("iterminator", "iterminator-type", {
terminalId: "iterm-12345-1",
input: [
"Copyright ", 169, // © symbol
" 2024", 32, // space
"My Company", 8482 // ™ symbol
]
});
iTerm2 not responding: Ensure iTerm2 is installed and accessible. The server uses AppleScript to control iTerm2.
Permission denied errors: macOS may require permissions for terminal automation. Check System Preferences > Security & Privacy > Privacy > Automation.
Commands not executing: Remember to add {key: "enter"} after commands to execute them.
VS Code focus issues: The server properly handles VS Code and other Electron-based editors. Ensure you're using the latest version.
Special characters: Use ASCII codes (0-255) for special characters that can't be typed normally.
To run with debug output:
DEBUG=* npx iterminator-mcp
If you're upgrading from an older version, here's how to update your code:
| Old API | New API |
|---|---|
execute-command with command: "ls" | iterminator-type with input: ["ls", {key: "enter"}] |
send-keys with keys: "tab" | iterminator-type with input: {key: "tab"} |
send-keys with text: "hello" | iterminator-type with input: "hello" |
clear-terminal | iterminator-type with input: {key: "ctrl-l"} |
See CHANGELOG.md for a list of changes and upcoming features.
Contributions are welcome! Please feel free to submit a Pull Request.
npm installnpm link then configure your MCP clientnpm test
ISC
Tobi Oetiker
FAQs
MCP server for iTerm2 terminal automation. Enables AI assistants to open terminals, execute commands, read output, and interact with TUI applications through keyboard input. Supports VS Code and other Electron-based editors.
We found that iterminator-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.