macOS Tools MCP Server

macOS Tools MCP Server

Provides advanced system monitoring and file search capabilities for macOS, allowing users to track performance metrics and perform enhanced file searches with content analysis and tagging features.

Category
访问服务器

README

macOS Internal Tools MCP Server

A MCP server for macOS that provides advanced system monitoring and file search capabilities.

<img src="https://github.com/user-attachments/assets/45d755c8-a280-4d83-bc11-dd97eef9c662" width="400" alt="MCP Server Screenshot">

smithery badge

Table of Contents

System Performance Monitor

  • Real-time Monitoring: Track CPU, memory, disk I/O, and network statistics
  • Process Analysis: View top resource-consuming processes with detailed metrics
  • Historical Tracking: Store and analyze performance data over time using SQLite
  • Optimization Suggestions: Get intelligent recommendations to improve system performance

Enhanced File Search

  • Deep Content Search: Search within file contents using regex or plain text
  • Spotlight Integration: Leverage macOS Spotlight for fast metadata searches
  • Tag Management: Create, search, and manage custom file tags using extended attributes
  • Advanced Features: Fuzzy matching, boolean operators, and file type filtering

Installation

Requirements

  • macOS 10.15 or later
  • Node.js 18.0.0 or later
  • npm or yarn package manager

Permissions

For full functionality, the server requires certain permissions:

  1. Full Disk Access (recommended for file search):

    • System Preferences → Security & Privacy → Privacy → Full Disk Access
    • Add Terminal
  2. Developer Tools (for process monitoring):

    • Install Xcode Command Line Tools if not already installed:
    xcode-select --install
    

How to install

Claude Desktop Configuration

To use this MCP server with Claude Desktop:

  1. Open your Claude Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. Add the macOS Tools server to your configuration:

{
  "mcpServers": {
    "macos-tools": {
      "command": "npx",
      "args": [
        "@tgomareli/macos-tools-mcp"
      ],
      "env": {}
    }
  }
}
  1. If you already have other MCP servers configured, add the macos-tools configuration to the existing mcpServers object:
{
  "mcpServers": {
    "existing-server": {
      // ... existing configuration
    },
    "macos-tools": {
      "command": "npx",
      "args": [
        "@tgomareli/macos-tools-mcp"
      ],
      "env": {}
    }
  }
}
  1. Save the configuration file and restart Claude Desktop.

  2. You should now see the macOS Tools server available in Claude Desktop with two tools:

    • system_performance - Monitor system resources
    • enhanced_search - Advanced file search and tagging

MCP Installer

Or you can use mcp-installer for installing it directly, without opening config files.

Just type in claude

Hey Claude, install the MCP server named macos-tools-mcp

Available Tools

system_performance

Monitor and analyze system performance metrics.

Parameters:

  • action (required): "current" | "history" | "processes" | "optimize"
  • timeRange (optional): Time range for historical data ("1h", "24h", "7d")
  • metric (optional): Specific metric to analyze ("cpu", "memory", "disk", "network", "all")

Examples:

await callTool("system_performance", {
  action: "current",
  metric: "all"
});

await callTool("system_performance", {
  action: "history",
  timeRange: "24h",
  metric: "memory"
});

await callTool("system_performance", {
  action: "processes",
  metric: "cpu"
});

await callTool("system_performance", {
  action: "optimize"
});

enhanced_search

Advanced file search with content analysis and tagging capabilities.

Parameters:

  • action (required): "search" | "tag" | "untag"
  • query (optional): Search query (supports regex)
  • searchType (optional): "content" | "filename" | "tags" | "regex"
  • fileTypes (optional): Array of file extensions to include
  • path (optional): Root directory for search
  • maxResults (optional): Maximum number of results
  • tags (optional): Array of tags to search for or apply

Examples:

// Search for TODO comments in code files
await callTool("enhanced_search", {
  action: "search",
  query: "TODO|FIXME",
  searchType: "regex",
  fileTypes: ["js", "ts", "py"],
  path: "~/Projects"
});

await callTool("enhanced_search", {
  action: "tag",
  path: "~/Documents/important.pdf",
  tags: ["urgent", "project-x"]
});

await callTool("enhanced_search", {
  action: "search",
  searchType: "tags",
  tags: ["urgent"],
  path: "~/Documents"
});

await callTool("enhanced_search", {
  action: "search",
  query: "apiKey",
  searchType: "content",
  fileTypes: ["json", "env"],
  path: "~/Projects",
  maxResults: 50
});

Key Features

  1. Native macOS Integration

    • Uses native commands (ps, mdfind, xattr) for optimal performance
    • Leverages Spotlight index for fast searches
    • Supports macOS extended attributes for tagging
  2. Performance Optimization

    • Multi-level caching system
    • Debounced operations
    • Rate limiting for system calls
    • Streaming for large files
  3. Data Persistence

    • SQLite database for performance history
    • Configurable data retention
    • Efficient time-series queries

License

MIT License - see LICENSE file for details

Testing the Server

Once you've configured the server in Claude Desktop, you can use these prompts to test all functionality:

Quick Test Prompts

  1. Basic Performance Check:

    Show me my current system performance metrics
    
  2. Process Analysis:

    What are the top 5 CPU-consuming processes on my system?
    
  3. File Search:

    Search for TODO comments in JavaScript files in my current directory
    
  4. System Optimization:

    Analyze my system and suggest performance optimizations
    

Comprehensive Test Suite

Use this comprehensive prompt to test all features:

I want to test the macOS Tools MCP server. Please help me:

1. **System Performance Testing**:
   - Show me the current system performance metrics (CPU, memory, disk, network)
   - Display the top 5 processes consuming the most CPU
   - Show me memory usage history for the last hour
   - Analyze my system and provide optimization suggestions
   - Get the top memory-consuming processes

2. **File Search Testing**:
   - Search for all JavaScript and TypeScript files containing "TODO" or "FIXME" comments in my home directory
   - Find all files with "test" in their filename in the current project directory
   - Search for files containing the word "password" in configuration files (.json, .env, .yml)
   - Use regex to find all email addresses in text files
   - Search for files modified in the last 24 hours

3. **Tag Management Testing**:
   - Tag this file with "important" and "reviewed": /Users/tornikegomareli/Development/macos-tools-mcp/README.md
   - Search for all files tagged with "important"
   - Remove the "reviewed" tag from the README file
   - Tag all TypeScript files in the src directory with "source-code"

4. **Combined Operations**:
   - Monitor system performance while performing a large file search
   - Find resource-intensive processes and then search for their log files
   - Show current disk usage and search for large files (> 100MB)

5. **Edge Cases**:
   - Search in a non-existent directory
   - Try to tag a file I don't have permission to modify
   - Request performance data for an invalid time range
   - Search with an invalid regex pattern

Expected Behaviors

  • Performance Monitor: Should return real-time metrics, process lists, historical data, and optimization suggestions
  • File Search: Should find files by content, name, or tags, with support for regex patterns
  • Tag Operations: Should successfully add/remove tags and search by them
  • Error Handling: Should gracefully handle permission errors, invalid paths, and malformed queries

Future Enhancements

  • [ ] GPU monitoring support
  • [ ] Network connection analysis
  • [ ] Application-specific performance tracking
  • [ ] Integration with Time Machine for file version search

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选