Skip to main content
Glama
MCP Terminal Monitor

MCP Terminal Monitor

by pavanvzm

🔧 MCP Terminal Monitor

demo

License: MIT npm version

Production-ready Model Context Protocol (MCP) Server for system monitoring. Provides AI agents with real-time access to Docker containers, system resources, ports, and logs.

🚀 Quick Start

npx mcp-terminal-monitor

Or install globally:

npm install -g mcp-terminal-monitor
mcp-terminal-monitor

Related MCP server: docker-mcp-server

📋 Available Tools

Tool

Description

list_docker_containers

List Docker containers with status, ports, and health

check_port_conflicts

Check if a specific port is in use on the system

tail_system_logs

Retrieve recent system or Docker container logs

get_disk_usage

Get disk usage statistics for filesystems

monitor_cpu_ram

Monitor CPU and RAM usage with configurable sampling

🔧 Features

  • 🐳 Docker Integration - List containers, fetch logs, monitor health

  • 🔌 Port Monitoring - Detect port conflicts before deployment

  • 📊 System Metrics - Real-time CPU, RAM, and disk usage

  • 📝 Log Access - System and container log streaming

  • 🔒 Read-Only Safety - All operations are non-destructive

  • ⚡ Low Latency - Optimized system calls for fast responses

  • 🛡️ Strict Validation - Zod schemas ensure safe argument parsing

  • 🌐 Cross-Platform - Works on Linux, macOS, and Windows

🏗 Architecture

graph TD
    A[AI Client] -->|MCP Protocol| B[MCP Terminal Monitor Server]
    B -->|Docker API| C[Docker Daemon]
    B -->|System Calls| D[OS Kernel]
    B -->|Network Stats| E[Netstat/Lsof]
    B -->|Process Info| F[SystemInformation]
    
    C --> G[Containers]
    D --> H[CPU/RAM/Disk]
    E --> I[Port Conflicts]
    F --> J[System Metrics]

📖 Usage Examples

List Docker Containers

{
  "name": "list_docker_containers",
  "arguments": {
    "all": true,
    "limit": 10
  }
}

Check Port Conflicts

{
  "name": "check_port_conflicts",
  "arguments": {
    "port": 3000,
    "host": "0.0.0.0"
  }
}

Tail System Logs

{
  "name": "tail_system_logs",
  "arguments": {
    "service": "nginx",
    "lines": 50,
    "follow": false
  }
}

Get Disk Usage

{
  "name": "get_disk_usage",
  "arguments": {
    "path": "/"
  }
}

Monitor CPU & RAM

{
  "name": "monitor_cpu_ram",
  "arguments": {
    "interval": 1000,
    "samples": 3
  }
}

🔌 MCP Configuration

Add to your MCP client configuration:

{
  "mcpServers": {
    "terminal-monitor": {
      "command": "npx",
      "args": ["mcp-terminal-monitor"]
    }
  }
}

🛠 Development

# Clone repository
git clone https://github.com/yourusername/mcp-terminal-monitor.git
cd mcp-terminal-monitor

# Install dependencies
npm install

# Run in development mode
npm start

# Build for production
npm run build

📦 Requirements

  • Node.js >= 18.0.0

  • Docker daemon (for Docker-related tools)

  • Root/sudo access may be required for some system calls

📄 License

MIT © Your Name


Built with @modelcontextprotocol/sdk

Available Tools

5 tools
check_port_conflictsC

Check if a specific port is in use on the system. Helps identify port conflicts.

Inputs: port (required), host.

get_disk_usageB

Get disk usage statistics for filesystems. Shows size, used, available space.

Inputs: path.

list_docker_containersA

List Docker containers with their status, ports, and health. Read-only operation.

Inputs: all, limit.

monitor_cpu_ramB

Monitor CPU and RAM usage with configurable sampling. Returns current load and memory stats.

Inputs: samples, interval.

tail_system_logsB

Retrieve recent system or Docker container logs. Supports filtering by service name.

Inputs: lines, follow, service.

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 5 tools

    Disambiguation5/5

    Each tool targets a distinct system resource or aspect: ports, disk usage, Docker containers, CPU/RAM, and logs. No two tools have overlapping purposes, making it clear which to use for a given monitoring task.

    Naming Consistency5/5

    All tool names follow the consistent 'verb_noun' pattern using lowercase with underscores, e.g., 'check_port_conflicts', 'get_disk_usage'. The verbs are appropriate and uniform.

    Tool Count5/5

    With 5 tools, the server provides a focused yet comprehensive set for system monitoring. It covers essential areas (CPU, RAM, disk, ports, Docker, logs) without being overwhelming or too sparse.

    Completeness4/5

    The tool set covers core monitoring tasks, but lacks network usage and process monitoring. These are minor gaps for a general monitoring server; agents can still accomplish many common tasks.

    Related MCP Connectors

    Related MCP Servers