CAMEL Terminal Toolkit as a standalone MCP server
Project description
CAMEL Terminal Toolkit MCP Server
This is a standalone MCP (Model Context Protocol) server that exports the CAMEL Terminal Toolkit functionality. It allows LLM clients to execute terminal commands safely through the MCP protocol.
Features
- Shell Execution: Execute shell commands in managed sessions
- Session Management: Create and manage multiple shell sessions
- Safe Mode: Restrict dangerous operations and enforce working directory boundaries
- Interactive Support: Support for interactive commands (Linux/macOS only)
- Process Management: Control running processes (view, wait, write input, kill)
- Human Takeover: Request human assistance when needed
Installation
Using uv (recommended):
cd camel_terminal_toolkit
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .
Using pip:
cd camel_terminal_toolkit
pip install -e .
Usage
As an MCP Server
Start the server with stdio transport:
terminal-toolkit-mcp
Command Line Options
--working-directory PATH: Set the working directory for operations--timeout SECONDS: Set timeout for operations (default: 20.0)--safe-mode/--no-safe-mode: Enable/disable safe mode (default: enabled)--interactive: Enable interactive mode for commands requiring input--transport {stdio}: Set transport type (currently only stdio supported)
Example
# Start with custom working directory and increased timeout
terminal-toolkit-mcp --working-directory /tmp/workspace --timeout 60.0
# Start with safe mode disabled (not recommended)
terminal-toolkit-mcp --no-safe-mode
Available Tools
The server exposes the following tools through MCP:
- shell_exec(id, command): Execute a shell command in a session
- shell_view(id): View the output history of a session
- shell_wait(id, seconds): Wait for a running command to complete
- shell_write_to_process(id, input, press_enter): Send input to a running process
- shell_kill_process(id): Terminate a running process
- ask_user_for_help(id): Request human assistance
Safety Features
When safe mode is enabled (default):
- Commands are restricted to the working directory
- Dangerous system commands are blocked
- File operations are limited to the workspace
- Network commands are prohibited
Development
Setup Development Environment
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"
Running Tests
pytest
Code Formatting
ruff check .
ruff format .
License
Apache License 2.0 - see the CAMEL-AI project for full license details.
Contributing
This project is part of the CAMEL-AI ecosystem. Please refer to the main CAMEL repository for contribution guidelines.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file terminal_toolkit_mcp-0.1.1.tar.gz.
File metadata
- Download URL: terminal_toolkit_mcp-0.1.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e494bd211fc9a235d14823f092413efda99ff16dd1cb6d8911bf1be11d9692a1
|
|
| MD5 |
84aee81016a3851e569e8214f6a26891
|
|
| BLAKE2b-256 |
09259768d437fc719dd4218dd2801682349ff6ffa35426274dc845683875258d
|
File details
Details for the file terminal_toolkit_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: terminal_toolkit_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa364736a83d2a16be7ba8290a45f7977becc87c89d26157a3652798cb3b31dc
|
|
| MD5 |
5511b4e1d47e077f3a2b5b86fcb01d39
|
|
| BLAKE2b-256 |
bc00a890ed9e367d5655007d0b41f30c2cf1357b8fba8c8dde3e1c027dc5d3e7
|