PM

pratyay/mac-monitor-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

23 stars 6 forks 质量 49 趋势 10

一个模型上下文协议(MCP)服务器,用于识别macOS上跨CPU、内存和网络使用的资源密集型进程。

概览

一个模型上下文协议(MCP)服务器,用于识别macOS上跨CPU、内存和网络使用的资源密集型进程。 Fronteir AI 上提供了托管部署。 MacOS 资源监控器是一款轻量级的 MCP 服务器,它通过 MCP 端点来监控系统资源。它分析 CPU、内存和网络使用情况,识别 Mac 上资源最耗费的进程,并以结构化 JSON 格式返回数据。 - macOS 操作系统 - Python 3.10+ - MCP 服务器库 使用UV全局安装MCP服务器以实现系统范围访问: 现在你可以从任何地方运行服务器: 2. 创建虚拟环境(推荐): 如果你是从项目目录运行:

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,用于识别macOS上跨CPU、内存和网络使用的资源密集型进程。

托管部署

Fronteir AI 上提供了托管部署。

概述

MacOS 资源监控器是一款轻量级的 MCP 服务器,它通过 MCP 端点来监控系统资源。它分析 CPU、内存和网络使用情况,识别 Mac 上资源最耗费的进程,并以结构化 JSON 格式返回数据。

要求

  • macOS 操作系统
  • Python 3.10+
  • MCP 服务器库

安装

选项1:全局安装(推荐)

使用UV全局安装MCP服务器以实现系统范围访问:

现在你可以从任何地方运行服务器:

选项2:开发安装

  1. 克隆此仓库:

  2. 创建虚拟环境(推荐):

  3. 安装所需的依赖:

用途

全球安装

如果你全局安装时用了UV:

开发安装

如果你是从项目目录运行:

或者用 uv run(来自 project 目录):

你应该看看这条信息:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MacOS Resource Monitor MCP Server

A Model Context Protocol (MCP) server that identifies resource-intensive processes on macOS across CPU, memory, and network usage.

Hosted deployment

A hosted deployment is available on Fronteir AI.

Overview

MacOS Resource Monitor is a lightweight MCP server that exposes an MCP endpoint for monitoring system resources. It analyzes CPU, memory, and network usage, and identifies the most resource-intensive processes on your Mac, returning data in a structured JSON format.

Requirements

  • macOS operating system
  • Python 3.10+
  • MCP server library

Installation

Install the MCP server globally using uv for system-wide access:

git clone https://github.com/Pratyay/mac-monitor-mcp.git
cd mac-monitor-mcp
uv tool install .

Now you can run the server from anywhere:

mac-monitor

Option 2: Development Installation

  1. Clone this repository:

    git clone https://github.com/Pratyay/mac-monitor-mcp.git
    cd mac-monitor-mcp
    
  2. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  
    
  3. Install the required dependencies:

    pip install mcp
    

Usage

Global Installation

If you installed globally with uv:

mac-monitor

Development Installation

If you’re running from the project directory:

python src/mac_monitor/monitor.py

Or using uv run (from project directory):

uv run mac-monitor

You should see the message:

Simple MacOS Resource Monitor MCP server starting...
Monitoring CPU, Memory, and Network resource usage...

The server will start and expose the MCP endpoint, which can be accessed by an LLM or other client.

Available Tools

The server exposes three tools:

1. get_resource_intensive_processes()

Returns information about the top 5 most resource-intensive processes in each category (CPU, memory, and network).

2. get_processes_by_category(process_type, page=1, page_size=10, sort_by="auto", sort_order="desc")

Returns all processes in a specific category with advanced filtering, pagination, and sorting options.

Parameters:

  • process_type: "cpu", "memory", or "network"
  • page: Page number (starting from 1, default: 1)
  • page_size: Number of processes per page (default: 10, max: 100)
  • sort_by: Sort field - "auto" (default metric), "pid", "command", or category-specific fields:
    • CPU: "cpu_percent", "pid", "command"
    • Memory: "memory_percent", "resident_memory_kb", "pid", "command"
    • Network: "network_connections", "pid", "command"
  • sort_order: "desc" (default) or "asc"

Example Usage:

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →