Get the FREE Ultimate OpenClaw Setup Guide →

terminal_server

MCP server that can execute terminal commands

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio theailanguage-terminal_server python -m terminal_server \
  --env MCP_ENV="production or development placeholder" \
  --env TERMINAL_SERVER_PORT="9000"

How to use

This MCP server provides a terminal-style interface exposed via STDIO (local) and SSE (server-sent events) transports. It enables an AI model to execute terminal commands, store results, and use prompts to guide interactions. The repository demonstrates both a local Python-based STDIO setup and a Dockerized SSE setup, allowing you to run the server either directly on your machine or inside containers. Once running, you can interact with the server through prompts that request terminal actions (for example listing files or echoing output) and receive results back for further processing by your AI workflows.

How to install

Prerequisites:

  • Python 3.8+ installed on your system
  • Optional: Docker if you prefer containerized SSE setup

Local (Python) setup:

  1. Install Python and ensure it's available on your PATH.
  2. Install project dependencies if a requirements.txt is provided (or ensure the terminal_server module contains its own dependencies).
  3. Start the server: python -m terminal_server

Docker-based SSE setup:

  1. Install Docker on your machine.
  2. Build or pull the terminal SSE image as described in the repository (e.g., docker build -t terminal_server_sse . or docker pull your-registry/terminal_server_ss_e)
  3. Run the container with appropriate port mappings and environment variables, for example: docker run -i -p 8080:8080 -e MCP_ENV=production terminal_server_ss_e

Notes:

  • If the repository provides a requirements.txt, install with: pip install -r requirements.txt
  • If you extend configuration, you may set environment variables like TERMINAL_SERVER_PORT or custom MCP_ENV values as needed.

Additional notes

Tips and common issues:

  • The server may expose different transports (STDIO for local testing and SSE for remote access). Ensure you enable the transport you intend to use.
  • When running SSE, ensure the host firewall or cloud security groups allow the chosen port.
  • For security, implement command whitelisting to prevent execution of dangerous operations. Consider sandboxing terminal commands when integrating with an AI like Claude.
  • If you need to customize prompts or templates, check the terminal_server module for predefined MCP prompts that guide command execution.
  • If your deployment targets Google Cloud Platform or other cloud providers, review any required IAM permissions and container registry access.
  • Logging: enable verbose logs during setup to diagnose transport or command execution issues.

Related MCP Servers

Sponsor this space

Reach thousands of developers