Google Cloud Logging
An MCP server for accessing Google Cloud Logging data and services.
Google Cloud Logging MCP Server
A Model Context Protocol (MCP) server that provides access to Google Cloud Logging. This server allows AI assistants to query, search, and analyze logs from Google Cloud Platform projects.
Features
- Query Logs: Search and filter logs across GCP projects
- Get Log Details: Retrieve detailed information about specific log entries
- List Projects: List available GCP projects
Getting Started
Prerequisites
- Bun runtime
- Google Cloud credentials configured
- Access to Google Cloud Logging API
Quick Start
-
Install dependencies:
bun install -
Set up Google Cloud credentials:
# Option 1: Use gcloud CLI gcloud auth application-default login # Option 2: Use service account export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json" -
Set your project ID:
export GOOGLE_CLOUD_PROJECT="your-project-id" -
Run the server:
bun run start
Using with Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"cloud-logging": {
"command": "bun",
"args": ["run", "/path/to/cloud-logging-mcp/src/main.ts"],
"env": {
"GOOGLE_CLOUD_PROJECT": "your-project-id"
}
}
}
}
Example Tool Usage
Query Logs
Search and filter logs from Google Cloud Logging.
{
"tool": "queryLogs",
"input": {
"projectId": "my-project",
"filter": "resource.type=\"cloud_run_revision\" AND severity>=ERROR",
"orderBy": {
"timestamp": "desc"
},
"pageSize": 50
}
}
Parameters:
projectId: GCP project IDfilter: Log filter query (follows GCP logging query syntax)orderBy: Sort order for resultspageSize: Number of results per pagepageToken: Token for paginationresourceNames: Specific log resources to querysummaryFields: Fields to include in the summary
Get Log Detail
Retrieve complete details for a specific log entry.
{
"tool": "getLogDetail",
"input": {
"projectId": "my-project",
"logId": "65f5a7b60000000001234567"
}
}
Parameters:
projectId: GCP project IDlogId: The unique identifier of the log entry
List Projects
List all accessible Google Cloud projects.
{
"tool": "listProjects",
"input": {}
}
Parameters: None
Common Filter Examples
- By severity:
severity>=ERROR - By time range:
timestamp>="2024-01-01T00:00:00Z" - By resource:
resource.type="cloud_run_revision" - By text search:
textPayload:"connection timeout" - Combined:
resource.type="k8s_container" AND severity=ERROR AND timestamp>="2024-01-01T00:00:00Z"
Troubleshooting
- Authentication errors: Ensure your Google Cloud credentials are properly configured
- Permission errors: Check that your account has the
logging.logEntries.listpermission - No results: Verify your filter syntax and that logs exist for your query
Development
# Run tests
bun test
# Type checking
bun run typecheck
# Linting
bun run lint
# Format code
bun run format
Architecture
The server follows a clean architecture pattern:
/adapter: External service integrations (Google Cloud APIs)/domain: Core business logic and data models/port: Interface definitions and MCP tool handlers/util: Utility functions and helpers
License
MIT
संबंधित सर्वर
Autodesk Platform Services
An experimental MCP server providing access to the Autodesk Platform Services (APS) API.
Remote MCP Server (Authless)
A remote MCP server without authentication, deployable on Cloudflare Workers.
Digi Remote Manager MCP
Digi Remote Manager MCP allows users to connect Ai Agents to their Digi Remote Manager account for analyzing fleet data and help with troubleshooting.
SolarWinds Logs
Access and visualize logs from SolarWinds Observability.
MCP Prometheus
Access Prometheus metrics and queries through standardized MCP interfaces.
Cisco Hyperfabric MCP
An MCP server that enables LLMs to interact with Cisco Intersight APIs.
Flutterwave
Interact with the Flutterwave API to manage transactions, generate payment links, and handle customer support.
Dynatrace
An MCP server for the Dynatrace observability platform.
MCP SSH Server
Provides SSH access to remote servers, allowing AI tools to securely connect to your VPS for management.
MCP Gemini CLI
An MCP server for Google's Gemini CLI, allowing AI assistants to leverage Gemini's capabilities.