MCP server for controlling iTerm2 terminal emulator on macOS. Provides tools to manage windows, tabs, panes, sessions, and execute commands with output capture.
term2mcp defines 17 tools with consistent verb-noun naming (list_sessions, send_text, get_buffer, etc.). All tools have descriptions (avg ~100 chars, within baseline 34-392 range). Input schemas are present and typed via jsonschema struct tags. However, parameter descriptions are minimal (often 1-2 lines), output schemas are inferred from Go struct types rather than explicitly documented in tool definitions, and error handling lacks recovery guidance. No tool annotations (readOnlyHint, destructiveHint, idempotentHint) despite clear risk levels. Composition is sound, each tool has one responsibility, but descriptions could be more LLM-optimized per pattern:tool-description.
Activate (focus) a specific iTerm2 session, bringing its window and tab to the front
Close an iTerm2 session (pane). Use force=true to skip confirmation.
Create a new iTerm2 tab, optionally in an existing window. If no window_id is given, a new window is created.
Get the currently focused iTerm2 session, tab, and window
Read the terminal buffer content from a session. Returns recent output lines.
Get information about the last command prompt: command text, working directory, exit status
Get the value of an iTerm2 session variable. Useful variables include: session.name, session.jobName, session.pid, session.path, session.tmuxWindowTitle, session.tmuxStatus, etc.
Output schemas not explicitly documented in tool definitions. Go struct types (CreateTabOutput, SplitPaneOutput, etc.) define outputs, but MCP tool registration does not include outputSchema. LLMs cannot see what fields to expect without reading implementation code.
No tool annotations (readOnlyHint, destructiveHint, idempotentHint) despite clear risk levels. close_session is DESTRUCTIVE, send_text is WRITE, list_sessions is READ_ONLY, these should be declared in tool metadata for agent safety.
Error handling lacks recovery guidance. Tool handlers return fmt.Errorf() with minimal context. No guidance on retryability, user-fixable vs fatal errors, or next steps. E.g., 'failed to create tab: %w' tells agent nothing actionable.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 56 | 2026-07-28+ | v2 |
Inject raw bytes/keystrokes into a session. More low-level than send_text.
List all iTerm2 profile names
List all iTerm2 sessions (windows, tabs, and panes) with their IDs and names
Create a new tab, run a command, and wait for the output to appear in the terminal buffer.
Take a screenshot of an iTerm2 window or session and save it as a PNG file
Send text (or a command) to an iTerm2 session as if typed. Use \n at the end to execute the command.
Set a badge (small text label) on an iTerm2 session. Empty string clears the badge.
Set the name of an iTerm2 session (displayed in the tab/title bar)
Set the value of an iTerm2 session variable
Split an iTerm2 session into two panes. Returns the new session ID.
Parameter descriptions are minimal (1-2 lines). Baseline for A+ tools is 50-200 chars per param. Many params lack format/constraint hints. E.g., 'session_id' description is 'required, the session ID (e.g. window_0_tab_0_session_0)', example values should be constraints, not examples.
No pagination support for list_sessions or list_profiles. If iTerm2 has many sessions/profiles, responses could be large. No limit, offset, or cursor parameters documented.