A MCP server for iTerm2 terminals enabling creation, command execution, output reading, listing, and closing of terminals via MCP.
Configuration
View docs{
"mcpServers": {
"rishabkoul-iterm-mcp-server": {
"command": "npx",
"args": [
"iterm_mcp_server"
]
}
}
}You can control iTerm2 terminals through an MCP server, enabling AI assistants to open terminals, run commands, read outputs, list active sessions, and close terminals. This makes terminal automation and orchestration straightforward from any MCP client.
Use an MCP client to connect to the ITerm MCP Server and perform these actions: create a new terminal session, run commands inside a terminal, read the real-time output, list all active terminals, and close terminals when you’re done. Each operation maps to one of the available tools and can be chained to build complex workflows.
Prerequisites you must meet before running the server.
Start by making the MCP server accessible to your MCP clients. The recommended approach for local usage is to run the server through npx, which executes the MCP server package without a global install.
Optionally, you can integrate with Cursor by adding the following configuration to your MCP client setup. This enables easy access to the ITerm MCP Server from Cursor.
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": ["iterm_mcp_server"]
}
}
}Standard MCP configuration is sufficient for normal use. The provided Cursor integration demonstrates how to expose the ITerm MCP Server as a terminal handler via npx, enabling clients to connect and manage terminals.
Open a new iTerm2 terminal session to run commands within a dedicated process.
Execute a given shell command inside a specific terminal session and capture its output.
Read and stream the real-time output from a terminal session.
Close a specified terminal session when it is no longer needed.
List all active terminals and their current state, including identifiers and metadata.