Grafana Cloud

Grafana Cloud MCP server

The Grafana Cloud MCP server is a remotely hosted Model Context Protocol (MCP) server that lets external AI agents connect directly to your Grafana Cloud data. MCP-compatible clients, for example, Cursor, Claude Desktop, Windsurf, and Goose, can query metrics, logs, and other observability data from your Grafana environment without any local installation.

Unlike the open source Grafana MCP server, which runs locally and requires manual service account token configuration, the Grafana Cloud MCP server is fully hosted and uses OAuth 2.1 authorization. You point your AI agent at the Grafana Cloud MCP endpoint, authorize in your browser, and your agent connects.

Note

The Grafana Cloud MCP server is part of Grafana Assistant. For details about the Assistant roles it requires, how it counts toward Assistant usage and billing, and how to review and revoke connections, refer to Grafana Cloud MCP server for AI agents in the Assistant documentation.

If you’re trying to connect Grafana Assistant to external MCP servers instead, refer to Connect Assistant to MCP servers.

How Grafana Cloud MCP differs from the local OSS server

The following table compares the Grafana Cloud MCP server with the local OSS MCP server.

AspectGrafana Cloud MCP serverLocal OSS MCP server
InstallationNone required. Fully hosted.Requires local installation and configuration.
AuthenticationOAuth 2.1 authorization flow.Manual authentication (user/password or service account token).
Access scopeUser-scoped. The agent has only the permissions your Grafana RBAC grants you.Service account-scoped. Access is determined by the service account token.
DeploymentGrafana Cloud only.Any Grafana instance (Cloud or self-managed).

Before you begin

Ensure you have the following:

  • Grafana Cloud: The Grafana Cloud MCP server works only with hosted Grafana Cloud environments. If you use self-managed Grafana, use the local OSS MCP server
  • Grafana Assistant terms: Make sure Grafana Assistant is available for your stack and accept its terms before you connect the Grafana Cloud MCP server. Depending on your Grafana Cloud agreement, the terms might be accepted automatically when you first use an Assistant feature in Grafana, or by an administrator in plugin settings
  • Permissions: You need Assistant roles to connect an agent and to grant write access. Refer to Roles and permissions for details
  • MCP client: You need an MCP-compatible client, for example, Cursor, Claude Desktop, Windsurf, or Goose. To use interactive charts and alert apps, your client must also support MCP Apps

Note

Each user who connects through Grafana Cloud MCP counts as a Grafana Assistant active user. Refer to Usage and billing for details.

Connect your AI agent

The Grafana Cloud MCP server endpoint is https://mcp.grafana.com/mcp. Use the Streamable HTTP transport type, because SSE isn’t supported. Find your client in the sections below.

In the examples, replace <your-stack> with your Grafana Cloud stack name. Setting your stack, either in the X-Grafana-URL header or in the endpoint path, is optional but recommended. It skips the URL entry step during authorization and redirects you directly to the consent page.

After you configure your client:

  1. If you edited a configuration file, restart the client so that it picks up the change. Some clients, for example, Claude Desktop with claude_desktop_config.json, reload only after you quit them completely, not when you close the window.
  2. Run a prompt in your AI agent that requires Grafana data.
  3. When prompted, authorize the connection in your browser. For the choices on the consent page, refer to Configure access.

Your AI agent is now connected to your Grafana data.

Claude Code

Run the following in your terminal:

Bash
claude mcp add grafana https://mcp.grafana.com/mcp \
  --transport http \
  --header "X-Grafana-URL: https://<your-stack>.grafana.net"

Cursor

For a one-click install, select Install Grafana MCP in Cursor.

To configure it yourself, go to Settings > Features > MCP > + Add New MCP Server, or add the following to .cursor/mcp.json:

JSON
{
  "mcpServers": {
    "grafana": {
      "url": "https://mcp.grafana.com/mcp",
      "headers": {
        "X-Grafana-URL": "https://<your-stack>.grafana.net"
      }
    }
  }
}

Codex

Add the following to ~/.codex/config.toml:

toml
[mcp_servers.grafana]
url = "https://mcp.grafana.com/mcp"
http_headers = { "X-Grafana-URL" = "https://<your-stack>.grafana.net" }

Then run codex mcp login grafana to authorize.

VS Code

Add the following to .vscode/mcp.json in your workspace:

JSON
{
  "servers": {
    "grafana": {
      "type": "http",
      "url": "https://mcp.grafana.com/mcp",
      "headers": {
        "X-Grafana-URL": "https://<your-stack>.grafana.net"
      }
    }
  }
}

