Skip to main content
Glama
clalarco

MCP CLI Server

by clalarco
README.md
# MCP CLI Server

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

@author: Claudio Alarcon clalarco@gmail.com

## Requirements

- `uv` for execution. Check https://docs.astral.sh/uv/ for installation instructions.
- `npm` (optional) to use the MCP inspector. Check https://docs.npmjs.com/ for installation instructions.

## 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:

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

Using it from Github:

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

## Using MCP inspector

Having npm installed, run:

Local repository:

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

From github:

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

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.