MCP Terminal Server

MCP Terminal Server

A simple MCP server that exposes a tool for running terminal commands.

Installation

  1. Install the MCP Python SDK:
pip install mcp

Usage

  1. Start the server:
python server.py
  1. Connect to the server in an MCP-compatible client, such as Claude Desktop:
mcp install server.py

Or use the MCP Inspector to test it:

mcp dev server.py

Tool Overview

This server exposes one tool:

terminal_command

Runs a terminal command and returns its output.

Parameters:

  • command: The command to run in the terminal

Returns:

  • A dictionary containing:
    • stdout: The standard output from the command
    • stderr: The standard error output from the command
    • return_code: The command's return code (0 typically means success)

Example Usage in Claude:

Can you list the files in the current directory using the terminal tool?

Security Considerations

This tool executes commands directly on your system. Use with caution as it can run any command with the same permissions as the user running the server.

Limitations

  • Commands timeout after 30 seconds
  • For security reasons, consider implementing additional validation and restrictions on the commands that can be executed
-
security - not tested
F
license - not found
-
quality - not tested

A simple MCP server that allows running terminal commands with output capture, enabling command execution on the host system from MCP-compatible clients like Claude Desktop.

  1. Installation
    1. Usage
      1. Tool Overview
        1. terminal_command
      2. Security Considerations
        1. Limitations

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            An MCP server to run commands.
            Last updated -
            2
            446
            138
            TypeScript
            MIT License
            • Apple
          • -
            security
            F
            license
            -
            quality
            A simple MCP server that allows accessing and executing shell commands on a VM machine through a web-based terminal interface, with automatic tunneling to make the VM accessible from anywhere.
            Last updated -
            39
            2
            JavaScript
          • -
            security
            F
            license
            -
            quality
            An MCP server that allows AI assistants like Claude to execute terminal commands on the user's computer and return the output, functioning like a terminal through AI.
            Last updated -
            7
            Python
            • Apple
          • -
            security
            A
            license
            -
            quality
            An enhanced MCP server that grants AI assistants the ability to execute terminal commands on a user's system with improved security controls, designed for use in controlled environments.
            Last updated -
            Python
            MIT License
            • Apple

          View all related MCP servers

          ID: yqw8e6f4dl