This MCP server provides seamless integration with your iTerm terminal sessions, allowing AI models to interact with your terminal while efficiently managing token usage. The server gives models the ability to view selected terminal output and execute commands in your existing iTerm sessions.
To integrate with Claude Desktop, you'll need to add the server configuration to your Claude Desktop config file:
On macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
On Windows:
%APPDATA%/Claude/claude_desktop_config.json
Add the following configuration to the file:
{
"mcpServers": {
"iterm-mcp": {
"command": "npx",
"args": [
"-y",
"iterm-mcp"
]
}
}
}
For a simpler installation process, you can use Smithery to automatically set up iterm-mcp:
npx -y @smithery/cli install iterm-mcp --client claude
Before using iterm-mcp, ensure you have:
The iterm-mcp server provides three main tools that models can use to interact with your terminal:
write_to_terminal - Sends text or commands to your active iTerm terminal window. It returns the number of lines of output produced by the command.
read_terminal_output - Retrieves a specified number of lines from the active iTerm terminal, allowing the model to see terminal output.
send_control_character - Sends control characters (like Ctrl+C, Ctrl+Z) to the active terminal session.
When using iterm-mcp, keep these safety tips in mind:
Here's how a typical interaction might work:
The model will be able to:
du -h
to check disk usageFor interactive sessions like REPLs, the model can also use control characters to navigate or exit the session as needed.
AI: This MCP server provides seamless integration with your iTerm terminal sessions, allowing AI models to interact with your terminal while efficiently managing token usage. The server gives models the ability to view selected terminal output and execute commands in your existing iTerm sessions.
To integrate with Claude Desktop, you'll need to add the server configuration to your Claude Desktop config file:
On macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
On Windows:
%APPDATA%/Claude/claude_desktop_config.json
Add the following configuration to the file:
{
"mcpServers": {
"iterm-mcp": {
"command": "npx",
"args": [
"-y",
"iterm-mcp"
]
}
}
}
For a simpler installation process, you can use Smithery to automatically set up iterm-mcp:
npx -y @smithery/cli install iterm-mcp --client claude
Before using iterm-mcp, ensure you have:
The iterm-mcp server provides three main tools that models can use to interact with your terminal:
write_to_terminal - Sends text or commands to your active iTerm terminal window. It returns the number of lines of output produced by the command.
read_terminal_output - Retrieves a specified number of lines from the active iTerm terminal, allowing the model to see terminal output.
send_control_character - Sends control characters (like Ctrl+C, Ctrl+Z) to the active terminal session.
When using iterm-mcp, keep these safety tips in mind:
Here's how a typical interaction might work:
The model will be able to:
du -h
to check disk usageFor interactive sessions like REPLs, the model can also use control characters to navigate or exit the session as needed.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.