Skip to main content
Glama
Rylan2022

System Monitor MCP

by Rylan2022

System Monitor MCP

A Model Context Protocol (MCP) server built with TypeScript and Node.js that allows AI clients such as Codex to access real-time system information from a Linux machine.

The project is designed to start as a beginner-friendly MCP and gradually evolve into an intermediate/advanced system monitoring agent.


πŸš€ Features

Currently Implemented (through Phase 7)

  • βœ… MCP server using the official MCP SDK

  • βœ… Streamable HTTP transport

  • βœ… stdio transport for local Codex

  • βœ… RAM and Swap monitoring

  • βœ… CPU, load average, and per-core monitoring

  • βœ… Disk/filesystem monitoring

  • βœ… Process listing and process details

  • βœ… System information and uptime

  • βœ… Health scoring and system diagnosis

  • βœ… Network interfaces, traffic, and active connections

  • βœ… Automated TypeScript/MCP tests

  • βœ… Local Codex integration

  • βœ… TypeScript support

  • βœ… systeminformation integration

Planned Features (Phase 8+)

  • ⏳ Temperature/sensor monitoring

  • ⏳ Historical metrics

  • ⏳ Alerts and thresholds

  • ⏳ Background monitoring

  • ⏳ Service monitoring

  • ⏳ Safe process management

  • ⏳ Authentication and authorization

  • ⏳ Automated tests

  • ⏳ Docker deployment


🧠 What is MCP?

Model Context Protocol (MCP) is a protocol that allows AI applications to interact with external tools and data sources.

Instead of an AI model only answering from its existing knowledge, an MCP server can give it access to real information.

For this project:

User
  ↓
AI Client / Codex
  ↓
MCP
  ↓
System Monitor MCP
  ↓
Linux System
  ↓
CPU / RAM / Disk / Processes

For example, you can ask:

What is my current RAM usage?

The AI can call the MCP tool and receive the actual RAM information from your machine.


πŸ› οΈ Tech Stack

Technology

Purpose

TypeScript

Main programming language

Node.js

Runtime

MCP SDK

Build MCP server

systeminformation

Collect system information

Express

HTTP server

Streamable HTTP

HTTP MCP transport

stdio

Local MCP transport

Codex CLI

MCP client

npm

Package management


πŸ“ Project Structure

system-monitor-mcp/
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts
β”‚   └── stdio.ts
β”‚
β”œβ”€β”€ dist/
β”‚
β”œβ”€β”€ node_modules/
β”‚
β”œβ”€β”€ package.json
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ project-plan.md
β”œβ”€β”€ README.md
└── .gitignore

src/index.ts

HTTP-based MCP server.

It exposes:

http://localhost:3000/mcp

src/stdio.ts

stdio-based MCP server used by local Codex.

The stdio architecture is:

Codex
  ↓
stdio
  ↓
stdio.ts
  ↓
MCP Server

project-plan.md

Contains the roadmap for turning this project into an intermediate/advanced monitoring system.


πŸ“¦ Installation

Clone the repository:

git clone <your-repository-url>

Enter the project:

cd system-monitor-mcp

Install dependencies:

npm install

▢️ Running the HTTP MCP Server

Start the development server:

npm run dev

The server should start at:

http://localhost:3000

You can test the root endpoint:

curl http://localhost:3000

Expected response:

System Monitor MCP Server is running

πŸ”Œ MCP HTTP Endpoint

The MCP endpoint is:

POST http://localhost:3000/mcp

The server uses:

StreamableHTTPServerTransport;

for HTTP MCP communication.


πŸ–₯️ Local Codex Integration

For local Codex, the project uses the stdio transport.

Configure Codex with:

codex mcp add system-monitor -- npx tsx "/home/rakesh/Next js/system-monitor-mcp/src/stdio.ts"

Check the configuration:

codex mcp get system-monitor

Expected:

system-monitor
  enabled: true
  transport: stdio
  command: npx
  args: tsx /home/rakesh/Next js/system-monitor-mcp/src/stdio.ts

