terminal-controller-mcp

This repository provides a Model Context Protocol (MCP) server, enabling secure terminal command execution, directory navigation, and file system operations through a standardized interface. It supports cross-platform functionality and offers security measures.

32
2

Terminal Controller for MCP

A Model Context Protocol (MCP) server that enables secure terminal command execution, directory navigation, and file system operations through a standardized interface.

Features

  • Command Execution: Executes terminal commands with timeout controls and output capture.
  • Directory Management: Navigates directories and lists contents.
  • Security Measures: Includes safeguards against dangerous commands.
  • Command History: Tracks recent command executions.
  • Cross-Platform Support: Compatible with Windows and UNIX-based systems.

Installation

Prerequisites

  • Python 3.11+
  • An MCP-compatible client
  • UV/UVX (optional)

Method 1: PyPI Installation

pip install terminal-controller

Method 2: From Source

git clone https://github.com/GongRzhe/terminal-controller-mcp.git
cd terminal-controller-mcp
python setup_mcp.py

Client Configuration

Configuration examples are provided for Claude Desktop and Cursor, using either UVX or direct Python execution.

Usage

Interact with the terminal using natural language commands through your MCP client.

API Reference

Exposes MCP tools like execute_command, get_command_history, get_current_directory, change_directory, and list_directory.

Security Considerations

Implements timeout controls, command blacklisting, and error handling.

Limitations

Commands must complete within the timeout period.

Troubleshooting

Provides steps for diagnosing common issues.

Contributing

Contributions are welcome.

License

MIT

Repository

GO
GongRzhe

GongRzhe/terminal-controller-mcp

Created

February 25, 2025

Updated

March 28, 2025

Language

Python

Category

System Tools