Skip to main content
Glama

Terminal MCP Server

by YongpengFu

Terminal MCP Server

A simple MCP (Model Context Protocol) server that exposes a terminal tool and a resource for running shell commands and accessing documentation.

Features

  • Terminal Tool: Execute shell commands and get their output
  • Resource Support: Access the MCP readme documentation file
  • Working Directory Support: Optionally specify a working directory for commands
  • Timeout Protection: Commands timeout after 30 seconds
  • Error Handling: Proper error handling for failed commands

Installation

The project uses uv for dependency management. Install dependencies:

uv sync

Usage

Running the Server

python server.py

Tools

The server exposes a single tool called terminal with the following schema:

{ "name": "terminal", "description": "Run terminal commands and return the output", "inputSchema": { "type": "object", "properties": { "command": { "type": "string", "description": "The shell command to execute" }, "cwd": { "type": "string", "description": "Working directory for the command (optional)" } }, "required": ["command"] } }

Example Usage

The tool can be called with:

{ "command": "ls -la", "cwd": "/path/to/directory" }

Resources

The server exposes a resource for accessing the MCP readme documentation:

  • URI: file:///resource/mcpreadme.md
  • Name: MCP Readme
  • Description: MCP documentation and readme file
  • MIME Type: text/markdown

This resource allows clients to read the MCP documentation directly through the server.

Security Note

⚠️ Warning: This server allows execution of arbitrary shell commands. Use with caution and only in trusted environments.

Dependencies

  • mcp[cli]>=1.13.0 - MCP Python SDK
-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Enables execution of shell commands through a terminal tool with working directory support and timeout protection. Also provides access to MCP documentation as a resource.

  1. Features
    1. Installation
      1. Usage
        1. Running the Server
        2. Tools
        3. Example Usage
        4. Resources
      2. Security Note
        1. Dependencies

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            MCP server allowing any and all command execution over CMD
            Last updated -
            2
            618
            20
            JavaScript
            MIT License
            • Linux
          • -
            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 -
            309
            3
            JavaScript
          • A
            security
            A
            license
            A
            quality
            An MCP server that enables secure execution of shell commands across Windows, macOS, and Linux with built-in whitelisting and approval mechanisms for enhanced security.
            Last updated -
            9
            623
            6
            JavaScript
            MIT License
            • Linux
            • Apple
          • -
            security
            F
            license
            -
            quality
            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.
            Last updated -
            1
            Python

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/YongpengFu/mcp-server'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server