GCP MCP Log Diagnostics
GCP MCP 日志诊断
本项目提供了一套使用模型上下文协议 (MCP) 和 Google Gemini AI 诊断 Google Cloud Platform (GCP) 日志的工具。
概述
diagnose.py:一个使用 Gemini AI 分析通过 MCP 工具获取的 GCP 日志的脚本。它可以诊断问题、识别根本原因并提出修复建议。log_mcp_server.py:一个 MCP 服务器,提供用于从 GCP Cloud Logging 获取日志的工具。
Related MCP server: GCP Billing and Monitoring MCP Server
先决条件
Python 3.8+
具有 Cloud Logging 相应权限的 Google Cloud 项目
Gemini API 密钥
设置
克隆或下载项目文件。
安装依赖项:
pip install -r requirements.txt在
.env文件中设置环境变量:GEMINI_API_KEY=your_gemini_api_key_here确保已配置 Google Cloud 凭据(例如,通过
gcloud auth application-default login)。运行诊断:
python diagnose.py
使用方法
diagnose.py 脚本配置为获取 Cloud Run 过去 2 小时的 ERROR 和 CRITICAL 日志并提供诊断结果。您可以修改脚本中的查询语句或将其扩展到其他资源类型。
依赖项
python-dotenv:用于加载环境变量google-generativeai:用于与 Gemini AI 交互fastmcp:用于 MCP 客户端和服务器功能google-cloud-logging:用于访问 GCP Cloud Logging
许可证
[如果适用,请添加许可证信息]
This server cannot be deployed
Maintenance
Related MCP Connectors
Query application logs, traces, and metrics from your AI coding assistant via Foam's MCP server.
MCP-native AI SRE: ask what's broken in production, get a reviewed GitHub fix PR.
The Google GKE MCP server is a managed Model Context Protocol server that provides AI applications with tools to manage Google Kubernetes Engine (GKE) clusters and Kubernetes resources. It exposes a structured, discoverable interface that allows AI agents to interact with GKE and Kubernetes APIs, enabling them to inspect cluster configurations, retrieve Kubernetes resource YAMLs, monitor operations like cluster upgrades, diagnose issues, and optimize costs—all without needing to parse text output or use complex kubectl commands.
Remote MCP for Gemini upgrade evals, prompt regressions, output diffs, and eval receipts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Google Cloud Platform services for log analysis and root cause investigation. Provides tools to query Cloud Logging, detect error patterns, and perform real-time log streaming across multiple GCP projects.MIT
- AlicenseCqualityDmaintenanceEnables interaction with Google Cloud services including billing cost analysis, log querying, and metrics monitoring through natural language commands. Provides comprehensive tools for managing GCP resources, analyzing costs, detecting anomalies, and retrieving operational insights.401Apache 2.0
- AlicenseNot gradedqualityFmaintenanceEnables AI assistants to query, search, and analyze logs across Google Cloud Platform projects. It supports advanced filtering by severity or resource type and provides detailed log entry retrieval and project listing capabilities.143 npm11MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to autonomously query AWS CloudWatch Logs and perform structured root-cause analysis via natural language prompts, using MCP tools for log group listing and Insights queries.MIT