<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Guides on Grafana Labs</title><link>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/</link><description>Recent content in Guides on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v13.3/ai-tools/mcp/guides/index.xml" rel="self" type="application/rss+xml"/><item><title>Query metrics with Prometheus</title><link>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/query-metrics-with-prometheus/</link><pubDate>Mon, 12 Oct 2026 08:33:19 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/query-metrics-with-prometheus/</guid><content><![CDATA[&lt;h1 id=&#34;query-metrics-with-prometheus&#34;&gt;Query metrics with Prometheus&lt;/h1&gt;
&lt;p&gt;Use the Grafana MCP server so your AI assistant can run PromQL queries against a Prometheus datasource in Grafana. You can run instant or range queries and discover metric and label names and values.&lt;/p&gt;
&lt;h2 id=&#34;what-youll-achieve&#34;&gt;What you&amp;rsquo;ll achieve&lt;/h2&gt;
&lt;p&gt;You ask your assistant to check a metric or run a PromQL expression; the assistant uses the server’s Prometheus tools to run the query and return results (or describe available metrics and labels).&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The server &lt;a href=&#34;../../set-up/&#34;&gt;set up&lt;/a&gt; and &lt;a href=&#34;../../configure/authentication/&#34;&gt;configured&lt;/a&gt; with access to Grafana.&lt;/li&gt;
&lt;li&gt;A Prometheus datasource configured in Grafana. The service account must have &lt;code&gt;datasources:query&lt;/code&gt; and scope for that datasource (for example, &lt;code&gt;datasources:uid:&amp;lt;uid&amp;gt;&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;run-a-promql-query&#34;&gt;Run a PromQL query&lt;/h2&gt;
&lt;p&gt;In your MCP client, ask the assistant to query Prometheus. For example, you might say “What is the current value of up for the Prometheus datasource?” or “Run this PromQL: rate(http_requests_total[5m]).” The assistant uses the server’s Prometheus query tool with the datasource UID and your time range. You can request instant queries (single value) or range queries (series over time).&lt;/p&gt;
&lt;h2 id=&#34;discover-metrics-and-labels&#34;&gt;Discover metrics and labels&lt;/h2&gt;
&lt;p&gt;Ask the assistant to list metric names, label names, or label values for a given selector. The server exposes tools that call the Prometheus API (metric metadata, label names, label values). Use these to explore what’s available before writing PromQL.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;list_prometheus_metric_names&lt;/code&gt; defaults to 10 results per page. The product of &lt;code&gt;page&lt;/code&gt; and &lt;code&gt;limit&lt;/code&gt; must not exceed 10,000. If it does and you need to explore &amp;gt; 10,000 results, narrow the regex to get fewer results. For Prometheus-compatible backends, regex filtering and the fetch limit are sent to the datasource, which must support the &lt;code&gt;limit&lt;/code&gt; parameter to bound the response. Cloud Monitoring continues to filter metric descriptors locally.&lt;/p&gt;
&lt;h2 id=&#34;response-size-limit&#34;&gt;Response size limit&lt;/h2&gt;
&lt;p&gt;Prometheus API responses are limited to 10 MiB after decompression. Responses above this limit return an error instead of partial results. If a query exceeds the limit, select fewer series, shorten the time range, or increase the step for a range query. For metric and label discovery, narrow the filters or requested time range.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../query-logs-with-loki/&#34;&gt;Query logs with Loki&lt;/a&gt; for log and LogQL use cases.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../run-a-dashboard-panel-query/&#34;&gt;Run a dashboard panel query&lt;/a&gt; to execute a panel’s query from the MCP server.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="query-metrics-with-prometheus">Query metrics with Prometheus&lt;/h1>
&lt;p>Use the Grafana MCP server so your AI assistant can run PromQL queries against a Prometheus datasource in Grafana. You can run instant or range queries and discover metric and label names and values.&lt;/p></description></item><item><title>Query logs with Loki</title><link>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/query-logs-with-loki/</link><pubDate>Wed, 29 Jul 2026 17:47:59 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/query-logs-with-loki/</guid><content><![CDATA[&lt;h1 id=&#34;query-logs-with-loki&#34;&gt;Query logs with Loki&lt;/h1&gt;
&lt;p&gt;Use the Grafana MCP server so your AI assistant can run LogQL log and metric queries against a Loki datasource in Grafana. You can also list label names and values and retrieve log patterns.&lt;/p&gt;
&lt;h2 id=&#34;what-youll-achieve&#34;&gt;What you&amp;rsquo;ll achieve&lt;/h2&gt;
&lt;p&gt;You ask your assistant to search logs or run a LogQL expression; the assistant uses the server’s Loki tools to run the query and return log lines or metric values. You can also explore labels and patterns.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The server &lt;a href=&#34;../../set-up/&#34;&gt;set up&lt;/a&gt; and &lt;a href=&#34;../../configure/authentication/&#34;&gt;configured&lt;/a&gt; with access to Grafana.&lt;/li&gt;
&lt;li&gt;A Loki datasource configured in Grafana. The service account must have &lt;code&gt;datasources:query&lt;/code&gt; and scope for that datasource.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;run-a-logql-query&#34;&gt;Run a LogQL query&lt;/h2&gt;
&lt;p&gt;In your MCP client, ask the assistant to query Loki. For example, “Show me recent error logs from the Loki datasource” or “Run this LogQL: {job=&amp;quot;myapp&amp;quot;} |= &amp;quot;error&amp;quot;.” The assistant uses the server’s Loki query tool with the datasource UID, time range, and limit. You can run log queries (streams of log lines) or metric queries (counts, rates, etc.).&lt;/p&gt;
&lt;h2 id=&#34;explore-labels-and-patterns&#34;&gt;Explore labels and patterns&lt;/h2&gt;
&lt;p&gt;Ask the assistant to list label names or label values for a selector, or to retrieve detected log patterns. These tools help you discover what’s in your logs before writing LogQL.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../query-metrics-with-prometheus/&#34;&gt;Query metrics with Prometheus&lt;/a&gt; for PromQL use cases.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../search-and-inspect-dashboards/&#34;&gt;Search and inspect dashboards&lt;/a&gt; to find and explore dashboards.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="query-logs-with-loki">Query logs with Loki&lt;/h1>
&lt;p>Use the Grafana MCP server so your AI assistant can run LogQL log and metric queries against a Loki datasource in Grafana. You can also list label names and values and retrieve log patterns.&lt;/p></description></item><item><title>Search and inspect dashboards</title><link>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/search-and-inspect-dashboards/</link><pubDate>Tue, 20 Oct 2026 22:17:27 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/search-and-inspect-dashboards/</guid><content><![CDATA[&lt;h1 id=&#34;search-and-inspect-dashboards&#34;&gt;Search and inspect dashboards&lt;/h1&gt;
&lt;p&gt;Use the Grafana MCP server so your AI assistant can search for dashboards and inspect them (summaries, panel queries, or specific properties) without pulling full dashboard JSON. That keeps context window use under control.&lt;/p&gt;
&lt;h2 id=&#34;what-youll-achieve&#34;&gt;What you&amp;rsquo;ll achieve&lt;/h2&gt;
&lt;p&gt;You ask your assistant to find dashboards or to summarize a dashboard, list its panels and queries, or extract specific fields. The assistant uses search, get summary, get panel queries, or get property tools as appropriate.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The server &lt;a href=&#34;../../set-up/&#34;&gt;set up&lt;/a&gt; and &lt;a href=&#34;../../configure/authentication/&#34;&gt;configured&lt;/a&gt; with access to Grafana.&lt;/li&gt;
&lt;li&gt;The service account must have &lt;code&gt;dashboards:read&lt;/code&gt; and scope for the dashboards you care about.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;search-for-dashboards&#34;&gt;Search for dashboards&lt;/h2&gt;
&lt;p&gt;Ask the assistant to search for dashboards by title, folder, tag, or starred status. The server’s search tool returns matching dashboards with metadata. Use this to find the UID or folder of the dashboard you want.&lt;/p&gt;
&lt;h2 id=&#34;get-a-dashboard-summary-or-panel-queries&#34;&gt;Get a dashboard summary or panel queries&lt;/h2&gt;
&lt;p&gt;When you need an overview of a dashboard without the full JSON, ask for a &lt;strong&gt;dashboard summary&lt;/strong&gt;. You get title, panel count, panel types, variables, and similar metadata. To see what each panel queries, ask for &lt;strong&gt;panel queries&lt;/strong&gt;: the assistant uses the tool that returns panel title, query string, and datasource UID and type for every panel.&lt;/p&gt;
&lt;p&gt;To prepare panel query text, pass &lt;code&gt;variables: {}&lt;/code&gt; to use saved selections, or provide explicit variable overrides. Optional &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; use the same frontend time macros as panel execution. Use absolute bounds when comparing separate calls. A referenced All selection returns a warning asking for an explicit value. Inspection reads the dashboard without querying variable options or looking up datasource types. Datasource plugin macros and visual targets retain their existing behavior.&lt;/p&gt;
&lt;h2 id=&#34;get-specific-properties-with-jsonpath&#34;&gt;Get specific properties with JSONPath&lt;/h2&gt;
&lt;p&gt;When you only need certain parts of a dashboard (for example, one panel’s config), ask the assistant to use &lt;strong&gt;get_dashboard_property&lt;/strong&gt; with a JSONPath expression (for example, &lt;code&gt;$.panels[0].title&lt;/code&gt;). That fetches only the requested data and avoids loading the full dashboard.&lt;/p&gt;
&lt;h2 id=&#34;inspect-a-previous-dashboard-version&#34;&gt;Inspect a previous dashboard version&lt;/h2&gt;
&lt;p&gt;To see how a dashboard looked at a previous save, first list its versions. The server returns compact metadata only (version number, author, timestamp, and save message), not the full JSON. Then ask for the dashboard by UID with that version number. Omitting &lt;code&gt;version&lt;/code&gt; still returns the current dashboard.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../generate-deeplinks-to-grafana/&#34;&gt;Generate deeplinks to Grafana&lt;/a&gt; to get shareable links to dashboards and panels.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../manage-alert-rules/&#34;&gt;Manage alert rules&lt;/a&gt; to create or update alert rules from your assistant.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="search-and-inspect-dashboards">Search and inspect dashboards&lt;/h1>
&lt;p>Use the Grafana MCP server so your AI assistant can search for dashboards and inspect them (summaries, panel queries, or specific properties) without pulling full dashboard JSON. That keeps context window use under control.&lt;/p></description></item><item><title>Manage alert rules</title><link>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/manage-alert-rules/</link><pubDate>Tue, 20 Oct 2026 07:22:51 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/manage-alert-rules/</guid><content><![CDATA[&lt;h1 id=&#34;manage-alert-rules&#34;&gt;Manage alert rules&lt;/h1&gt;
&lt;p&gt;Use the Grafana MCP server so your AI assistant can list and fetch alert rules, create or update rules, delete rules, and inspect notification policies and contact points.&lt;/p&gt;
&lt;h2 id=&#34;what-youll-achieve&#34;&gt;What you&amp;rsquo;ll achieve&lt;/h2&gt;
&lt;p&gt;You ask your assistant to show firing alerts, add a new alert rule, change a rule’s condition or labels, or list contact points. The assistant uses the server’s alerting tools with the permissions you’ve granted.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The server &lt;a href=&#34;../../set-up/&#34;&gt;set up&lt;/a&gt; and &lt;a href=&#34;../../configure/authentication/&#34;&gt;configured&lt;/a&gt; with access to Grafana.&lt;/li&gt;
&lt;li&gt;The service account must have &lt;code&gt;alert.rules:read&lt;/code&gt; (and &lt;code&gt;alert.rules:write&lt;/code&gt; for create/update/delete) and appropriate folder scopes. For routing (contact points, policies), &lt;code&gt;alert.notifications:read&lt;/code&gt; is required.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;list-and-inspect-alert-rules&#34;&gt;List and inspect alert rules&lt;/h2&gt;
&lt;p&gt;Ask the assistant to list alert rules or get details for a rule by UID. You can filter by folder or labels. The assistant uses the alerting tools to return rule title, state (firing, pending, normal), and configuration.&lt;/p&gt;
&lt;h2 id=&#34;create-or-update-alert-rules&#34;&gt;Create or update alert rules&lt;/h2&gt;
&lt;p&gt;Ask the assistant to create a new alert rule or update an existing one. You provide (or the assistant infers) the folder UID, condition, queries, labels, and annotations. The service account needs write permissions and scope for the folder. The assistant uses the server’s create/update alert rule tool.&lt;/p&gt;
&lt;p&gt;Creation defaults to &lt;strong&gt;Grafana-managed&lt;/strong&gt;. The assistant can select &lt;code&gt;managed_by: &amp;quot;datasource&amp;quot;&lt;/code&gt; when the user requests it or when established conversation or environment context clearly identifies a datasource-managed workflow. For example, the user&amp;rsquo;s alerting setup may already be known to manage rules exclusively in a writable external backend. Using an external datasource in a query or finding no Grafana-managed rules alone does not establish that intent. If context conflicts, the assistant should ask before creating anything.&lt;/p&gt;
&lt;p&gt;The assistant must still send &lt;code&gt;managed_by: &amp;quot;datasource&amp;quot;&lt;/code&gt; in the tool call. Omitting it keeps Grafana-managed creation. The server does not infer a management target from datasource discovery or switch targets after an error.&lt;/p&gt;
&lt;h3 id=&#34;create-a-datasource-managed-rule&#34;&gt;Create a datasource-managed rule&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;alerting_rules_write&lt;/code&gt; supports creating alerting rules in Mimir/Cortex and Loki rulers. Standalone Prometheus does not support rule creation through this API. Enable rule management in the datasource configuration and configure the appropriate Prometheus type for Mimir/Cortex.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;operation&amp;#34;: &amp;#34;create&amp;#34;,
  &amp;#34;managed_by&amp;#34;: &amp;#34;datasource&amp;#34;,
  &amp;#34;datasource_uid&amp;#34;: &amp;#34;mimir-rules&amp;#34;,
  &amp;#34;namespace&amp;#34;: &amp;#34;pmo&amp;#34;,
  &amp;#34;rule_group&amp;#34;: &amp;#34;availability&amp;#34;,
  &amp;#34;title&amp;#34;: &amp;#34;ServiceDown&amp;#34;,
  &amp;#34;expression&amp;#34;: &amp;#34;up{job=\&amp;#34;pmo-service\&amp;#34;} == 0&amp;#34;,
  &amp;#34;for&amp;#34;: &amp;#34;5m&amp;#34;,
  &amp;#34;labels&amp;#34;: {&amp;#34;team&amp;#34;: &amp;#34;pmo&amp;#34;, &amp;#34;severity&amp;#34;: &amp;#34;critical&amp;#34;}
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;An explicit &lt;code&gt;datasource_uid&lt;/code&gt; takes priority and is validated. If omitted, the tool discovers compatible datasources visible to the caller. It selects one only when exactly one exists. With multiple candidates, it returns their names and UIDs so the assistant can ask the user to choose. With none, it returns an error. It never falls back to Grafana-managed creation.&lt;/p&gt;
&lt;p&gt;The tool appends the rule to the existing group and preserves its other rules and settings. New groups default to a &lt;code&gt;1m&lt;/code&gt; evaluation interval. You can set &lt;code&gt;evaluation_interval&lt;/code&gt; for a new group, but it must match the interval when adding to an existing group. If the existing group omits its interval and uses the ruler default, omit &lt;code&gt;evaluation_interval&lt;/code&gt; to preserve it. Duplicate alert names in the same group are rejected. External creation uses &lt;code&gt;expression&lt;/code&gt; and &lt;code&gt;namespace&lt;/code&gt;, not Grafana-only fields such as &lt;code&gt;data&lt;/code&gt;, &lt;code&gt;condition&lt;/code&gt; or &lt;code&gt;folder_uid&lt;/code&gt;. Update and delete remain Grafana-only.&lt;/p&gt;
&lt;p&gt;For an explicitly selected Prometheus datasource without &lt;code&gt;jsonData.prometheusType&lt;/code&gt;, the tool checks build information to select the Mimir or Cortex ruler route, then reads the group before writing. Automatic selection requires configured Mimir/Cortex metadata and does not probe every datasource.&lt;/p&gt;
&lt;h2 id=&#34;manage-contact-points-and-routing&#34;&gt;Manage contact points and routing&lt;/h2&gt;
&lt;p&gt;Ask the assistant to list contact points or notification policies. The server exposes tools for Grafana-managed routing; for Alertmanager datasources, it can query receivers. Use this to see where alerts are sent or to describe routing before changing it (actual routing changes may require the Grafana UI or API outside MCP).&lt;/p&gt;
&lt;h3 id=&#34;create-an-external-alertmanager-contact-point&#34;&gt;Create an external Alertmanager contact point&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;alerting_routing_write&lt;/code&gt; also defaults to &lt;strong&gt;Grafana-managed&lt;/strong&gt;. Select &lt;code&gt;managed_by: &amp;quot;datasource&amp;quot;&lt;/code&gt; when the user requests an external receiver or established context clearly identifies an external Alertmanager workflow. An external rule datasource or an empty Grafana contact point list alone is insufficient. Use a Mimir/Cortex &lt;strong&gt;Alertmanager datasource&lt;/strong&gt;, which is selected independently from the rule datasource. Standalone Prometheus Alertmanager does not expose a writable configuration API.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;JSON&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;#34;operation&amp;#34;: &amp;#34;create_contact_point&amp;#34;,
  &amp;#34;managed_by&amp;#34;: &amp;#34;datasource&amp;#34;,
  &amp;#34;datasource_uid&amp;#34;: &amp;#34;mimir-alertmanager&amp;#34;,
  &amp;#34;name&amp;#34;: &amp;#34;pmo-notifications&amp;#34;,
  &amp;#34;type&amp;#34;: &amp;#34;webhook&amp;#34;,
  &amp;#34;settings&amp;#34;: {&amp;#34;url&amp;#34;: &amp;#34;https://example.com/alerts&amp;#34;}
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The same optional UID selection rules apply independently to Alertmanager datasources. Use native Alertmanager settings, such as &lt;code&gt;to&lt;/code&gt; for email, rather than Grafana&amp;rsquo;s &lt;code&gt;addresses&lt;/code&gt;. &lt;code&gt;disable_resolve_message&lt;/code&gt; controls resolved notifications. Grafana-only &lt;code&gt;uid&lt;/code&gt; and &lt;code&gt;disable_provenance&lt;/code&gt; are rejected for external creation.&lt;/p&gt;
&lt;p&gt;The receiver is added without changing existing receivers, notification routes, templates, or other configuration fields in the request. A receiver name must be unique. An initial Alertmanager configuration with a root route must already exist. Creating a receiver does not connect it to a route or configure the ruler to send alerts to that Alertmanager. Configure those separately.&lt;/p&gt;
&lt;p&gt;The result contains the receiver name, type and datasource UID, with an empty integration UID because external receivers are identified by name. It does not contain settings or secrets. If the API returns redacted secrets, the tool refuses to overwrite the configuration.&lt;/p&gt;
&lt;h3 id=&#34;permissions-and-concurrent-writes&#34;&gt;Permissions and concurrent writes&lt;/h3&gt;
&lt;p&gt;External rule creation requires &lt;code&gt;datasources:read&lt;/code&gt;, &lt;code&gt;alert.rules.external:read&lt;/code&gt; and &lt;code&gt;alert.rules.external:write&lt;/code&gt; for the target datasource. External receiver creation requires &lt;code&gt;datasources:read&lt;/code&gt;, &lt;code&gt;alert.notifications.external:read&lt;/code&gt; and &lt;code&gt;alert.notifications.external:write&lt;/code&gt;. The backend must also allow the write. Both creation paths remain disabled by &lt;code&gt;--disable-write&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;These APIs replace a complete rule group or Alertmanager configuration. The server serializes its own external creation calls for the same Grafana instance, datasource UID and destination group or Alertmanager configuration, regardless of organization selector. An implicit organization may be the same as an explicit one, so organizations that reuse the same destination identifiers conservatively share a lock. Other instances, datasources and rule groups can proceed independently, and unused locks are removed. This cannot prevent concurrent edits from other MCP processes, the Grafana UI, or other clients. Coordinate such writes to avoid overwriting concurrent changes. Unsupported APIs, permission errors and ambiguous destinations fail without creating anything in Grafana instead.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../introduction/&#34;&gt;Introduction&lt;/a&gt; for RBAC and permissions.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../search-and-inspect-dashboards/&#34;&gt;Search and inspect dashboards&lt;/a&gt; to find dashboards that use alerts.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="manage-alert-rules">Manage alert rules&lt;/h1>
&lt;p>Use the Grafana MCP server so your AI assistant can list and fetch alert rules, create or update rules, delete rules, and inspect notification policies and contact points.&lt;/p></description></item><item><title>Generate deeplinks to Grafana</title><link>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/generate-deeplinks-to-grafana/</link><pubDate>Mon, 19 Oct 2026 10:16:42 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/generate-deeplinks-to-grafana/</guid><content><![CDATA[&lt;h1 id=&#34;generate-deeplinks-to-grafana&#34;&gt;Generate deeplinks to Grafana&lt;/h1&gt;
&lt;p&gt;Use the Grafana MCP server so your AI assistant can generate correct deeplink URLs to dashboards, panels, and Grafana Explore. The server uses the Grafana API to build URLs so you get working links instead of guessed paths.&lt;/p&gt;
&lt;h2 id=&#34;what-youll-achieve&#34;&gt;What you&amp;rsquo;ll achieve&lt;/h2&gt;
&lt;p&gt;You ask your assistant for a link to a dashboard, a specific panel, or Explore with a given datasource (and optional time range). The assistant uses the server’s deeplink tool and returns a URL you can open or share.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The server &lt;a href=&#34;../../set-up/&#34;&gt;set up&lt;/a&gt; and &lt;a href=&#34;../../configure/authentication/&#34;&gt;configured&lt;/a&gt; with access to Grafana.&lt;/li&gt;
&lt;li&gt;No extra RBAC is required for generating links (read-only URL generation).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;get-dashboard-and-panel-links&#34;&gt;Get dashboard and panel links&lt;/h2&gt;
&lt;p&gt;Ask the assistant to generate a link to a dashboard by UID, or to a specific panel (dashboard UID and panel ID). You can request a time range (for example, last hour) so the link opens with that range. The assistant uses the server tool and returns a URL like &lt;code&gt;http://localhost:3000/d/&amp;lt;uid&amp;gt;?viewPanel=&amp;lt;id&amp;gt;&amp;amp;from=now-1h&amp;amp;to=now&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;get-explore-links&#34;&gt;Get Explore links&lt;/h2&gt;
&lt;p&gt;Ask for a link to Grafana Explore with a specific datasource (by UID). Optionally specify time range or other query parameters. The assistant returns a URL that opens Explore with that datasource and options pre-filled.&lt;/p&gt;
&lt;h2 id=&#34;shorten-long-links&#34;&gt;Shorten long links&lt;/h2&gt;
&lt;p&gt;Explore links can get long when they include encoded &lt;code&gt;left&lt;/code&gt; state. Ask the assistant to call &lt;code&gt;generate_deeplink&lt;/code&gt; with &lt;code&gt;shorten=true&lt;/code&gt;. The server will try Grafana&amp;rsquo;s &lt;code&gt;POST /api/short-urls&lt;/code&gt; endpoint and return a compact &lt;code&gt;/goto/&amp;lt;uid&amp;gt;&lt;/code&gt; URL; if shortening is unavailable, it returns the full deeplink instead.&lt;/p&gt;
&lt;p&gt;If you start the server with &lt;code&gt;--disable-write&lt;/code&gt;, it ignores &lt;code&gt;shorten=true&lt;/code&gt; and returns the full deeplink. Add &lt;code&gt;--enable-write-tools=generate_deeplink&lt;/code&gt; to keep shortening.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../search-and-inspect-dashboards/&#34;&gt;Search and inspect dashboards&lt;/a&gt; to find dashboard and panel IDs.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../query-metrics-with-prometheus/&#34;&gt;Query metrics with Prometheus&lt;/a&gt; or &lt;a href=&#34;../query-logs-with-loki/&#34;&gt;Query logs with Loki&lt;/a&gt; to work with datasources.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="generate-deeplinks-to-grafana">Generate deeplinks to Grafana&lt;/h1>
&lt;p>Use the Grafana MCP server so your AI assistant can generate correct deeplink URLs to dashboards, panels, and Grafana Explore. The server uses the Grafana API to build URLs so you get working links instead of guessed paths.&lt;/p></description></item><item><title>Run a dashboard panel query</title><link>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/run-a-dashboard-panel-query/</link><pubDate>Wed, 29 Jul 2026 17:47:59 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/run-a-dashboard-panel-query/</guid><content><![CDATA[&lt;h1 id=&#34;run-a-dashboard-panel-query&#34;&gt;Run a dashboard panel query&lt;/h1&gt;
&lt;p&gt;Use the Grafana MCP server to run a dashboard panel’s query (the same query the panel uses) with a custom time range and variable overrides. This is useful when you want the assistant to “run what this panel runs” without writing PromQL or LogQL yourself.&lt;/p&gt;
&lt;h2 id=&#34;what-youll-achieve&#34;&gt;What you&amp;rsquo;ll achieve&lt;/h2&gt;
&lt;p&gt;You point the assistant at a dashboard and panel; the assistant uses the server’s run-panel-query tool to execute that panel’s query and return the result (or an error if the query or datasource is invalid).&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The server &lt;a href=&#34;../../set-up/&#34;&gt;set up&lt;/a&gt; and &lt;a href=&#34;../../configure/authentication/&#34;&gt;configured&lt;/a&gt; with access to Grafana.&lt;/li&gt;
&lt;li&gt;The run-panel-query tool must be enabled (it’s disabled by default). Add &lt;strong&gt;runpanelquery&lt;/strong&gt; to &lt;a href=&#34;../../configure/enable-and-disable-tools/&#34;&gt;Enable and disable tools&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The service account must have &lt;code&gt;dashboards:read&lt;/code&gt; and &lt;code&gt;datasources:query&lt;/code&gt; with scope for the dashboard and the datasource the panel uses.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;run-the-panel-query&#34;&gt;Run the panel query&lt;/h2&gt;
&lt;p&gt;Ask the assistant to run the query for a specific panel on a dashboard. Provide (or let the assistant look up) the dashboard UID and panel ID. You can specify a time range (for example, last 1 hour) and variable overrides so the query runs with the same logic as the panel but with your chosen parameters. The assistant calls the server’s run-panel-query tool and returns the result.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../query-metrics-with-prometheus/&#34;&gt;Query metrics with Prometheus&lt;/a&gt; or &lt;a href=&#34;../query-logs-with-loki/&#34;&gt;Query logs with Loki&lt;/a&gt; to run custom PromQL or LogQL.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../search-and-inspect-dashboards/&#34;&gt;Search and inspect dashboards&lt;/a&gt; to find panel IDs and datasources.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="run-a-dashboard-panel-query">Run a dashboard panel query&lt;/h1>
&lt;p>Use the Grafana MCP server to run a dashboard panel’s query (the same query the panel uses) with a custom time range and variable overrides. This is useful when you want the assistant to “run what this panel runs” without writing PromQL or LogQL yourself.&lt;/p></description></item><item><title>Use Grafana Incident</title><link>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/use-grafana-incident/</link><pubDate>Thu, 01 Oct 2026 13:22:11 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/use-grafana-incident/</guid><content><![CDATA[&lt;h1 id=&#34;use-grafana-incident&#34;&gt;Use Grafana Incident&lt;/h1&gt;
&lt;p&gt;Use the Grafana MCP server so your AI assistant can work with Grafana Incident (list, create, get, add activities, update). These features use Grafana basic roles: Viewer for read, Editor for write.&lt;/p&gt;
&lt;h2 id=&#34;what-youll-achieve&#34;&gt;What you&amp;rsquo;ll achieve&lt;/h2&gt;
&lt;p&gt;You ask your assistant to list or create incidents, add a note to an incident, or update an incident&amp;rsquo;s status. The assistant uses the server&amp;rsquo;s Incident tools.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The server &lt;a href=&#34;../../set-up/&#34;&gt;set up&lt;/a&gt; and &lt;a href=&#34;../../configure/authentication/&#34;&gt;configured&lt;/a&gt; with access to Grafana.&lt;/li&gt;
&lt;li&gt;Grafana Incident available on your instance. The service account must have at least the &lt;strong&gt;Viewer&lt;/strong&gt; role for read-only operations; &lt;strong&gt;Editor&lt;/strong&gt; role for creating or updating incidents.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;work-with-incidents&#34;&gt;Work with incidents&lt;/h2&gt;
&lt;p&gt;Ask the assistant to list incidents (optionally filtered by status), get one incident by ID, create a new incident (title, severity, room prefix, etc.), or add an activity (note) to an incident. The assistant uses the server&amp;rsquo;s Incident tools. Creating incidents or adding activities requires Editor role.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../introduction/&#34;&gt;Introduction&lt;/a&gt; for roles and permissions.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../manage-alert-rules/&#34;&gt;Manage alert rules&lt;/a&gt; for alerting from the MCP server.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="use-grafana-incident">Use Grafana Incident&lt;/h1>
&lt;p>Use the Grafana MCP server so your AI assistant can work with Grafana Incident (list, create, get, add activities, update). These features use Grafana basic roles: Viewer for read, Editor for write.&lt;/p></description></item><item><title>Query metrics with InfluxDB</title><link>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/query-metrics-with-influxdb/</link><pubDate>Wed, 29 Jul 2026 17:47:59 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.3/ai-tools/mcp/guides/query-metrics-with-influxdb/</guid><content><![CDATA[&lt;h1 id=&#34;query-metrics-with-influxdb&#34;&gt;Query metrics with InfluxDB&lt;/h1&gt;
&lt;p&gt;Use the Grafana MCP server so your AI assistant can run InfluxDB queries against an InfluxDB datasource in Grafana. The server supports both InfluxQL (v1.x) and Flux (v2.x); the dialect is inferred from the datasource&amp;rsquo;s configured version or can be set explicitly.&lt;/p&gt;
&lt;h2 id=&#34;what-youll-achieve&#34;&gt;What you&amp;rsquo;ll achieve&lt;/h2&gt;
&lt;p&gt;You ask your assistant to query an InfluxDB-backed metric; the assistant uses the server&amp;rsquo;s InfluxDB query tool to post the query through Grafana&amp;rsquo;s datasource proxy and return the points. The server is a thin shim over Grafana&amp;rsquo;s &lt;code&gt;/api/ds/query&lt;/code&gt; endpoint, so Grafana handles all protocol details for InfluxDB v1 and v2.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The server &lt;a href=&#34;../../set-up/&#34;&gt;set up&lt;/a&gt; and &lt;a href=&#34;../../configure/authentication/&#34;&gt;configured&lt;/a&gt; with access to Grafana.&lt;/li&gt;
&lt;li&gt;The InfluxDB tool category must be enabled (it&amp;rsquo;s disabled by default, like the other optional datasource tools). Add &lt;strong&gt;influxdb&lt;/strong&gt; to &lt;a href=&#34;../../configure/enable-and-disable-tools/&#34;&gt;Enable and disable tools&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;An InfluxDB datasource configured in Grafana. The service account must have &lt;code&gt;datasources:query&lt;/code&gt; and scope for that datasource (for example, &lt;code&gt;datasources:uid:&amp;lt;uid&amp;gt;&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;run-a-query&#34;&gt;Run a query&lt;/h2&gt;
&lt;p&gt;In your MCP client, ask the assistant to query InfluxDB. For example, &amp;ldquo;What was the mean CPU usage on the host &lt;code&gt;server1&lt;/code&gt; in the last hour?&amp;rdquo; or &amp;ldquo;Run this Flux: &lt;code&gt;from(bucket: \&amp;quot;metrics\&amp;quot;) |&amp;gt; range(start: -1h) |&amp;gt; filter(fn: (r) =&amp;gt; r._measurement == \&amp;quot;cpu\&amp;quot;)&lt;/code&gt;.&amp;rdquo; The assistant uses the server&amp;rsquo;s &lt;code&gt;query_influxdb&lt;/code&gt; tool with the datasource UID, query string, and time range.&lt;/p&gt;
&lt;p&gt;If the datasource is configured for InfluxDB v2 (Flux), pass a Flux query. If it&amp;rsquo;s configured for v1 (InfluxQL), pass an InfluxQL query. You can override the dialect explicitly by setting &lt;code&gt;dialect&lt;/code&gt; to &lt;code&gt;&amp;quot;flux&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;influxql&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;run-a-panels-query-from-a-dashboard&#34;&gt;Run a panel&amp;rsquo;s query from a dashboard&lt;/h2&gt;
&lt;p&gt;If a dashboard you care about already contains the InfluxDB panel you want, use &lt;code&gt;run_panel_query&lt;/code&gt; instead of writing the query yourself. The MCP server fetches the dashboard, extracts the panel&amp;rsquo;s query and &lt;code&gt;queryType&lt;/code&gt;, substitutes any template variables, and executes the query against the configured datasource. This is the fastest path from &amp;ldquo;what does this panel show?&amp;rdquo; to actual data.&lt;/p&gt;
&lt;h2 id=&#34;discover-whats-in-a-bucket-or-database&#34;&gt;Discover what&amp;rsquo;s in a bucket or database&lt;/h2&gt;
&lt;p&gt;The server does not expose dedicated measurement- or tag-listing tools. Instead, run discovery queries via &lt;code&gt;query_influxdb&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Flux (v2):&lt;/strong&gt; &lt;code&gt;from(bucket: &amp;quot;my-bucket&amp;quot;) |&amp;gt; range(start: -1h) |&amp;gt; limit(n: 5)&lt;/code&gt; to see available fields and tags on recent points.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;InfluxQL (v1):&lt;/strong&gt; &lt;code&gt;SHOW MEASUREMENTS&lt;/code&gt;, &lt;code&gt;SHOW TAG KEYS FROM &amp;quot;cpu&amp;quot;&lt;/code&gt;, &lt;code&gt;SHOW FIELD KEYS FROM &amp;quot;cpu&amp;quot;&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use &lt;code&gt;get_query_examples&lt;/code&gt; with &lt;code&gt;datasourceType: &amp;quot;influxdb&amp;quot;&lt;/code&gt; to see more starter queries for both dialects.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../query-metrics-with-prometheus/&#34;&gt;Query metrics with Prometheus&lt;/a&gt; for PromQL use cases.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../run-a-dashboard-panel-query/&#34;&gt;Run a dashboard panel query&lt;/a&gt; to execute a panel&amp;rsquo;s query from the MCP server.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="query-metrics-with-influxdb">Query metrics with InfluxDB&lt;/h1>
&lt;p>Use the Grafana MCP server so your AI assistant can run InfluxDB queries against an InfluxDB datasource in Grafana. The server supports both InfluxQL (v1.x) and Flux (v2.x); the dialect is inferred from the datasource&amp;rsquo;s configured version or can be set explicitly.&lt;/p></description></item></channel></rss>