基础架构MCP服务器
使用模型上下文协议(MCP)对Claude Desktop进行人工智能驱动的基础设施监控。
在Claude的帮助下实时监控您的系统——CPU、内存、日志、网络和智能AI驱动的分析。
  
🚀 快速开始
# 1. Install dependencies
pip install -r requirements.txt
# 2. Test the server
python test_client.py
# 3. Configure Claude Desktop
# Edit: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"infra-monitor": {
"command": "python3",
"args": ["-m", "infra_mcp.server"],
"cwd": "/path/to/InfraGPT-MCP"
}
}
}
# 4. Restart Claude Desktop and ask:
# "Check system health"📖 完整安装指南→
✨ 特性
| 特性 | 描述 |
|---|---|
| 🖥️ 系统监控 | 实时CPU、内存、磁盘和进程监控 |
| 📊 日志分析 | 基于AI的系统日志分析(syslog、auth、内核) |
| 🌐 网络监控 | 网络接口、连接和I/O统计信息 |
| 👥 用户管理 | 活动会话和身份验证监控 |
| 🤖 AI洞察 | 使用Google Gemini进行智能分析(可选) |
| 🏥 健康检查 | 自动系统健康评分和建议 |
| 🔒 模拟模式 | 无需外部API依赖项的完整功能 |
🛠️ 可用工具
通过Claude Desktop可访问的7个强大工具:
get_system_info-CPU、内存、磁盘指标get_service_status-流程和服务监控get_user_info-用户会话和活动get_logs-系统日志检索get_network_info-网络接口和连接analyze_logs-基于AI的日志分析health_check-综合系统健康评估
💡 使用示例
系统健康检查:
You: Check the overall system health
Claude: ✅ System Health Score: 8/10
CPU: 15%, Memory: 46%, Disk: 10%...日志分析:
You: Analyze recent logs for security issues
Claude: 🔒 Security Analysis: No threats detected
Found 3 authentication events...服务监控:
You: What services are using the most CPU?
Claude: Top processes: WindowServer (3.2%), Docker (1.8%)...📚 文档
🔧 需求
- 操作系统: macOS 11+或Linux
- python 3.8或更高
- 克劳德桌面: 最新版本
- 可选: 用于真实人工智能分析的Google Gemini API密钥
🎯 建筑
Claude Desktop (MCP Client)
↓ JSON-RPC over stdio
Infrastructure MCP Server
↓ Uses
System Resources (psutil)
↓ Optional
Google Gemini API🔐 安全与隐私
- ✅ 作为用户进程运行(不需要root)
- ✅ 本地处理优先
- ✅ 无数据存储(临时分析)
- ✅ 可选外部API(Gemini)
- ✅ 优雅的权限处理
🧪 测试
# Run comprehensive tests
python test_client.py
# Expected output:
# ✅ 7 tools available
# ✅ All tests passed🐛 故障排除
服务器未加载?
- 检查Claude Desktop配置语法
- 验证Python是否可访问
- 审核日志:
tail -f ~/Library/Logs/Claude/mcp.log
权限错误?
- 正常-服务器处理得当
- 某些日志需要提升权限
需要帮助? 看 故障排除指南
🤝 贡献
欢迎投稿!这个项目遵循标准的开源实践。
📄 许可证
MIT许可证-请参阅 许可证 文件以获取详细信息。
🌟 项目状态
版本: 1.0.0\ 状态: ✅ 生产就绪\ MCP协议: 2025-06-18\ 最后更新时间: 2025年11月21日
______________________________________________________________________
准备好开始了吗? → 快速入门指南
问题? → 文档
