by GongRzhe
Enables secure terminal command execution, directory navigation, and fine‑grained file system operations through a standardized MCP interface.
Terminal Controller provides a Model Context Protocol (MCP) server that lets users run shell commands, move through directories, and manipulate files (read, write, insert, update, delete) with built‑in safety checks.
pip install terminal-controller
# or with UV
uv pip install terminal-controller
python -m terminal_controller
# or with UVX
uvx terminal_controller
"terminal-controller": {
"command": "python",
"args": ["-m", "terminal_controller"]
}
Q: What Python version is required?
A: Python 3.11 or higher.
Q: Can I run interactive commands like vim
?
A: Interactive tools are limited because the server operates non‑interactively; they may not behave as expected.
Q: How does the security blacklist work?
A: Dangerous commands such as rm -rf /
, format
, and mkfs
are blocked before execution.
Q: What if a command exceeds the timeout?
A: The server terminates the process and returns a timeout error.
Q: Do I need UVX to run the server?
A: No, UVX is optional. You can start the server with standard Python as shown above.
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:
python setup_mcp.py
There are two ways to configure Claude Desktop to use Terminal Controller:
Add this to your Claude Desktop configuration file:
"terminal-controller": {
"command": "uvx",
"args": ["terminal_controller"]
}
"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_command
Execute a terminal command and return its results.
Parameters:
command
: The command line command to executetimeout
: Command timeout in seconds (default: 30)Returns:
get_command_history
Get recent command execution history.
Parameters:
count
: Number of recent commands to return (default: 10)Returns:
get_current_directory
Get the current working directory.
Returns:
change_directory
Change the current working directory.
Parameters:
path
: Directory path to switch toReturns:
list_directory
List files and subdirectories in the specified directory.
Parameters:
path
: Directory path to list contents (default: current directory)Returns:
write_file
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_file
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_file_content
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_file_content
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_file_content
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
uvx terminal_controller
Contributions are welcome! Please feel free to submit a Pull Request.
MIT
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.