Skip to main content

Google Cloud Monitoring MCP server

Create a powerful Model Context Protocol (MCP) server for Google Cloud Monitoring to query metrics, manage alerting policies, investigate incidents, configure notification channels, and check uptime across your GCP projects. This integration enables AI agents to automate observability workflows—from creating alerts to snoozing them during maintenance—with secure service account authentication.

Setting up an MCP server

This article covers the standard steps for creating an MCP server in AI Gateway and connecting it to an AI client. The steps are the same for every integration — application-specific details (API credentials, OAuth endpoints, and scopes) are covered in the individual application pages.

Before you begin

You'll need:

  • Access to AI Gateway with permission to create MCP servers
  • API credentials for the application you're connecting (see the relevant application page for what to collect)

Create an MCP server

Find the API in the catalog

  1. Sign in to AI Gateway and select MCP Servers from the left navigation.
  2. Select New MCP Server.
  3. Search for the application you want to connect, then select it from the catalog.

Configure the server

  1. Enter a Name for your server — something descriptive that identifies both the application and its purpose.
  2. Enter a Description so your team knows what the server is for.
  3. Set the Timeout value. 30 seconds works for most APIs; increase to 60 seconds for APIs that return large payloads.
  4. Toggle Production mode on if this server will be used in a live workflow.
  5. Select Next.

Configure authentication

Enter the authentication details for the application. This varies by service — see the Authentication section of the relevant application page for the specific credentials, OAuth URLs, and scopes to use.

Configure security

  1. Set any Rate limits appropriate for your use case and the API's own limits.
  2. Enable Logging if you want AI Gateway to record requests and responses for auditing.
  3. Select Next.

Deploy

Review the summary, then select Deploy. AI Gateway provisions the server and provides a server URL you'll use when configuring your AI client.


Connect to an AI client

Once your server is deployed, you'll need to add it to the AI client your team uses. Select your client for setup instructions:

Tips

  • You can create multiple MCP servers for the same application — for example, a read-only server for reporting agents and a read-write server for automation workflows.
  • If you're unsure which OAuth scopes to request, start with the minimum read-only set and add write scopes only when needed. Most application pages include scope recommendations.
  • You can edit a server's name, description, timeout, and security settings after deployment without redeploying.

Authentication

Google Cloud Monitoring uses OAuth 2.0 with service accounts for API access. Create a service account in your Google Cloud project with the Monitoring Admin role (or Monitoring Viewer for read-only access) and download a JSON key file. In Google Cloud Console, go to IAM & Admin > Service Accounts, create a service account with the appropriate Monitoring role, and download a JSON key.

ValueSetting
Token endpointhttps://oauth2.googleapis.com/token
Scopeshttps://www.googleapis.com/auth/cloud-platform, https://www.googleapis.com/auth/monitoring

Available tools

These tools let AI agents work with metrics, alerts, notifications, uptime checks, and dashboards. Alerting-related tools are listed first so agents can create policies, inspect open incidents, and manage who gets notified.

Alerting

ToolDescription
Create alert policyDefine when to fire an alert (metric threshold, log match, or ratio)
List alert policiesView all alerting policies in a project
Get alert policyRetrieve details of a specific alerting policy
Update alert policyChange thresholds, channels, or enable/disable a policy
Delete alert policyRemove an alerting policy
List alertsView open and closed alert incidents
Get alertInspect a single alert incident and its related policy
Create notification channelAdd an email, Slack, PagerDuty, or other notification endpoint
List notification channelsView configured notification channels
Get notification channelRetrieve channel details and verification status
Update notification channelRename or reconfigure a channel
Delete notification channelRemove a notification channel
Send verification codeDeliver a verification code to a new channel
Verify notification channelConfirm ownership of a channel with the verification code
List channel typesSee which notification channel types are supported
Create snoozeSuppress matching alerts during a maintenance window
List snoozesView active and upcoming snoozes
Get snoozeRetrieve snooze details
Update snoozeExtend or change a snooze window

Metrics and observability

ToolDescription
List time seriesQuery metric data using Monitoring filters
Write time seriesPublish custom metric points
Query with PromQLRun Prometheus-style queries against Cloud Monitoring metrics
List metric descriptorsDiscover available metric types
Get metric descriptorView details for a specific metric
Create metric descriptorRegister a custom metric
Delete metric descriptorRemove a custom metric definition
List monitored resourcesSee resource types you can monitor (VMs, containers, and more)

Uptime, SLOs, and dashboards

ToolDescription
Create uptime checkMonitor an HTTP/HTTPS endpoint for availability
List uptime checksView configured uptime checks
Get uptime checkRetrieve uptime check configuration
Update uptime checkChange path, interval, or other check settings
Delete uptime checkRemove an uptime check
List uptime checker IPsGet IP addresses used by uptime checkers (for firewall allowlists)
Create serviceRegister a service for service-level monitoring
Create SLODefine a service-level objective (for example, 99.9% availability)
List SLOsView SLOs for a service
Create dashboardBuild a custom Monitoring dashboard
List dashboardsView existing dashboards
Get dashboardRetrieve a dashboard definition
Update dashboardChange dashboard layout or widgets
Delete dashboardRemove a dashboard

Tips

Start with alerting policies tied to notification channels your oncall team already uses (email, Slack, or PagerDuty) so new alerts reach the right people immediately.

Use snoozes during planned maintenance instead of disabling policies—alerts resume automatically when the window ends.

Prefer PromQL for ad-hoc metric queries when investigating incidents; it is the modern query path for Cloud Monitoring.

Create uptime checks for customer-facing URLs and allowlist the checker IP ranges in your firewall so checks are not blocked.

Pair this integration with Google Cloud Logging so agents can correlate metric spikes with log evidence for faster root-cause analysis.

Give agents Monitoring Viewer access when they only need to investigate alerts and metrics; use Monitoring Admin when they must create or change policies.