Provides advanced system monitoring and file search capabilities for macOS, including real-time performance tracking, process analysis, and enhanced file search with Spotlight integration
Leverages macOS Spotlight for fast metadata searches with additional capabilities like deep content search, tag management, and advanced filtering options
Uses SQLite database for storing and analyzing system performance data over time, enabling historical tracking with efficient time-series queries
macOS Tools MCP Server
A MCP server for macOS that provides advanced system monitoring and file search capabilities.
Table of Contents
- Features
- Installation
- Usage
- Available Tools
- Architecture
- Troubleshooting
- Testing the Server
- Security Considerations
- Contributing
- License
- Future Enhancements
Features
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
Prerequisites
- macOS 10.15 or later
- Node.js 18.0.0 or later
- npm or yarn package manager
Setup
- Clone the repository:
- Install dependencies:
- Build the project:
- Make the script executable:
Permissions
For full functionality, the server requires certain permissions:
- Full Disk Access (recommended for file search):
- System Preferences → Security & Privacy → Privacy → Full Disk Access
- Add Terminal or your IDE
- Developer Tools (for process monitoring):
- Install Xcode Command Line Tools if not already installed:
Usage
Starting the Server
Run the MCP server:
Or use it directly:
Claude Desktop Configuration
To use this MCP server with Claude Desktop, you need to add it to your Claude Desktop configuration:
- First, ensure the project is built:
- 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
- macOS:
- Add the macOS Tools server to your configuration:
Note: Replace /Users/tornikegomareli/Development/macos-tools-mcp
with the actual path where you cloned this repository.
- If you already have other MCP servers configured, add the macos-tools configuration to the existing mcpServers object:
- Save the configuration file and restart Claude Desktop.
- You should now see the macOS Tools server available in Claude Desktop with two tools:
system_performance
- Monitor system resourcesenhanced_search
- Advanced file search and tagging
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:
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 includepath
(optional): Root directory for searchmaxResults
(optional): Maximum number of resultstags
(optional): Array of tags to search for or apply
Examples:
Architecture
Project Structure
Key Features
- Native macOS Integration
- Uses native commands (ps, mdfind, xattr) for optimal performance
- Leverages Spotlight index for fast searches
- Supports macOS extended attributes for tagging
- Performance Optimization
- Multi-level caching system
- Debounced operations
- Rate limiting for system calls
- Streaming for large files
- Data Persistence
- SQLite database for performance history
- Configurable data retention
- Efficient time-series queries
Troubleshooting
Common Issues
- Permission Denied Errors
- Ensure the terminal has Full Disk Access
- Some operations may require sudo (temperature monitoring)
- Spotlight Not Finding Files
- Check if Spotlight indexing is enabled
- Verify the search path is not excluded from Spotlight
- High CPU Usage
- Adjust cache TTL values in cache.ts
- Limit search depth and file types
- Use more specific search queries
Debug Mode
Enable debug logging by setting the environment variable:
Security Considerations
- All shell commands are properly escaped to prevent injection
- File paths are validated and normalized
- Sensitive directories can be excluded via configuration
- Rate limiting prevents resource exhaustion
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
- Basic Performance Check:
- Process Analysis:
- File Search:
- System Optimization:
Comprehensive Test Suite
Use this comprehensive prompt to test all features:
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
This server cannot be installed
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.
Related MCP Servers
- -securityAlicense-qualityThis server provides: * Fast file search capabilities using Everything SDK * Windows-specific implementation * Complements existing filesystem servers with specialized search functionalityLast updated -57PythonMIT License
- AsecurityFlicenseAqualityProvides integration with Everything Search Engine allowing powerful file search capabilities through the Model Context Protocol with advanced search options like regex, case sensitivity, and sorting.Last updated -13JavaScript
- -securityAlicense-qualityProvides Claude with real-time system monitoring capabilities, including CPU, memory, disk, network, battery, and internet speed metrics.Last updated -TypeScriptMIT License
- -security-license-qualityProvides fast file searching capabilities across Windows, macOS, and Linux operating systems using platform-specific search technologies.Last updated -PythonMIT License