<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.0/developer-resources/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.0/developer-resources/mcp/guides/index.xml" rel="self" type="application/rss+xml"/><item><title>Query metrics with Prometheus</title><link>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/guides/query-metrics-with-prometheus/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/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;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.0/developer-resources/mcp/guides/query-logs-with-loki/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/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.0/developer-resources/mcp/guides/search-and-inspect-dashboards/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/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 or other criteria. 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;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;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.0/developer-resources/mcp/guides/manage-alert-rules/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/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;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;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.0/developer-resources/mcp/guides/generate-deeplinks-to-grafana/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/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;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.0/developer-resources/mcp/guides/run-a-dashboard-panel-query/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/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 and Sift</title><link>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/guides/use-grafana-incident-and-sift/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/guides/use-grafana-incident-and-sift/</guid><content><![CDATA[&lt;h1 id=&#34;use-grafana-incident-and-sift&#34;&gt;Use Grafana Incident and Sift&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) and Sift (list investigations, get analyses, find error patterns in logs, find slow requests). 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, list Sift investigations, or run a Sift analysis (for example, find elevated error patterns in Loki or slow requests in Tempo). The assistant uses the server’s Incident and Sift 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 (and Sift, if used) 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 incidents or running Sift analyses that create investigations.&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’s Incident tools. Creating incidents or adding activities requires Editor role.&lt;/p&gt;
&lt;h2 id=&#34;work-with-sift-investigations&#34;&gt;Work with Sift investigations&lt;/h2&gt;
&lt;p&gt;Ask the assistant to list Sift investigations, get one by UUID, or get a specific analysis from an investigation. For proactive analysis, ask to &lt;strong&gt;find error patterns in logs&lt;/strong&gt; (Loki) or &lt;strong&gt;find slow requests&lt;/strong&gt; (Tempo); the server starts a Sift investigation and returns the results. These “find” operations create investigations and require 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-and-sift">Use Grafana Incident and Sift&lt;/h1>
&lt;p>Use the Grafana MCP server so your AI assistant can work with Grafana Incident (list, create, get, add activities) and Sift (list investigations, get analyses, find error patterns in logs, find slow requests). 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.0/developer-resources/mcp/guides/query-metrics-with-influxdb/</link><pubDate>Thu, 23 Apr 2026 14:05:09 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/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>