Google Cloud Logging MCP Server

Google Cloud Logging MCP Server

Enables 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.

Category
Visit Server

README

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

  1. Install dependencies:

    bun install
    
  2. 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"
    
  3. Set your project ID:

    export GOOGLE_CLOUD_PROJECT="your-project-id"
    
  4. 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 ID
  • filter: Log filter query (follows GCP logging query syntax)
  • orderBy: Sort order for results
  • pageSize: Number of results per page
  • pageToken: Token for pagination
  • resourceNames: Specific log resources to query
  • summaryFields: 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 ID
  • logId: 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

  1. Authentication errors: Ensure your Google Cloud credentials are properly configured
  2. Permission errors: Check that your account has the logging.logEntries.list permission
  3. 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured