Skip to main content

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:

camel-terminal-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
camel-terminal-mcp --working-directory /tmp/workspace --timeout 60.0

# Start with safe mode disabled (not recommended)
camel-terminal-mcp --no-safe-mode

Available Tools

The server exposes the following tools through MCP:

  1. shell_exec(id, command): Execute a shell command in a session
  2. shell_view(id): View the output history of a session
  3. shell_wait(id, seconds): Wait for a running command to complete
  4. shell_write_to_process(id, input, press_enter): Send input to a running process
  5. shell_kill_process(id): Terminate a running process
  6. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terminal_toolkit_mcp-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terminal_toolkit_mcp-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file terminal_toolkit_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: terminal_toolkit_mcp-0.1.0.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

Hashes for terminal_toolkit_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cd7ab7dd4efbb7f668e060d0ab4679e59be0d9dd47ea10c86b26ec8b0633853f
MD5 48bd9b6428376c9d0c9c327bd8fcec76
BLAKE2b-256 abd2be6601b42c42e01a80bd99eb5dd6c86570ff972e94008bc971a11dab195b

See more details on using hashes here.

File details

Details for the file terminal_toolkit_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for terminal_toolkit_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d65e2672bb0d8041b0ebd530f184e70d89eeafbc40e2089b7db111e032a1c1f1
MD5 b0b4619d4b64f0c4d72d1faced7a1956
BLAKE2b-256 9f2024269ad05ec61f40782dc2bf48b4f49ecdedddbcfe458437154b1f7fda7d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page