# lite
## 基本信息
- Slug: `lite-iterm-mcp`
- Source: modelscope
- Publisher: @lite/iterm-mcp
- Categories: shell-access / command-line / os-automation
- Hosted: Yes
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@lite/iterm-mcp
## 简介
暂无描述。
## MCP Server 详情

# iterm-mcp
一个提供访问你iTerm会话的Model Context Protocol服务器。

![主图](.github/images/demo.gif)

### 特性

**高效的令牌使用：** iterm-mcp使模型能够仅检查其感兴趣的输出。即使对于长时间运行的命令，模型通常也只希望看到最后几行输出。

**自然集成：** 你可以与模型共享iTerm。你可以询问屏幕上显示的内容，或将任务委托给模型，并观察它执行每一步的过程。

**完整的终端控制和REPL支持：** 模型可以启动并交互REPL，并发送如ctrl-c、ctrl-z等控制字符。

**依赖少：** iterm-mcp构建时尽量减少了依赖项，并可以通过npx运行。它被设计为易于添加到Claude Desktop和其他MCP客户端中，应该可以直接工作。

<a href="https://glama.ai/mcp/servers/h89lr05ty6"><img width="380" height="200" src="https://glama.ai/mcp/servers/h89lr05ty6/badge" alt="iTerm Server MCP server" /></a>

## 安全注意事项

* 用户负责安全地使用该工具。
* 无内置限制：iterm-mcp不尝试评估所执行命令的安全性。
* 模型的行为可能出乎意料。用户应监控活动并在适当时候中断。
* 对于多步骤任务，如果模型偏离正轨，你可能需要中断它。开始时请从较小且集中的任务做起，直到熟悉模型的行为为止。

### 工具
- `write_to_terminal` - 向活动的iTerm终端写入内容，常用于运行命令。返回命令产生的输出行数。
- `read_terminal_output` - 从活动的iTerm终端读取指定数量的行。
- `send_control_character` - 向活动的iTerm终端发送控制字符。

### 要求

* 必须运行iTerm2
* Node版本18或更高

## 安装

要与Claude Desktop一起使用，请添加服务器配置：

在macOS上: `~/Library/Application Support/Claude/claude_desktop_config.json`
在Windows上: `%APPDATA%/Claude/claude_desktop_config.json`

json
{
  "mcpServers": {
    "iterm-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "iterm-mcp"
      ]
    }
  }
}


### 通过Smithery安装

要通过[Smithery](https://smithery.ai/server/iterm-mcp)自动为Claude Desktop安装iTerm:

bash
npx -y @smithery/cli install iterm-mcp --client claude


[![smithery 徽章](https://smithery.ai/badge/@lite/iterm-mcp)](https://smithery.ai/server/@lite/iterm-mcp)

## 开发

安装依赖:
bash
yarn install


构建服务器:
bash
yarn run build


开发时自动重建:
bash
yarn run watch


### 调试

由于MCP服务器通过标准输入输出进行通信，调试可能会有挑战。我们推荐使用[MCP Inspector](https://github.com/modelcontextprotocol/inspector)，它作为包脚本可用：

bash
yarn run inspector
yarn debug <command>


Inspector将提供一个URL，以便您在浏览器中访问调试工具。

