A Model Context Protocol (MCP) server that enables secure terminal command execution, directory navigation, and file system operations through a standardized interface.
To install Terminal Controller for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @GongRzhe/terminal-controller-mcp --client claude
Install the package directly from PyPI:
pip install terminal-controller
Or if you prefer to use UV:
uv pip install terminal-controller
If you prefer to install from source:
Clone this repository:
git clone https://github.com/GongRzhe/terminal-controller-mcp.git cd terminal-controller-mcp
Run the setup script:
There are two ways to configure Claude Desktop to use Terminal Controller:
Option 1: Using UVX (Recommended)Add this to your Claude Desktop configuration file:
"terminal-controller": { "command": "uvx", "args": ["terminal_controller"] }Option 2: Using Python Directly
"terminal-controller": { "command": "python", "args": ["-m", "terminal_controller"] }
The configuration path varies by operating system:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
For Cursor, use similar configuration settings as Claude Desktop.
For other clients, refer to their documentation on how to configure external MCP servers.
Once configured, you can use natural language to interact with your terminal through your MCP client:
ls -la
in the current directory"Terminal Controller exposes the following MCP tools:
Execute a terminal command and return its results.
Parameters:
command
: The command line command to executetimeout
: Command timeout in seconds (default: 30)Returns:
Get recent command execution history.
Parameters:
count
: Number of recent commands to return (default: 10)Returns:
Get the current working directory.
Returns:
Change the current working directory.
Parameters:
path
: Directory path to switch toReturns:
List files and subdirectories in the specified directory.
Parameters:
path
: Directory path to list contents (default: current directory)Returns:
Write content to a file with overwrite or append options.
Parameters:
path
: Path to the filecontent
: Content to writemode
: Write mode ('overwrite' or 'append', default: 'overwrite')Returns:
Read content from a file with optional row selection.
Parameters:
path
: Path to the filestart_row
: Starting row to read from (0-based, optional)end_row
: Ending row to read to (0-based, inclusive, optional)Returns:
Insert content at specific row(s) in a file.
Parameters:
path
: Path to the filecontent
: Content to insertrow
: Row number to insert at (0-based, optional)rows
: List of row numbers to insert at (0-based, optional)Returns:
Delete content at specific row(s) from a file.
Parameters:
path
: Path to the filerow
: Row number to delete (0-based, optional)rows
: List of row numbers to delete (0-based, optional)Returns:
Update content at specific row(s) in a file.
Parameters:
path
: Path to the filecontent
: New content to place at the specified row(s)row
: Row number to update (0-based, optional)rows
: List of row numbers to update (0-based, optional)Returns:
Terminal Controller implements several security measures:
If you encounter issues:
python -m terminal_controller
Contributions are welcome! Please feel free to submit a Pull Request.
MIT
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4