](https://mseep.ai/app/tornikegomareli-macos-tools-mcp-server)
macOS内部工具MCP服务器
适用于macOS的MCP服务器,提供高级系统监控和文件搜索功能。
](https://smithery.ai/server/@tornikegomareli/macos-tools-mcp-server)
目录
- Claude桌面配置 - MCP安装程序
系统性能监视器
- 实时监控:跟踪CPU、内存、磁盘I/O和网络统计信息
- 过程分析:查看具有详细指标的顶级资源消耗流程
- 历史跟踪:使用SQLite存储和分析随时间变化的性能数据
- 优化建议:获取智能建议以提高系统性能
增强的文件搜索
- 深度内容搜索:使用正则表达式或纯文本在文件内容中搜索
- 聚光灯集成:利用macOS Spotlight进行快速元数据搜索
- 标签管理:使用扩展属性创建、搜索和管理自定义文件标记
- 高级功能:模糊匹配、布尔运算符和文件类型过滤
安装
需求
- macOS 10.15或更高版本
- Node.js 18.0.0或更高版本
- npm或yarn包管理器
权限
为了实现完整功能,服务器需要某些权限:
- 全磁盘访问 (建议用于文件搜索):
- 系统首选项→ 安全与隐私→ 隐私→ 全磁盘访问 - 添加终端
- 开发者工具 (用于过程监控):
- 如果尚未安装Xcode命令行工具,请安装:
xcode-select --install如何安装
Claude桌面配置
要将此MCP服务器与Claude Desktop一起使用:
- 打开您的Claude Desktop配置文件:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - 窗户: %APPDATA%\Claude\claude_desktop_config.json - Linux: ~/.config/Claude/claude_desktop_config.json
- 将macOS Tools服务器添加到您的配置中:
{
"mcpServers": {
"macos-tools": {
"command": "npx",
"args": [
"@tgomareli/macos-tools-mcp"
],
"env": {}
}
}
}- 如果您已经配置了其他MCP服务器,请将macos工具配置添加到现有的mcpServers对象中:
{
"mcpServers": {
"existing-server": {
// ... existing configuration
},
"macos-tools": {
"command": "npx",
"args": [
"@tgomareli/macos-tools-mcp"
],
"env": {}
}
}
}- 保存配置文件并重新启动Claude Desktop。
- 现在,您应该可以在Claude Desktop中看到macOS Tools服务器,其中包含两个工具:
- system_performance -监控系统资源 - enhanced_search -高级文件搜索和标记
MCP安装程序
或者你可以使用 mcp安装程序 无需打开配置文件即可直接安装。
只需输入claude
嘿,克劳德,安装名为macos tools MCP的MCP服务器
可用工具
系统性能
监控和分析系统性能指标。
参数:
action(必填):“当前”|“历史”|“流程”|“优化”timeRange(可选):历史数据的时间范围(“1h”、“24h”、“7d”)metric(可选):要分析的特定指标(“cpu”、“内存”、“磁盘”、“网络”、“所有”)
示例:
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"
});增强搜索
具有内容分析和标记功能的高级文件搜索。
参数:
action(必填):“搜索”|“标记”|“取消标记”query(可选):搜索查询(支持正则表达式)searchType(可选):“内容”|“文件名”|“标签”|“正则表达式”fileTypes(可选):要包含的文件扩展名数组path(可选):用于搜索的根目录maxResults(可选):最大结果数tags(可选):要搜索或应用的标签数组
示例:
// 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
});主要特点
- 原生macOS集成
- 使用本机命令(ps、mdfind、xatr)以获得最佳性能 - 利用Spotlight索引进行快速搜索 - 支持macOS扩展属性进行标记
- 性能优化
- 多级缓存系统 - 取消公告的行动 - 系统调用的速率限制 - 大文件流式传输
- 数据持久层
- 用于性能历史记录的SQLite数据库 - 可配置的数据保留 - 高效的时间序列查询
许可证
MIT许可证-有关详细信息,请参阅许可证文件
测试服务器
在Claude Desktop中配置服务器后,您可以使用以下提示测试所有功能:
快速测试提示
- 基本性能检查:
Show me my current system performance metrics- 过程分析:
What are the top 5 CPU-consuming processes on my system?- 文件搜索:
Search for TODO comments in JavaScript files in my current directory- 系统优化:
Analyze my system and suggest performance optimizations综合测试套件
使用此综合提示测试所有功能:
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预期行为
- 性能监视器:应返回实时指标、流程列表、历史数据和优化建议
- 文件搜索:应按内容、名称或标签查找文件,并支持正则表达式模式
- 标签操作:应成功添加/删除标签并按其搜索
- 错误处理:应妥善处理权限错误、无效路径和格式错误的查询
未来的增强功能
- \[\]GPU监控支持
- \[\]网络连接分析
- \[\]特定于应用程序的性能跟踪
- \[\]与Time Machine集成以进行文件版本搜索
