Skip to main content
Glama
MCP CLI Server

MCP CLI Server

by clalarco

MCP CLI Server

An MCP server that provides tools to interact with CLI applications.

@author: Claudio Alarcon clalarco@gmail.com

Requirements

Related MCP server: mcpdeployment

MCP Tools

  • start_process(command: str): Start a new process.

  • stop_process(pid: str): Stop a running process.

  • is_alive(pid: str): Check if a process is running.

  • write_input(pid: str, text: str): Send input to a process.

  • read_output(pid: str): Read output from a process.

  • get_processes(): Get a list of all processes.

MCP Configuration

Local repository configuration:

{
  "mcpServers": {
    "cli": {
      "command": "uv",
      "args": ["--directory", "/path/to/mcp-cli", "run", "mcp-cli"]
    }
  }
}

Using it from Github:

{
  "mcpServers": {
    "cli": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/clalarco/mcp-cli", "mcp-cli"]
    }
  }
}

Using MCP inspector

Having npm installed, run:

Local repository:

npx -y @modelcontextprotocol/inspector uv run mcp-cli

From github:

npx -y @modelcontextprotocol/inspector uvx --from git+https://github.com/clalarco/mcp-cli mcp-cli

Available Tools

8 tools
get_processesA

Get a list of all processes.

Returns: A dictionary of ProcessDetails objects with PID as key. ProcessDetails contains pid, command and is_alive.

Inputs: no named parameters. Returns: result

is_aliveA

Check if a program is running.

Args: pid: The process ID returned by start_program().

Returns: True if the program is running, False otherwise.

Inputs: pid (required). Returns: result

read_outputA

Read available output from a running program.

Args: pid: The process ID returned by start_program(). max_bytes: Maximum number of bytes to read. timeout: Maximum time to wait for output.

Returns: The output text read from the process. Returns empty string if no output.

Inputs: pid (required), timeout, max_bytes. Returns: result

start_programB

Start a CLI program in a PTY.

Args: command: The command to run (e.g., "cat", "python -i", "ls -la").

Returns: The process ID (pid) of the started program.

Inputs: command (required). Returns: result

stop_all_programsB

Stop all running programs.

Returns: A confirmation message.

Inputs: no named parameters. Returns: result

stop_programB

Stop a running program.

Args: pid: The process ID returned by start_program.

Returns: A confirmation message.

Inputs: pid (required). Returns: result

wait_for_outputA

Wait until a specific text pattern appears in the output.

Args: pid: The process ID returned by start_program(). pattern: The text to wait for. timeout: Maximum time to wait in seconds.

Returns: The output captured so far, or an error/timeout message.

Inputs: pid (required), pattern (required), timeout. Returns: result

write_inputA
Send text input to a running program.

Args:
    pid: The process ID returned by start_program().
    text: The text to send. Newlines are usually needed (e.g., "

").

Returns:
    A confirmation message.

Inputs: pid (required), text (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 8 tools

    Disambiguation4/5

    Tools are mostly distinct: get_processes lists all, is_alive checks status, start/stop manage lifecycle, read_output reads current output, wait_for_output waits for pattern, write_input sends text. Some minor overlap exists between read_output and wait_for_output, but they serve different purposes (immediate read vs. waiting).

    Naming Consistency4/5

    All tool names use snake_case with a verb_noun pattern (e.g., start_program, stop_program). 'is_alive' deviates slightly (adjective_noun) but is still clear. Overall consistent enough for easy prediction.

    Tool Count5/5

    8 tools is an ideal number for a CLI process management server. Each tool covers a distinct aspect without bloat, making the surface easy to navigate.

    Completeness4/5

    Covers core lifecycle (start, stop, list, check status), I/O (write, read, wait for pattern). Lacks a restart or signal-sending tool, but the set is sufficient for most interactive CLI use cases.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      An MCP server that enables programmatic management and monitoring of development servers through a unified interface and interactive TUI. It provides tools for process control, log streaming, and experimental browser automation via Playwright.
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for interactive TCP connection management, enabling opening listeners, managing sessions, port forwarding, proxy with logging, and local command execution from any MCP host.
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that provides tools for filesystem, database, web, system, and shell operations, along with resources and prompts via SSE transport.
      -