loading…
Search for a command to run...
loading…
Enables diagnosis of Google Cloud Platform logs using Gemini AI via MCP tools, fetching logs from Cloud Logging for issue analysis and root cause identification
Enables diagnosis of Google Cloud Platform logs using Gemini AI via MCP tools, fetching logs from Cloud Logging for issue analysis and root cause identification.
This project provides tools for diagnosing Google Cloud Platform (GCP) logs using the Model Context Protocol (MCP) and Google Gemini AI.
diagnose.py: A script that uses Gemini AI to analyze GCP logs fetched via MCP tools. It diagnoses issues, identifies root causes, and suggests fixes.log_mcp_server.py: An MCP server that exposes tools for fetching logs from GCP Cloud Logging.Clone or download the project files.
Install dependencies:
pip install -r requirements.txt
Set up environment variables in a .env file:
GEMINI_API_KEY=your_gemini_api_key_here
Ensure your Google Cloud credentials are configured (e.g., via gcloud auth application-default login).
Run the diagnosis:
python diagnose.py
The diagnose.py script is configured to fetch the last 2 hours of ERROR and CRITICAL logs from Cloud Run and provide a diagnosis. You can modify the query in the script or extend it for other resource types.
python-dotenv: For loading environment variablesgoogle-generativeai: For interacting with Gemini AIfastmcp: For MCP client and server functionalitygoogle-cloud-logging: For accessing GCP Cloud Logging[Add license information if applicable]
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"gcp-mcp-log-diagnostics": {
"command": "npx",
"args": []
}
}
}