Read Output
AI reads your terminal buffer to understand what's happening.
An MCP server that connects AI assistants to your iTerm2. Run commands, read output, manage sessions — all through conversation.
go install github.com/phpgao/term2mcp@latest
How It Works
AI assistants read your terminal output, send commands, and manage sessions — zero friction.
AI reads your terminal buffer to understand what's happening.
AI types commands just like a human — tab completion, Enter, everything.
Create tabs, split panes, activate windows — layout managed by AI.
Capture any window, tab, or session as PNG for the AI to analyze.
Runs entirely on your Mac. No network, no cloud. Stdio transport.
go install + one JSON line. That's it. Works out of the box.
16 Tools
Each tool maps directly to an iTerm2 API. AI picks the right one for the task.
list_sessionsList all windows, tabs, sessions with IDssend_textSend commands as if typed (use \n for Enter)get_bufferRead terminal screen contentactivateFocus a session, bring window to frontinject_keystrokesInject raw bytes / key sequencesclose_sessionClose a pane (with optional force)set_nameRename a session for identificationset_badgeSet overlay badge text on sessioncreate_tabNew tab or window, optional init commandsplit_paneVertical or horizontal splitfocusGet currently focused session/tab/windowget_variableRead session variable (name, pid, path...)set_variableWrite session variableget_promptLast command text, exit code, working dirlist_profilesList iTerm2 profile namesscreenshotPNG capture of window or sessionIntegration
Works with CodeBuddy Code, Claude Desktop, Continue, and any MCP-compatible client.
// ~/.codebuddy/mcp.json { "mcpServers": { "term2mcp": { "command": "term2mcp" } } }
// ~/Library/Application Support/ // Claude/claude_desktop_config.json { "mcpServers": { "term2mcp": { "command": "term2mcp" } } }
Preferences → General → Magic → Enable Python API
go install github.com/phpgao/term2mcp@latest
One JSON entry in mcp.json or Claude Desktop config.
"List my iTerm2 sessions", "Run npm test in that tab", "Read the last error"
Ecosystem