Execute a terminal command and return its results
Get recent command execution history
Get the current working directory
Change the current working directory
List files and subdirectories in the specified directory
Write content to a file with overwrite or append options
Read content from a file
Update specific line(s) in a file
Delete specific line(s) from a file
Insert content at a specific line in a file
Terminal Controller provides a secure way to interact with your computer's terminal through natural language. It enables command execution, directory navigation, and file system operations with built-in security measures to prevent dangerous commands. The MCP server works across platforms (Windows and UNIX-based systems) and offers comprehensive features like command history tracking, timeout controls, and row-level file operations. It's designed to integrate seamlessly with MCP-compatible clients such as Claude Desktop and Cursor.
Terminal Controller is an MCP server that provides a secure interface for terminal operations. It allows AI assistants to execute commands, navigate directories, and perform file operations on your behalf through natural language instructions.
Install directly from PyPI using pip:
pip install terminal-controller
Or using UV:
uv pip install terminal-controller
If you prefer installing from source:
git clone https://github.com/GongRzhe/terminal-controller-mcp.git
cd terminal-controller-mcp
python setup_mcp.py
For Claude Desktop users, you can use Smithery for automatic installation:
npx -y @smithery/cli install @GongRzhe/terminal-controller-mcp --client claude
Configure Claude Desktop by editing its configuration file:
Location:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Option 1: Using UVX (Recommended)
"mcpServers": {
"terminal-controller": {
"command": "uvx",
"args": ["terminal_controller"]
}
}
Option 2: Using Python Directly
"mcpServers": {
"terminal-controller": {
"command": "python",
"args": ["-m", "terminal_controller"]
}
}
Use similar configuration settings as Claude Desktop, adjusting according to the client's specific requirements.
Once configured, you can use natural language to interact with your terminal:
ls -la
in the current directory"Terminal Controller includes built-in safeguards against potentially dangerous commands. However, as with any tool that can execute commands on your system, you should be cautious about the instructions you give to the AI assistant.
If you encounter issues: