Design · MODEL CONTEXT PROTOCOL

srtux mcp

srtux mcp is a community-listed Model Context Protocol server. Review the source repository before installation.

WHAT IT CONNECTS

srtux mcp 为 AI Agent 提供什么

  • **Natural language to LQL translation** using Vertex AI Gemini 2.5
  • **Flexible log querying**: filter on monitored resource, log name, severity, time, and more
  • **REST API** for easy integration
  • **Ready for deployment** on Google Cloud Run or GKE
  • OpenAPI/Swagger docs available at `/docs` and `/openapi.json` when running.
  • Both endpoints are also discoverable as MCP tools for agent frameworks (Smithery, Claude Desktop, etc).
  • Example test script: `test_main.py` (see repo)
  • Standard Python ignores included (see repo)
  • **Build the Docker image:**
  • **Deploy to Cloud Run:**
  • **Set Environment Variables:**
  • In the Cloud Run deployment UI or with the `--set-env-vars` flag, provide:
  • `VERTEX_PROJECT=your-gcp-project-id`
  • `VERTEX_LOCATION=us-central1` (or your region)
  • **Credentials:**
  • Prefer using the Cloud Run service account with the right IAM roles (Logging Viewer, Vertex AI User).
  • You usually do NOT need to set `GOOGLE_APPLICATION_CREDENTIALS` on Cloud Run unless using a non-default service account key.
  • **IAM Permissions:**
  • Ensure the Cloud Run service account has:
  • `roles/logging.viewer`
  • `roles/aiplatform.user`
  • **Accessing the Service:**
  • After deployment, Cloud Run will provide a service URL (e.g., `https://mcp-logging-server-xxxxxx.a.run.app`).
  • Use this as your `$MCP_BASE_URL` in API requests.
  • **Create a Service Account:**
  • Go to the [Google Cloud Console → IAM & Admin → Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts).
  • Select your project.
  • Create or select a service account with permissions: _Logging Viewer_ and _Vertex AI User_.
  • **Create and Download a Key:**
  • In the Service Account, click "Manage keys" → "Add key" → "Create new key" (choose JSON).
  • Download the JSON key file to your computer.
  • **Set the Environment Variable:**
  • In your terminal, set the environment variable to the path of your downloaded key:
  • Replace `/path/to/your/service-account-key.json` with the actual path.
  • **(Optional) Set Project and Location:**
  • You may also need:
  • **Verify Authentication:**
  • Run a simple `gcloud` or Python client call to ensure authentication is working.
  • If you see `DefaultCredentialsError`, check your environment variable and file path.
  • Python 3.9+
  • Google Cloud project with Logging and Vertex AI APIs enabled
  • Service account with permissions for Logging Viewer and Vertex AI User
  • Set environment variables:
  • `VERTEX_PROJECT`: Your GCP project ID
  • `VERTEX_LOCATION`: Vertex AI region (default: `us-central1`)
  • `GOOGLE_APPLICATION_CREDENTIALS`: Path to your service account JSON key file
  • Show all logs from Kubernetes clusters
  • Show error logs from Compute Engine and AWS EC2 instances
  • Find Admin Activity audit logs for project my-project
  • Find logs containing the word unicorn
  • Find logs with both unicorn and phoenix
  • Find logs where textPayload contains both unicorn and phoenix
  • Find logs where textPayload contains the phrase 'unicorn phoenix'
  • Show logs from yesterday for Cloud Run service 'my-service'
  • Show logs from the last 30 minutes
  • Show logs for logName containing request_log in GKE
  • Show logs where pod_name matches foo or bar using regex
  • Show logs for Compute Engine where severity is WARNING or higher
  • Show logs for Cloud SQL instances in us-central1
  • Show logs for Pub/Sub topics containing 'payments'
  • Show logs for log entries between two timestamps
  • Show logs where jsonPayload.message matches regex 'foo.*bar'
  • Show logs where labels.env is not prod

SECURITY

MCP 收录不等于安全审核

MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。