Claude Desktop

Grafana Labs publishes a Grafana Cloud MCP connector in the Claude connectors directory. Use it unless you need to set the URL yourself:

  1. Open the Grafana Cloud MCP connector in Claude, or go to Customize > Connectors, select Browse connectors, and find Grafana Cloud MCP by Grafana Labs.
  2. Select Connect.
  3. Authorize the connection in your browser, and enter your Grafana Cloud stack URL when prompted.

On Team and Enterprise plans, a Claude administrator must add the connector for the organization before members can connect. If you see Request instead of Connect, ask your Claude administrator to add it. Refer to Use connectors to extend Claude’s capabilities for details.

You can’t change the directory connector’s URL or add headers. To put your stack in the URL, or to connect more than one stack, add a custom connector instead:

  1. Go to Customize > Connectors and select Add > Add custom connector.
  2. Enter a name, for example Grafana, and set the URL to https://mcp.grafana.com/mcp/<your-stack>.grafana.net.
  3. Select Continue and follow the prompts to finish adding the connector.

On Team and Enterprise plans, only a Claude administrator can add a custom connector. It applies to everyone in the organization, so each custom connector points all members at the same stack. Refer to Get started with custom connectors for details.

To use claude_desktop_config.json instead, declare a local proxy in it. The proxy runs as a local process launched by Claude Desktop, forwards MCP traffic to https://mcp.grafana.com/mcp, and handles the OAuth flow. Several open source proxies do this. They’re maintained outside Grafana, so refer to their own documentation for setup and support.

Windsurf

Add the following to ~/.codeium/windsurf/mcp_config.json:

JSON
{
  "mcpServers": {
    "grafana": {
      "url": "https://mcp.grafana.com/mcp",
      "headers": {
        "X-Grafana-URL": "https://<your-stack>.grafana.net"
      }
    }
  }
}

Other clients

Any other MCP-compatible client uses the same values:

SettingValue
Endpointhttps://mcp.grafana.com/mcp
Transport typeStreamable HTTP
Optional headerX-Grafana-URL: https://<your-stack>.grafana.net

Most clients express this as JSON in the following shape:

JSON
{
  "mcpServers": {
    "grafana": {
      "url": "https://mcp.grafana.com/mcp",
      "headers": {
        "X-Grafana-URL": "https://<your-stack>.grafana.net"
      }
    }
  }
}

Key names vary between clients. Some use servers instead of mcpServers, and some require an explicit "type": "http" field, as in the VS Code example above. Refer to your client’s documentation for the exact file location and key names.

Connect multiple stacks

You can connect more than one Grafana Cloud stack to the same MCP client, for example, a production stack and a staging stack. Add a separate server entry for each stack, and put the stack’s host in the endpoint path instead of using the X-Grafana-URL header: https://mcp.grafana.com/mcp/<your-stack>.grafana.net.

Don’t reuse the same https://mcp.grafana.com/mcp endpoint with a different X-Grafana-URL header for each stack. Some clients, for example, Cursor and Claude Code, treat entries that share an endpoint as duplicates and load only one of them.

Each entry authorizes separately and keeps its own credentials, so you approve access once per stack. The stack in the path also skips the URL entry step during authorization. Give each entry a name that identifies its stack, so it’s clear which stack your agent is querying.

Cursor
{
  "mcpServers": {
    "grafana-prod": {
      "url": "https://mcp.grafana.com/mcp/<prod-stack>.grafana.net"
    },
    "grafana-staging": {
      "url": "https://mcp.grafana.com/mcp/<staging-stack>.grafana.net"
    }
  }
}
Claude-Code
claude mcp add grafana-prod https://mcp.grafana.com/mcp/<prod-stack>.grafana.net --transport http
claude mcp add grafana-staging https://mcp.grafana.com/mcp/<staging-stack>.grafana.net --transport http
Codex
[mcp_servers.grafana-prod]
url = "https://mcp.grafana.com/mcp/<prod-stack>.grafana.net"

[mcp_servers.grafana-staging]
url = "https://mcp.grafana.com/mcp/<staging-stack>.grafana.net"
VS-Code
{
  "servers": {
    "grafana-prod": {
      "type": "http",
      "url": "https://mcp.grafana.com/mcp/<prod-stack>.grafana.net"
    },
    "grafana-staging": {
      "type": "http",
      "url": "https://mcp.grafana.com/mcp/<staging-stack>.grafana.net"
    }
  }
}

In Codex, run codex mcp login once for each entry, for example, codex mcp login grafana-prod.

