Provides access to Google Cloud Logging, allowing users to query, search, and analyze logs across Google Cloud Platform projects, retrieve specific log entry details, and list available projects.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Cloud Logging MCP ServerShow me the latest ERROR logs in project my-project-id"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 installSet 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
Example Tool Usage
Query Logs
Search and filter logs from Google Cloud Logging.
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.
Parameters:
projectId: GCP project IDlogId: The unique identifier of the log entry
List Projects
List all accessible Google Cloud projects.
Parameters: None
Common Filter Examples
By severity:
severity>=ERRORBy 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.listpermissionNo results: Verify your filter syntax and that logs exist for your query
Development
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