List MCP servers:

codex mcp list

πŸ§ͺ Testing the MCP

Start Codex:

codex

Then ask:

Call my_custom_mcp_test from my system-monitor MCP.

The MCP should return:

SUCCESS! This response came from Rakesh's custom System Monitor MCP.

This confirms that the custom MCP server is being accessed.


πŸ”§ Current MCP Tools

Related MCP server: mcp-remote-agent

get_memory_usage

Returns current RAM and Swap information.

Example response:

{
  "ram": {
    "total": 6100000000,
    "used": 4300000000,
    "free": 1800000000,
    "available": 2000000000
  },
  "swap": {
    "total": 4500000000,
    "used": 2600000000,
    "free": 1900000000
  }
}

my_custom_mcp_test

A simple test tool used to verify that the AI client is actually calling the custom MCP server.

Response:

SUCCESS! This response came from Rakesh's custom System Monitor MCP.

This tool is mainly for development/testing and can be removed later.


πŸ—ΊοΈ Development Roadmap

Phase 1 β€” Basic Monitoring

Implement:

get_cpu_usage
get_memory_usage
get_disk_usage
get_system_info

Phase 2 β€” Process Monitoring

Implement:

list_processes
get_process

Example:

Top 10 processes by CPU usage

or:

Top 10 processes by memory usage

Phase 3 β€” System Health

Create:

get_system_health

It should analyze:

CPU
RAM
Swap
Disk
Load Average
Processes

and return:

Healthy
Warning
Critical

Example:

{
  "score": 78,
  "status": "warning",
  "issues": [
    {
      "type": "memory",
      "severity": "medium",
      "message": "Memory usage is high."
    }
  ]
}

πŸ€– Advanced Diagnosis

Create:

diagnose_system

The tool will collect multiple metrics and help the AI understand why the system might be slow.

Example:

CPU: 22%
RAM: 89%
Swap: 63%
Disk: 81%

Diagnosis:

The system is experiencing memory pressure.
Several applications are consuming significant memory.

🌐 Network Monitoring

Planned tools:

get_network_stats
get_network_connections

Possible information:

Network interfaces
IP addresses
Upload traffic
Download traffic
Received bytes
Transmitted bytes
Active connections

🌑️ Hardware Monitoring

Planned:

get_temperature
get_sensors

Possible information:

CPU temperature
GPU temperature
Fan speed
Other available sensors

Hardware support will depend on the operating system and machine.


πŸ“Š Historical Monitoring

Instead of only returning the current state, the MCP can store metrics.

Example:

CPU
RAM
Swap
Disk
Load Average

Potential storage:

SQLite

Then implement:

get_metric_history

Example:

Show me RAM usage during the last hour.

🚨 Alerts

Add configurable thresholds.

Example:

{
  "cpu": {
    "warning": 70,
    "critical": 90
  },
  "memory": {
    "warning": 75,
    "critical": 90
  },
  "disk": {
    "warning": 75,
    "critical": 90
  }
}

Tool:

check_alerts

Example:

⚠️ Disk usage is 91%.

Critical threshold: 90%

βš™οΈ Background Monitoring

Eventually the MCP can continuously collect metrics.

Background Worker
       ↓
Collect metrics
       ↓
Store metrics
       ↓
Check thresholds
       ↓
Generate alerts

The monitoring interval should be configurable.


πŸ” Security

Advanced system-management features should be implemented carefully.

Avoid creating a generic tool such as:

execute_shell_command

Instead use specific, validated operations:

kill_process
restart_service

Potential security controls:

  • Input validation

  • Authorization

  • User confirmation

  • Audit logging

  • Rate limiting

  • Least-privilege permissions

  • Authentication for remote clients

  • HTTPS for remote deployment


πŸ§ͺ Testing Strategy

The project should eventually include:

Unit Tests

Test:

CPU calculations
Memory calculations
Disk thresholds
Health scoring
Alert generation
Input validation

MCP Integration Tests

Test:

initialize
tools/list
tools/call

Both transports should be tested:

stdio
Streamable HTTP