For Claude Desktop, add one custom connector per stack. For other clients, use the same pattern: one entry per stack, each with its own https://mcp.grafana.com/mcp/<your-stack>.grafana.net endpoint.

Connect an MCP client that requires manual registration

Most MCP clients register with the Grafana Cloud MCP server automatically. Some require you to provide a client ID and client secret before users can connect.

If your MCP client requires these credentials, register an OAuth client for Grafana Cloud MCP. The registration identifies the application, while each user continues to connect with their own Grafana identity and permissions.

Configure access

When you authorize a Grafana Cloud MCP connection in your browser, the consent page shows Access level and Tool areas side by side, or one above the other on narrow screens. Access level decides which operations your agent can perform. Tool areas choose which kinds of tools it can use, for example, dashboards or alerting. A tool needs both the required access level and a granted area. Your existing Grafana resource permissions still apply to every operation.

Choose an access level

Each access level is a separate checkbox, and you can clear any you don’t want to grant:

AccessWhat your agent can do
Read accessView dashboards, alerts, incidents, metrics, logs, traces, and profiles, and query read-only data sources, for example, Prometheus, Loki, Tempo, and Pyroscope.
Query any data sourceAlso run raw queries, for example, SQL and InfluxQL, against data sources such as ClickHouse, Snowflake, Athena, and InfluxDB. These execute as written and can change data if the data source credentials allow it.
Write accessAlso create, change, and delete resources, for example, dashboards, alerts, incidents, data sources, and Assistant investigations. Includes read and query access.

To grant read-only access, clear both Write access and Query any data source, and leave Read access selected. Clearing only Write access prevents write tools, for example, update_dashboard and create_incident, but still allows raw SQL queries when Query any data source is selected.

Query access is separate from read access because these tools send your query to the data source unchanged. A statement that modifies data runs if the data source credentials allow it, so the tools stay unavailable until you grant query access explicitly. With read access alone, the agent can browse your Grafana data and query Prometheus, Loki, Tempo, and Pyroscope, but the SQL query tools aren’t available.

If a checkbox is unavailable on the consent page, you don’t have the Assistant role that grants it. Refer to Roles and permissions for details.

Choose tool areas

Note

Grafana Cloud MCP tool areas is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

Tool areas are rolling out gradually. If the consent page shows only Access level, tool areas aren’t available on your stack yet, and the connection gets every area. For the tools in each area, refer to Tool areas.

Unless your client requests specific areas, every area starts selected. The access level still decides which tools in those areas your agent gets, for example, read access hides tools that change things.

To narrow the connection, clear the areas you don’t want, or click Clear and select the ones you do. Click Select all to select every area again. The line above Allow access says which areas your agent will see. You must keep at least one area selected before you can click Allow access.

Areas you can’t grant under your administrator’s restrictions appear unavailable, and areas you can grant only in part name the tools you can’t use. For details, refer to Restrict the tools users can grant.

Some MCP clients let you request specific areas in their server configuration by listing the area scopes. For example, this Claude Code .mcp.json entry starts with only Business data selected:

JSON
{
  "mcpServers": {
    "grafana-analyst": {
      "type": "http",
      "url": "https://mcp.grafana.com/mcp",
      "oauth": { "scopes": "mcp:business-data grafana:read grafana:query" }
    }
  }
}

You can still change the selection before you allow access.

Explore available tools

For the tools available on a connection, grouped by tool area and data source, refer to Grafana Cloud MCP tools.

Manage connections

To review your connections and revoke access, refer to Review and revoke connections in the Assistant documentation.

Change a connection’s tool areas

To change a connection’s areas, revoke it and connect your client again, then choose the new areas on the consent page. To use different areas side by side, add a separate server entry with its own name in your client for each set, and authorize each one.

If your agent can’t find a tool you expect, the connection probably doesn’t include its area. Reconnect and select the area you need. Connections you authorized before an area was added, for example, Grafana Pages, don’t include it until you reconnect.

Session lifetime

Your OAuth token is valid for 1 hour and refreshes automatically for 30 days. After 30 days, you’re prompted to log in and re-authorize.

Data privacy

Grafana securely routes your MCP queries via proxy. Grafana doesn’t train AI models on your PromQL, LogQL queries, investigation content, or prompt payload data. Refer to Privacy and security for more information.

Known limitations

  • Grafana Cloud only: The Grafana Cloud MCP server doesn’t support self-managed Grafana instances. If you use self-managed Grafana, use the local OSS MCP server
  • Transport: Only the Streamable HTTP transport is supported. SSE transport isn’t supported

Next steps