System Diagnostics MCP Server
by niketanjain
README.md
# System Diagnostics MCP Server
This is a Python-based Model Context Protocol (MCP) server. It provides diagnostic capabilities:
1. `get_system_metrics`: Retrieves real-time CPU, Memory, and Disk usage metrics.
2. `list_top_processes`: Lists top running processes sorted by CPU or Memory usage.
3. `check_port_status`: Verifies if a specific TCP port is open on a given host.
## Prerequisites
- Python 3.10+
- [uv](https://github.com/astral-sh/uv) (for ultra-fast dependency management)
- Docker (optional, for containerized execution)
## Local Setup (Using uv)
1. Clone the repository and navigate into the folder:
```bash
git clone https://github.com/niketanjain/mcp-server-setup.git
cd mcp-server-setup
```
2. Initialize the virtual environment and install dependencies:
```bash
uv sync
# OR if no lockfile:
uv pip install mcp psutil pydantic starlette uvicorn
```
3. Run the server locally:
```bash
uv run python server.py
```
The server will start an HTTP/SSE server on `http://localhost:6500/sse`.
## Running with Docker
1. Build the Docker image:
```bash
docker build -t mcp-sysdiag-server .
```
2. Run the Docker container, exposing port 6500:
```bash
docker run -p 6500:6500 mcp-sysdiag-server
```
## Extending to Production
Check out [production-grade.md](./production-grade.md) for recommendations and best practices when extending this MCP server to a production environment.