🐳 Docker

A future version can support Docker for the HTTP server.

Possible architecture:

Client
   ↓
HTTPS
   ↓
Reverse Proxy
   ↓
MCP Container

However, monitoring the host machine from inside a container requires additional Linux permissions and host integration.

The native Ubuntu version should be completed first.


πŸ“ˆ Final Architecture

The long-term architecture is:

                         AI CLIENT
                            β”‚
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚                     β”‚
              Codex CLI            HTTP Client
                 β”‚                     β”‚
               stdio               HTTPS/HTTP
                 β”‚                     β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                       MCP Server
                            β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚               β”‚
                Tool Layer      Transport
                    β”‚          stdio / HTTP
                    β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚           β”‚               β”‚
       CPU         RAM             Disk
        β”‚           β”‚               β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
              Service Layer
                    β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚           β”‚            β”‚
     Process     Network       Health
     Service     Service       Service
                                  β”‚
                              Diagnosis
                                  β”‚
                              Alerts
                                  β”‚
                              History
                                  β”‚
                              SQLite

🎯 Learning Objectives

By completing this project, you will gain practical experience with:

MCP

  • MCP architecture

  • MCP tools

  • Tool schemas

  • stdio transport

  • Streamable HTTP

  • MCP client integration

TypeScript

  • Async/await

  • Types and interfaces

  • Modules

  • Error handling

  • Schema validation

Node.js

  • Streams

  • Processes

  • Signals

  • File system

  • Background workers

Linux

  • CPU monitoring

  • Memory and Swap

  • Processes

  • Disk/filesystems

  • Network interfaces

  • systemd

  • Permissions

Backend Engineering

  • HTTP APIs

  • Authentication

  • Authorization

  • Logging

  • Testing

  • Docker

  • Production deployment


πŸ’‘ Example Use Cases

Once completed, you should be able to ask an AI client:

What is my current CPU usage?
How much RAM am I using?
Which process is using the most memory?
How much disk space is left?
Is my system healthy?
Why is my laptop slow?
Show me the system's network statistics.
Show me the most CPU-intensive processes.
What system problems occurred during the last hour?

πŸ† Portfolio Description

System Monitor MCP is a TypeScript/Node.js based Model Context Protocol server that gives AI clients access to real-time Linux system information. The project provides monitoring capabilities for CPU, memory, disk, processes, network, system health, alerts, and historical metrics, with support for local Codex integration through stdio and remote clients through Streamable HTTP.


πŸ“Œ Project Status

Current status: 🚧 In Development

Completed

  • MCP server setup

  • TypeScript configuration

  • Streamable HTTP server

  • stdio server

  • MCP initialization

  • Tool discovery

  • Memory monitoring

  • Custom MCP verification

  • Codex MCP configuration

Next

  • CPU monitoring

  • Disk monitoring

  • System information

  • Process monitoring

  • System health

  • Diagnosis

  • Network monitoring

  • Historical metrics

  • Alerts

  • Background monitoring

  • Safe management tools

  • Security

  • Testing

  • Docker

  • Production deployment


πŸ‘¨β€πŸ’» Author

Rakesh Molla

Built as a practical project for learning:

MCP + TypeScript + Node.js + Linux + AI Agents

πŸ“„ License

Add a license before publishing the project publicly.

For example:

MIT License
F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    This MCP server provides read-only Linux system diagnostics tools for inspecting system information, processes, and log snapshots. It enables AI models to analyze Linux system health, troubleshoot issues, and review security through workflow prompts and HTTP transport with API key authentication.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables interaction with Linux system operations via MCP, including CPU, memory, processes, storage, filesystem, hardware, network, monitoring, and logs.
    9
    MIT

View all related MCP servers

Related MCP Connectors

  • A paid remote MCP for agent memory MCP, built to return verdicts, receipts, usage logs, and audit-re

  • Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.

  • MCP server for AI access to Swagger by SmartBear.

View all MCP Connectors

Latest Blog Posts

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/Rylan2022/system-monitor-mcp'

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