mcpterm
一个MCP工具服务器,提供有状态的、兼容TUI的终端会话。
这是一个概念验证,使用 mcp走.
与Claude Desktop配合得很好。
用法
克隆仓库并运行 make 生成 bin/mcpterm.
git clone https://github.com/dwrtz/mcpterm.git
cd mcpterm
make移动 mcpterm 将二进制文件保存到PATH中的某个目录。
sudo mv bin/mcpterm /usr/local/bin/mcpterm添加到克劳德桌面
编辑您的 claude_desktop_config.json (在Mac上,它在 ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"mcpterm": {
"command": "mcpterm",
"args": []
}
}
}重新启动克劳德桌面。现在Claude应该看到以下提供的2个工具 mcpterm.
工具
run:在有状态的终端会话中运行命令。例如,如果你cd到一个目录中,后续命令将在该目录中运行。
runScreen:运行命令或一系列按键并返回屏幕输出。适用于vim或python REPL等TUI应用程序。
提示:
您可能想告诉Claude使用以下控制序列 runScreen 工具:
"^X": "\x18", // Ctrl+X
"^O": "\x0F", // Ctrl+O
"^J": "\x0A", // Enter
"^C": "\x03", // Ctrl+C
"^D": "\x04", // Ctrl+D
"^Z": "\x1A", // Ctrl+Z
"^[": "\x1B", // Escape
"^H": "\x08", // Backspace
"^M": "\x0D", // Carriage return
"^L": "\x0C", // Form feed
"^G": "\x07", // Bell
"^U": "\x15", // Clear line
"^W": "\x17", // Delete word
"^Y": "\x19", // Paste from kill buffer
"^V": "\x16", // Literal input
"^K": "\x0B", // Kill line
"^E": "\x05", // End of line
"^A": "\x01", // Beginning of line
"^I": "\x09", // Tab虽然不完美,但效果很好。Claude能够使用vim编写一个Dockerfile,然后在交互式会话中运行容器,然后在容器中运行命令,如python REPL。

