<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configure the Grafana MCP server on Grafana Labs</title><link>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/</link><description>Recent content in Configure the Grafana MCP server on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v13.1/developer-resources/mcp/configure/index.xml" rel="self" type="application/rss+xml"/><item><title>Authentication</title><link>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/authentication/</link><pubDate>Fri, 25 Sep 2026 09:18:01 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/authentication/</guid><content><![CDATA[&lt;h1 id=&#34;authentication&#34;&gt;Authentication&lt;/h1&gt;
&lt;p&gt;The Grafana MCP server needs credentials to call the Grafana API. Use a service account token (recommended) or a username and password.&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 set the environment variables (or equivalent) so the server can authenticate to your Grafana instance. The same credentials apply whether you run the server with uvx, Docker, a binary, or Helm.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A Grafana instance (Grafana 9.0 or later).&lt;/li&gt;
&lt;li&gt;For token auth: a &lt;a href=&#34;/docs/grafana/latest/administration/service-accounts/#add-a-token-to-a-service-account-in-grafana&#34;&gt;service account&lt;/a&gt; with a token and the RBAC permissions needed for the tools you use.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;use-a-service-account-token&#34;&gt;Use a service account token&lt;/h2&gt;
&lt;p&gt;Set &lt;code&gt;GRAFANA_URL&lt;/code&gt; and &lt;code&gt;GRAFANA_SERVICE_ACCOUNT_TOKEN&lt;/code&gt; in the environment passed to the server.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;GRAFANA_URL:&lt;/strong&gt; Your Grafana base URL (for example, &lt;code&gt;http://localhost:3000&lt;/code&gt; or &lt;code&gt;https://myinstance.grafana.net&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GRAFANA_SERVICE_ACCOUNT_TOKEN:&lt;/strong&gt; The token you created for the service account.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The deprecated &lt;code&gt;GRAFANA_API_KEY&lt;/code&gt; is still supported but will be removed in a future version; use &lt;code&gt;GRAFANA_SERVICE_ACCOUNT_TOKEN&lt;/code&gt; instead.&lt;/p&gt;
&lt;h3 id=&#34;read-the-token-from-a-file&#34;&gt;Read the token from a file&lt;/h3&gt;
&lt;p&gt;Set &lt;code&gt;GRAFANA_SERVICE_ACCOUNT_TOKEN_FILE&lt;/code&gt; to a file path that contains the token instead of passing the value inline. The file is read fresh on every request, so a rotated token is picked up automatically without restarting the server.&lt;/p&gt;
&lt;p&gt;This is useful in Kubernetes, where a Secret mounted as a volume is updated in place when the underlying Secret changes. Because the server&amp;rsquo;s client cache is keyed on the token value, a rotated token transparently produces a new client with no pod restart:&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;YAML&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-yaml&#34;&gt;env:
  - name: GRAFANA_SERVICE_ACCOUNT_TOKEN_FILE
    value: /var/run/secrets/grafana/token
volumeMounts:
  - name: grafana-token
    mountPath: /var/run/secrets/grafana
    readOnly: true
volumes:
  - name: grafana-token
    secret:
      secretName: grafana-mcp-token&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Surrounding whitespace (including a trailing newline) is trimmed from the file contents. If both &lt;code&gt;GRAFANA_SERVICE_ACCOUNT_TOKEN&lt;/code&gt; and &lt;code&gt;GRAFANA_SERVICE_ACCOUNT_TOKEN_FILE&lt;/code&gt; are set, the inline token takes precedence.&lt;/p&gt;
&lt;p&gt;For HTTP deployments that &lt;a href=&#34;../command-line-flags/#select-a-grafana-url-per-request&#34;&gt;select a Grafana URL per request&lt;/a&gt;, each request must supply a token for its selected instance. The server does not reuse &lt;code&gt;GRAFANA_SERVICE_ACCOUNT_TOKEN&lt;/code&gt; or the token file for that request.&lt;/p&gt;
&lt;h2 id=&#34;use-username-and-password&#34;&gt;Use username and password&lt;/h2&gt;
&lt;p&gt;You can use basic auth by setting &lt;code&gt;GRAFANA_USERNAME&lt;/code&gt; and &lt;code&gt;GRAFANA_PASSWORD&lt;/code&gt; instead of a token. This is less suitable for automation; prefer a service account token when possible.&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;../enable-and-disable-tools/&#34;&gt;Enable and disable tools&lt;/a&gt; to control which MCP tools are available.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../transports-and-addresses/&#34;&gt;Transports and addresses&lt;/a&gt; for stdio, SSE, and streamable-http.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="authentication">Authentication&lt;/h1>
&lt;p>The Grafana MCP server needs credentials to call the Grafana API. Use a service account token (recommended) or a username and password.&lt;/p>
&lt;h2 id="what-youll-achieve">What you&amp;rsquo;ll achieve&lt;/h2>
&lt;p>You set the environment variables (or equivalent) so the server can authenticate to your Grafana instance. The same credentials apply whether you run the server with uvx, Docker, a binary, or Helm.&lt;/p></description></item><item><title>Transports and addresses</title><link>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/transports-and-addresses/</link><pubDate>Thu, 01 Oct 2026 13:22:11 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/transports-and-addresses/</guid><content><![CDATA[&lt;h1 id=&#34;transports-and-addresses&#34;&gt;Transports and addresses&lt;/h1&gt;
&lt;p&gt;The Grafana MCP server supports three transports: stdio (default for local use), SSE, and streamable-http. Choose the one that matches how your MCP client connects.&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 run the server with the right transport and, for SSE or streamable-http, the correct address and path so your client can connect.&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 installed (for example, &lt;a href=&#34;../../set-up/install-with-uvx/&#34;&gt;Install with uvx&lt;/a&gt; or &lt;a href=&#34;../../set-up/install-with-docker/&#34;&gt;Install with Docker&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;use-stdio-transport&#34;&gt;Use stdio transport&lt;/h2&gt;
&lt;p&gt;With stdio (the default when you run the binary or uvx), the server talks to the client over standard input and output. Use this when the client launches the server as a subprocess (for example, Claude Desktop, Cursor). No &lt;code&gt;--address&lt;/code&gt; or port is needed.&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;Bash&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-bash&#34;&gt;mcp-grafana
# or
uvx mcp-grafana&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;use-sse-or-streamable-http-transport&#34;&gt;Use SSE or streamable-http transport&lt;/h2&gt;
&lt;p&gt;With &lt;code&gt;-t sse&lt;/code&gt; or &lt;code&gt;-t streamable-http&lt;/code&gt;, the server listens on an address (default &lt;code&gt;localhost:8000&lt;/code&gt;). Use &lt;code&gt;--address&lt;/code&gt; to change host and port, and optionally &lt;code&gt;--base-path&lt;/code&gt; or &lt;code&gt;--endpoint-path&lt;/code&gt; for path configuration.&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;Bash&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-bash&#34;&gt;mcp-grafana -t sse
mcp-grafana -t streamable-http --address :9090&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Clients connect to the server URL (for example, &lt;code&gt;http://localhost:8000/sse&lt;/code&gt; for SSE). For streamable-http, the default endpoint path is &lt;code&gt;/mcp&lt;/code&gt; (override with &lt;code&gt;--endpoint-path&lt;/code&gt; if your client expects a different path).&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--base-path&lt;/code&gt; prefixes the application routes on the listener:&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;Bash&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-bash&#34;&gt;mcp-grafana -t sse --address :8000 --base-path /my-base --metrics&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;serves &lt;code&gt;/my-base/sse&lt;/code&gt;. &lt;code&gt;/healthz&lt;/code&gt; and &lt;code&gt;/metrics&lt;/code&gt; are internal-only endpoints for probes and scrapers, so they always stay at the server root — never under &lt;code&gt;--base-path&lt;/code&gt; — regardless of this flag.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Over SSE, per-request headers do not reach tool calls: &lt;code&gt;X-Grafana-Service-Account-Token&lt;/code&gt; / &lt;code&gt;X-Grafana-API-Key&lt;/code&gt;, &lt;code&gt;X-Grafana-Org-Id&lt;/code&gt;, and headers listed in &lt;code&gt;GRAFANA_FORWARD_HEADERS&lt;/code&gt; have no effect, tool calls use the server&amp;rsquo;s environment credentials, and &lt;code&gt;X-Grafana-URL&lt;/code&gt; overrides do not work. Use streamable-http when each caller needs its own Grafana URL, credentials, or organization.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../server-tls-streamable-http/&#34;&gt;Server TLS (streamable-http)&lt;/a&gt; if you need HTTPS for the MCP server.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../client-tls-grafana-connection/&#34;&gt;Client TLS&lt;/a&gt; if Grafana is behind mTLS or custom certificates.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="transports-and-addresses">Transports and addresses&lt;/h1>
&lt;p>The Grafana MCP server supports three transports: stdio (default for local use), SSE, and streamable-http. Choose the one that matches how your MCP client connects.&lt;/p></description></item><item><title>Enable and disable tools</title><link>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/enable-and-disable-tools/</link><pubDate>Mon, 19 Oct 2026 10:16:42 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/enable-and-disable-tools/</guid><content><![CDATA[&lt;h1 id=&#34;enable-and-disable-tools&#34;&gt;Enable and disable tools&lt;/h1&gt;
&lt;p&gt;You can limit which tools the server exposes (to reduce context window use or lock down capabilities) and run the server in read-only mode.&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 enable only the tool categories you need, or disable write operations globally with &lt;code&gt;--disable-write&lt;/code&gt;.&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 installed and configured (&lt;a href=&#34;../../set-up/&#34;&gt;Set up&lt;/a&gt; and &lt;a href=&#34;../authentication/&#34;&gt;Authentication&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;enable-optional-tool-categories&#34;&gt;Enable optional tool categories&lt;/h2&gt;
&lt;p&gt;Some tool categories are disabled by default:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;runpanelquery&lt;/strong&gt; – Run dashboard panel queries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;examples&lt;/strong&gt; – Query examples for datasource types.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;sql&lt;/strong&gt; – SQL datasource tools (ClickHouse, Snowflake, Athena, MySQL, PostgreSQL, MSSQL). Back-compat aliases &lt;code&gt;clickhouse&lt;/code&gt;, &lt;code&gt;snowflake&lt;/code&gt;, &lt;code&gt;athena&lt;/code&gt; also work.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;cloudwatch&lt;/strong&gt; – CloudWatch tools.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;cloudlogging&lt;/strong&gt; – Google Cloud Logging tools (requires the &lt;code&gt;googlecloud-logging-datasource&lt;/code&gt; plugin, version 1.8.0 or later).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;elasticsearch&lt;/strong&gt; – Elasticsearch query tool.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;quickwit&lt;/strong&gt; – Quickwit query tool.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;influxdb&lt;/strong&gt; – InfluxDB query tool (Flux and InfluxQL).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;agento11y&lt;/strong&gt; – Agent Observability tools for LLM conversations, generations, evaluation scores, agents, evaluators, eval rules, guards, saved conversations, collections, offline experiments, and the test suites those experiments run against.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;assistant&lt;/strong&gt; – Grafana Assistant tool (&lt;code&gt;ask_assistant&lt;/code&gt;); requires the Grafana Assistant plugin and is write-gated.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;admin&lt;/strong&gt; – Admin tools (teams, users, roles, permissions).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;--enabled-tools&lt;/code&gt; &lt;strong&gt;replaces&lt;/strong&gt; the default list, so to add an optional category you must pass the full set. For example, to keep the defaults and also enable &lt;code&gt;runpanelquery&lt;/code&gt; and &lt;code&gt;examples&lt;/code&gt;:&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;Bash&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-bash&#34;&gt;mcp-grafana --enabled-tools search,datasource,incident,prometheus,loki,alerting,dashboard,folder,oncall,asserts,pyroscope,navigation,tempo,annotations,rendering,snapshot,runpanelquery,examples&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../command-line-flags/&#34;&gt;Command-line flags&lt;/a&gt; for the default list.&lt;/p&gt;
&lt;h2 id=&#34;disable-tool-categories&#34;&gt;Disable tool categories&lt;/h2&gt;
&lt;p&gt;Use &lt;code&gt;--disable-&amp;lt;category&amp;gt;&lt;/code&gt; to turn off a whole category (for example, &lt;code&gt;--disable-oncall&lt;/code&gt;, &lt;code&gt;--disable-alerting&lt;/code&gt;, &lt;code&gt;--disable-dashboard&lt;/code&gt;). For every flag, read-only behavior, and TLS-related flags, refer to &lt;a href=&#34;../command-line-flags/&#34;&gt;Command-line flags&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Tempo tools can be disabled with &lt;code&gt;--disable-tempo&lt;/code&gt; or removed from &lt;code&gt;--enabled-tools&lt;/code&gt;. They also respect &lt;code&gt;--disable-query&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;run-in-read-only-mode&#34;&gt;Run in read-only mode&lt;/h2&gt;
&lt;p&gt;Use &lt;code&gt;--disable-write&lt;/code&gt; to disable all write operations. The server can still read dashboards, run queries, and list resources, but it cannot create or update dashboards, incidents, alert groups, alert rules, annotations, snapshots, or Agent Observability evaluators, eval rules, guards, saved conversations, and collections.&lt;/p&gt;
&lt;p&gt;Read-only mode also removes &lt;code&gt;query_sql&lt;/code&gt; and &lt;code&gt;query_influxdb&lt;/code&gt;: they pass the query to the datasource unfiltered, so they can write whenever the datasource credentials permit it. Add &lt;code&gt;--enable-query&lt;/code&gt; to keep them when those credentials are known to be read-only.&lt;/p&gt;
&lt;p&gt;In read-only mode, &lt;code&gt;generate_deeplink&lt;/code&gt; ignores &lt;code&gt;shorten=true&lt;/code&gt; and returns the full URL, because Grafana creates short URLs through a &lt;code&gt;POST&lt;/code&gt; request. Add &lt;code&gt;--enable-write-tools=generate_deeplink&lt;/code&gt; to keep URL shortening without re-enabling any other write tool.&lt;/p&gt;
&lt;h2 id=&#34;run-without-query-execution&#34;&gt;Run without query execution&lt;/h2&gt;
&lt;p&gt;Use &lt;code&gt;--disable-query&lt;/code&gt; to remove every tool that executes a query against a datasource, such as &lt;code&gt;query_prometheus&lt;/code&gt;, &lt;code&gt;query_loki_logs&lt;/code&gt;, &lt;code&gt;query_sql&lt;/code&gt;, and &lt;code&gt;run_panel_query&lt;/code&gt;. The server can still list datasources and dashboards, explore metric names, labels, and table schemas, and generate deeplinks, but it can&amp;rsquo;t run the queries themselves.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--disable-query&lt;/code&gt; is the strongest of the three query settings: it wins over &lt;code&gt;--enable-query&lt;/code&gt;, and it removes the query tools that &lt;code&gt;--disable-write&lt;/code&gt; leaves in place. Refer to &lt;a href=&#34;../command-line-flags/&#34;&gt;Command-line flags&lt;/a&gt; for the full list of affected tools.&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 an overview of tools and RBAC.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../authentication/&#34;&gt;Configure authentication&lt;/a&gt; if you have not set credentials yet.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="enable-and-disable-tools">Enable and disable tools&lt;/h1>
&lt;p>You can limit which tools the server exposes (to reduce context window use or lock down capabilities) and run the server in read-only mode.&lt;/p></description></item><item><title>Client TLS (Grafana connection)</title><link>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/client-tls-grafana-connection/</link><pubDate>Wed, 29 Jul 2026 17:47:59 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/client-tls-grafana-connection/</guid><content><![CDATA[&lt;h1 id=&#34;client-tls-grafana-connection&#34;&gt;Client TLS (Grafana connection)&lt;/h1&gt;
&lt;p&gt;If your Grafana instance uses mTLS or a custom CA, configure the MCP server to use the correct certificates when it calls the Grafana API.&lt;/p&gt;
&lt;h2 id=&#34;what-youll-achieve&#34;&gt;What you&amp;rsquo;ll achieve&lt;/h2&gt;
&lt;p&gt;The server uses your client certificate and key (and optionally a CA file) for HTTPS requests to Grafana, or verifies Grafana’s server certificate with a custom CA.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Client certificate and key (and CA file if needed) for your Grafana endpoint.&lt;/li&gt;
&lt;li&gt;The server installed (binary or Docker with access to the cert files).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-client-tls&#34;&gt;Configure client TLS&lt;/h2&gt;
&lt;p&gt;Use these flags when starting the server:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&amp;ndash;tls-cert-file&lt;/strong&gt; – Path to the client certificate file.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;ndash;tls-key-file&lt;/strong&gt; – Path to the client private key file.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;ndash;tls-ca-file&lt;/strong&gt; – Path to the CA certificate file for server verification.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;ndash;tls-skip-verify&lt;/strong&gt; – Skip TLS verification (insecure; use only for testing).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Example:&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;Bash&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-bash&#34;&gt;mcp-grafana \
  --tls-cert-file /path/to/client.crt \
  --tls-key-file /path/to/client.key \
  --tls-ca-file /path/to/ca.crt&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With Docker, mount the cert directory and pass the paths inside the container (for example, &lt;code&gt;/certs/client.crt&lt;/code&gt;).&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;../../set-up/client-configuration-examples/&#34;&gt;Client configuration examples&lt;/a&gt; for full MCP JSON (binary and Docker) with TLS flags.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../server-tls-streamable-http/&#34;&gt;Server TLS (streamable-http)&lt;/a&gt; if you want HTTPS for the MCP server itself.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../authentication/&#34;&gt;Authentication&lt;/a&gt; for Grafana credentials.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../command-line-flags/&#34;&gt;Command-line flags&lt;/a&gt; for all TLS-related flags.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="client-tls-grafana-connection">Client TLS (Grafana connection)&lt;/h1>
&lt;p>If your Grafana instance uses mTLS or a custom CA, configure the MCP server to use the correct certificates when it calls the Grafana API.&lt;/p></description></item><item><title>Server TLS (streamable-http)</title><link>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/server-tls-streamable-http/</link><pubDate>Wed, 29 Jul 2026 17:47:59 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/server-tls-streamable-http/</guid><content><![CDATA[&lt;h1 id=&#34;server-tls-streamable-http&#34;&gt;Server TLS (streamable-http)&lt;/h1&gt;
&lt;p&gt;When you use the streamable-http transport, you can serve the MCP server over HTTPS using your own TLS certificate and key.&lt;/p&gt;
&lt;h2 id=&#34;what-youll-achieve&#34;&gt;What you&amp;rsquo;ll achieve&lt;/h2&gt;
&lt;p&gt;Clients connect to the server with &lt;code&gt;https://&lt;/code&gt; instead of &lt;code&gt;http://&lt;/code&gt;. This is separate from client TLS, which configures how the server connects to Grafana.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A TLS certificate and private key for the host and port where the server will listen.&lt;/li&gt;
&lt;li&gt;The server run with &lt;code&gt;-t streamable-http&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-server-tls&#34;&gt;Configure server TLS&lt;/h2&gt;
&lt;p&gt;Use these flags with streamable-http:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&amp;ndash;server.tls-cert-file&lt;/strong&gt; – Path to the server TLS certificate file.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;ndash;server.tls-key-file&lt;/strong&gt; – Path to the server TLS private key file.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Example:&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;Bash&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-bash&#34;&gt;mcp-grafana -t streamable-http \
  --server.tls-cert-file /path/to/server.crt \
  --server.tls-key-file /path/to/server.key \
  --address :8443&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Clients then connect to &lt;code&gt;https://localhost:8443&lt;/code&gt; with the streamable-http path (default &lt;code&gt;--endpoint-path&lt;/code&gt; is &lt;code&gt;/mcp&lt;/code&gt;, for example &lt;code&gt;https://localhost:8443/mcp&lt;/code&gt;).&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;../transports-and-addresses/&#34;&gt;Transports and addresses&lt;/a&gt; for transport options.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../client-tls-grafana-connection/&#34;&gt;Client TLS (Grafana connection)&lt;/a&gt; for TLS toward Grafana.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="server-tls-streamable-http">Server TLS (streamable-http)&lt;/h1>
&lt;p>When you use the streamable-http transport, you can serve the MCP server over HTTPS using your own TLS certificate and key.&lt;/p>
&lt;h2 id="what-youll-achieve">What you&amp;rsquo;ll achieve&lt;/h2>
&lt;p>Clients connect to the server with &lt;code>https://&lt;/code> instead of &lt;code>http://&lt;/code>. This is separate from client TLS, which configures how the server connects to Grafana.&lt;/p></description></item><item><title>Multi-organization and headers</title><link>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/multi-organization-and-headers/</link><pubDate>Thu, 01 Oct 2026 13:22:11 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/multi-organization-and-headers/</guid><content><![CDATA[&lt;h1 id=&#34;multi-organization-and-headers&#34;&gt;Multi-organization and headers&lt;/h1&gt;
&lt;p&gt;You can point the server at a specific Grafana organization and add custom HTTP headers to every request to Grafana.&lt;/p&gt;
&lt;h2 id=&#34;what-youll-achieve&#34;&gt;What you&amp;rsquo;ll achieve&lt;/h2&gt;
&lt;p&gt;All Grafana API calls use the chosen organization context, and any extra headers you need (for example, tenant or custom auth) are sent automatically.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A Grafana instance with multiple organizations (or a need for custom headers).&lt;/li&gt;
&lt;li&gt;The server configured with &lt;a href=&#34;../authentication/&#34;&gt;Authentication&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;set-the-organization&#34;&gt;Set the organization&lt;/h2&gt;
&lt;p&gt;Set &lt;strong&gt;GRAFANA_ORG_ID&lt;/strong&gt; to the numeric organization ID. The server sends &lt;code&gt;X-Grafana-Org-Id&lt;/code&gt; on all requests to Grafana.&lt;/p&gt;
&lt;p&gt;When using streamable-http, you can also send &lt;strong&gt;X-Grafana-Org-Id&lt;/strong&gt; from the client; the header takes precedence over the environment variable so you can override the default org per request.&lt;/p&gt;
&lt;h2 id=&#34;select-an-organization-per-tool-call&#34;&gt;Select an organization per tool call&lt;/h2&gt;
&lt;p&gt;The settings above fix the organization for the whole connection. To let a single connection target different organizations per call, start the server with the &lt;code&gt;--dynamic-multi-org&lt;/code&gt; flag. This is off by default.&lt;/p&gt;
&lt;p&gt;When enabled:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Every tool accepts an optional &lt;code&gt;orgId&lt;/code&gt; argument that overrides the connection&amp;rsquo;s organization for that call, setting both the &lt;code&gt;X-Grafana-Org-Id&lt;/code&gt; header and, for app-platform APIs, the resolved Kubernetes namespace. Calls that omit &lt;code&gt;orgId&lt;/code&gt; use the connection&amp;rsquo;s default organization.&lt;/li&gt;
&lt;li&gt;Tempo tools resolve the datasource in the calling organization, so you can target a Tempo datasource in any org with &lt;code&gt;orgId&lt;/code&gt; plus its &lt;code&gt;datasourceUid&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This only works for credentials that belong to more than one organization (for example a user or on-behalf-of identity); a service-account token stays bound to its single organization. Call the &lt;code&gt;user_info&lt;/code&gt; tool to discover which &lt;code&gt;orgId&lt;/code&gt; values are valid.&lt;/p&gt;
&lt;h2 id=&#34;send-custom-headers&#34;&gt;Send custom headers&lt;/h2&gt;
&lt;p&gt;Set &lt;strong&gt;GRAFANA_EXTRA_HEADERS&lt;/strong&gt; to a JSON object mapping header names to values. These headers are added to every Grafana API request.&lt;/p&gt;
&lt;p&gt;Example:&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;GRAFANA_EXTRA_HEADERS&amp;#34;: &amp;#34;{\&amp;#34;X-Custom-Header\&amp;#34;: \&amp;#34;value\&amp;#34;, \&amp;#34;X-Tenant-ID\&amp;#34;: \&amp;#34;tenant-123\&amp;#34;}&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../authentication/&#34;&gt;Authentication&lt;/a&gt; for Grafana credentials.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../enable-and-disable-tools/&#34;&gt;Enable and disable tools&lt;/a&gt; to limit which tools are available.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="multi-organization-and-headers">Multi-organization and headers&lt;/h1>
&lt;p>You can point the server at a specific Grafana organization and add custom HTTP headers to every request to Grafana.&lt;/p>
&lt;h2 id="what-youll-achieve">What you&amp;rsquo;ll achieve&lt;/h2>
&lt;p>All Grafana API calls use the chosen organization context, and any extra headers you need (for example, tenant or custom auth) are sent automatically.&lt;/p></description></item><item><title>Command-line flags</title><link>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/command-line-flags/</link><pubDate>Mon, 19 Oct 2026 10:16:42 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/command-line-flags/</guid><content><![CDATA[&lt;h1 id=&#34;command-line-flags&#34;&gt;Command-line flags&lt;/h1&gt;
&lt;p&gt;The &lt;code&gt;mcp-grafana&lt;/code&gt; binary accepts flags for transports, tools, TLS, and observability. Run &lt;code&gt;mcp-grafana --help&lt;/code&gt; for the exact list in your installed build.&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 can look up defaults, choose &lt;code&gt;--disable-*&lt;/code&gt; flags, or configure TLS without reading the source.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;You need a way to run &lt;code&gt;mcp-grafana&lt;/code&gt; on your machine—for example, a &lt;a href=&#34;../../set-up/install-the-binary/&#34;&gt;release binary&lt;/a&gt;, &lt;a href=&#34;../../set-up/install-with-uvx/&#34;&gt;&lt;code&gt;uvx&lt;/code&gt;&lt;/a&gt;, or a &lt;a href=&#34;../../set-up/install-with-docker/&#34;&gt;container&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-transport-and-http-options&#34;&gt;Configure transport and HTTP options&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-t&lt;/code&gt; / &lt;code&gt;--transport&lt;/code&gt;: Transport type (&lt;code&gt;stdio&lt;/code&gt;, &lt;code&gt;sse&lt;/code&gt;, or &lt;code&gt;streamable-http&lt;/code&gt;). Default: &lt;code&gt;stdio&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--address&lt;/code&gt;: Host and port for the SSE or streamable-http server. Default: &lt;code&gt;localhost:8000&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--base-path&lt;/code&gt;: Base path for the SSE or streamable-http server. With &lt;code&gt;--base-path /my-base&lt;/code&gt;, SSE is at &lt;code&gt;/my-base/sse&lt;/code&gt; and streamable-http at &lt;code&gt;/my-base/mcp&lt;/code&gt;. &lt;code&gt;/healthz&lt;/code&gt; and &lt;code&gt;/metrics&lt;/code&gt; are internal-only endpoints for probes and scrapers and always stay at the server root, never under this prefix.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--endpoint-path&lt;/code&gt;: HTTP path for the streamable-http MCP endpoint, appended to &lt;code&gt;--base-path&lt;/code&gt;. Default: &lt;code&gt;/mcp&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--instructions-append&lt;/code&gt;: Text appended to the server instructions returned to MCP clients on initialize, so every connecting agent sees it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-http-transport-security&#34;&gt;Configure HTTP transport security&lt;/h2&gt;
&lt;p&gt;The SSE and streamable-http transports validate &lt;code&gt;Host&lt;/code&gt; and &lt;code&gt;Origin&lt;/code&gt; headers on every route on the MCP listener (&lt;code&gt;/sse&lt;/code&gt;, &lt;code&gt;/mcp&lt;/code&gt;, and &lt;code&gt;/healthz&lt;/code&gt; / &lt;code&gt;/metrics&lt;/code&gt; when they stay on that listener) to block DNS-rebinding attacks. Stdio transport is unaffected. Side listeners started by &lt;code&gt;--healthz-address&lt;/code&gt; or &lt;code&gt;--metrics-address&lt;/code&gt; are not wrapped.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--allowed-hosts&lt;/code&gt;: Comma-separated allowlist of &lt;code&gt;Host&lt;/code&gt; header values. When unset (or when the parsed value is empty — for example, &lt;code&gt;,,,&lt;/code&gt;), it falls back to loopback variants of &lt;code&gt;--address&lt;/code&gt; (for example, &lt;code&gt;localhost:8000&lt;/code&gt;, &lt;code&gt;127.0.0.1:8000&lt;/code&gt;, &lt;code&gt;[::1]:8000&lt;/code&gt;). Pass &lt;code&gt;*&lt;/code&gt; to disable &lt;code&gt;Host&lt;/code&gt; validation — only safe when a trusted reverse proxy validates &lt;code&gt;Host&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--allowed-origins&lt;/code&gt;: Comma-separated allowlist of &lt;code&gt;Origin&lt;/code&gt; header values. Empty by default — any request that carries an &lt;code&gt;Origin&lt;/code&gt; header is rejected (browsers always send &lt;code&gt;Origin&lt;/code&gt; for cross-origin requests, and no browser should be calling this server directly). Pass an explicit list to permit browser clients, or &lt;code&gt;*&lt;/code&gt; to disable the check.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When deploying behind an ingress or reverse proxy that forwards the original &lt;code&gt;Host&lt;/code&gt;, set &lt;code&gt;--allowed-hosts&lt;/code&gt; to the expected hostname (for example, &lt;code&gt;--allowed-hosts mcp.example.com&lt;/code&gt;). Kubernetes &lt;code&gt;httpGet&lt;/code&gt; liveness/readiness probes send &lt;code&gt;Host: &amp;lt;pod-ip&amp;gt;:&amp;lt;port&amp;gt;&lt;/code&gt; by default — either set &lt;code&gt;--allowed-hosts &#39;*&#39;&lt;/code&gt;, override the probe&amp;rsquo;s &lt;code&gt;host:&lt;/code&gt; field, use a &lt;code&gt;tcpSocket&lt;/code&gt; probe, or bind &lt;code&gt;/healthz&lt;/code&gt; on &lt;code&gt;--healthz-address&lt;/code&gt; (and &lt;code&gt;/metrics&lt;/code&gt; on &lt;code&gt;--metrics-address&lt;/code&gt;). Those side listeners are not wrapped by Host/Origin validation.&lt;/p&gt;
&lt;h2 id=&#34;configure-caller-authentication&#34;&gt;Configure caller authentication&lt;/h2&gt;
&lt;p&gt;The SSE and streamable-http transports can authenticate the &lt;strong&gt;caller&lt;/strong&gt; (the MCP client connecting to &lt;code&gt;mcp-grafana&lt;/code&gt;). This is separate from the credentials the server uses to reach Grafana: it controls &lt;em&gt;who may invoke the server&lt;/em&gt;, so an unauthenticated client can&amp;rsquo;t borrow the server&amp;rsquo;s Grafana identity or run tools. Stdio is a local pipe and is never affected.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--server-auth-token&lt;/code&gt;: Bearer token that callers must present in the &lt;code&gt;Authorization: Bearer &amp;lt;token&amp;gt;&lt;/code&gt; header. Falls back to the &lt;code&gt;MCP_GRAFANA_SERVER_TOKEN&lt;/code&gt; environment variable. When set, requests without a valid token are rejected with &lt;code&gt;401&lt;/code&gt; before any tool runs. Prefer the environment variable over the flag so the secret doesn&amp;rsquo;t appear in the process argument list.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;bind-policy&#34;&gt;Bind policy&lt;/h3&gt;
&lt;p&gt;Caller authentication is enforced only when &lt;code&gt;--server-auth-token&lt;/code&gt; is set. When it isn&amp;rsquo;t, the network transports warn (but still start) on an externally reachable address:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Transport / bind&lt;/th&gt;
              &lt;th&gt;Behavior&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;stdio&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No caller authentication (local pipe).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;SSE / streamable-http on a loopback address (&lt;code&gt;localhost&lt;/code&gt;, &lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;::1&lt;/code&gt;)&lt;/td&gt;
              &lt;td&gt;Caller token optional.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;SSE / streamable-http on any other address&lt;/td&gt;
              &lt;td&gt;Starts and logs a &lt;strong&gt;security error&lt;/strong&gt; (at the &lt;code&gt;error&lt;/code&gt; log level, so it isn&amp;rsquo;t suppressed by &lt;code&gt;--log-level&lt;/code&gt;) unless &lt;code&gt;--server-auth-token&lt;/code&gt; is set.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The permissive default preserves backward compatibility for existing deployments (such as the container&amp;rsquo;s &lt;code&gt;0.0.0.0&lt;/code&gt; bind). A future major release will make an unauthenticated non-loopback bind a startup error. Set &lt;code&gt;--server-auth-token&lt;/code&gt; now to require caller authentication and prepare for that change.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Bearer authentication only protects the token in transit if the connection is encrypted. Terminate TLS in front of the server, or use &lt;a href=&#34;../server-tls-streamable-http/&#34;&gt;server TLS for streamable-http&lt;/a&gt;, whenever you set &lt;code&gt;--server-auth-token&lt;/code&gt; on a non-loopback address.&lt;/p&gt;
&lt;p&gt;When caller authentication is enabled, the &lt;code&gt;Authorization&lt;/code&gt; header is reserved for the caller token and is stripped after validation, so it is never forwarded to Grafana. Setting &lt;code&gt;--server-auth-token&lt;/code&gt; together with &lt;code&gt;GRAFANA_FORWARD_HEADERS=Authorization&lt;/code&gt; is contradictory and the server refuses to start; remove &lt;code&gt;Authorization&lt;/code&gt; from &lt;code&gt;GRAFANA_FORWARD_HEADERS&lt;/code&gt;, or unset the caller token to run in proxy-forwarding mode.&lt;/p&gt;
&lt;h2 id=&#34;select-a-grafana-url-per-request&#34;&gt;Select a Grafana URL per request&lt;/h2&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;URL overrides let MCP callers select outbound HTTP(S) destinations. An allowlist limits URLs but does not authenticate callers, bind tokens to targets, or enforce network egress policy.&lt;/p&gt;
&lt;p&gt;Deploy behind an authenticating proxy that authorizes each caller&amp;rsquo;s target, removes client-supplied &lt;code&gt;X-Grafana-URL&lt;/code&gt; and Grafana token headers, and supplies the approved URL with its matching token. Restrict outbound access to approved destinations with a network policy, firewall, or egress proxy. These controls matter even with an allowlist.&lt;/p&gt;
&lt;p&gt;Without a URL allowlist, a fake request token can cause requests to any reachable HTTP(S) service, including internal and metadata services.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;On the streamable-http transport, callers can select a Grafana instance for each request. This is disabled by default.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--allow-grafana-url-override&lt;/code&gt;: Enable selection through &lt;code&gt;X-Grafana-URL&lt;/code&gt;. Falls back to &lt;code&gt;GRAFANA_ALLOW_URL_OVERRIDE&lt;/code&gt; when the flag is not set.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--allowed-grafana-urls&lt;/code&gt;: Optional comma-separated list of exact Grafana base URLs that callers may select. Falls back to &lt;code&gt;GRAFANA_ALLOWED_URLS&lt;/code&gt; when the flag is not set. It requires the enable switch; an explicitly empty flag clears an inherited list.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a large fleet selected by a proxy, &lt;code&gt;GRAFANA_ALLOW_URL_OVERRIDE=true&lt;/code&gt; enables selection without listing every instance in &lt;code&gt;GRAFANA_ALLOWED_URLS&lt;/code&gt;. The deployment controls in the warning above still apply. The proxy must send both &lt;code&gt;X-Grafana-URL: &amp;lt;target base URL&amp;gt;&lt;/code&gt; and &lt;code&gt;X-Grafana-Service-Account-Token: &amp;lt;token for that target&amp;gt;&lt;/code&gt; on each MCP request. The deprecated &lt;code&gt;X-Grafana-API-Key&lt;/code&gt; header also works. The server uses the token from that request and does not send its environment Grafana credentials to a selected target. If caller authentication is configured, the &lt;code&gt;Authorization&lt;/code&gt; header carries the separate MCP caller token.&lt;/p&gt;
&lt;p&gt;Without &lt;code&gt;--allowed-grafana-urls&lt;/code&gt;, the server logs a security error at startup. Outbound Grafana requests are pinned to the selected base URL, including across redirects. Selection does not work over SSE, which does not pass per-request headers to tool calls; a selected URL there is used without the caller&amp;rsquo;s token, so the calls fail.&lt;/p&gt;
&lt;h2 id=&#34;configure-debug-and-logging&#34;&gt;Configure debug and logging&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--debug&lt;/code&gt;: Enable debug mode for detailed HTTP request and response logging to and from the Grafana API.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--log-level&lt;/code&gt;: Log level (&lt;code&gt;debug&lt;/code&gt;, &lt;code&gt;info&lt;/code&gt;, &lt;code&gt;warn&lt;/code&gt;, &lt;code&gt;error&lt;/code&gt;). Default: &lt;code&gt;info&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-observability-endpoints&#34;&gt;Configure observability endpoints&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--metrics&lt;/code&gt;: Expose a Prometheus metrics endpoint at &lt;code&gt;/metrics&lt;/code&gt; (SSE and streamable-http only).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--metrics-address&lt;/code&gt;: Optional separate listen address for metrics (for example, &lt;code&gt;:9090&lt;/code&gt;). If empty, metrics are served on the main HTTP server.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--healthz-address&lt;/code&gt;: Optional separate listen address for &lt;code&gt;/healthz&lt;/code&gt; (for example, &lt;code&gt;:8080&lt;/code&gt;). If empty, &lt;code&gt;/healthz&lt;/code&gt; is served on the main HTTP server. If this matches &lt;code&gt;--metrics-address&lt;/code&gt;, both routes share one extra listener. The side listener is not wrapped by Host/Origin validation, so Kubernetes probes can reach it while &lt;code&gt;--address&lt;/code&gt; stays on loopback.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-anonymous-usage-statistics&#34;&gt;Configure anonymous usage statistics&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--usage-stats&lt;/code&gt;: Anonymous usage statistics reporting: &lt;code&gt;enabled&lt;/code&gt;, &lt;code&gt;disabled&lt;/code&gt;, or &lt;code&gt;log&lt;/code&gt; to print the report that would be sent to stderr and send nothing. Overrides the &lt;code&gt;GRAFANA_USAGE_STATS&lt;/code&gt; environment variable. Default: &lt;code&gt;enabled&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;GRAFANA_USAGE_STATS_ENDPOINT&lt;/code&gt; changes where reports are sent.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../../anonymous-usage-statistics/&#34;&gt;Anonymous usage statistics&lt;/a&gt; for the full list of fields, what is never sent, and how to read the data.&lt;/p&gt;
&lt;h2 id=&#34;configure-tool-categories&#34;&gt;Configure tool categories&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--enabled-tools&lt;/code&gt;: Comma-separated list of enabled tool &lt;strong&gt;categories&lt;/strong&gt;. The default is exactly:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;search,datasource,incident,prometheus,loki,alerting,dashboard,folder,oncall,asserts,pyroscope,navigation,tempo,annotations,rendering,snapshot,docs&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Categories &lt;strong&gt;not&lt;/strong&gt; in that default string are off until you add them, including: &lt;code&gt;admin&lt;/code&gt;, &lt;code&gt;agento11y&lt;/code&gt;, &lt;code&gt;assistant&lt;/code&gt;, &lt;code&gt;elasticsearch&lt;/code&gt;, &lt;code&gt;cloudwatch&lt;/code&gt;, &lt;code&gt;cloudlogging&lt;/code&gt;, &lt;code&gt;examples&lt;/code&gt;, &lt;code&gt;sql&lt;/code&gt;, &lt;code&gt;influxdb&lt;/code&gt;, &lt;code&gt;quickwit&lt;/code&gt;, and &lt;code&gt;runpanelquery&lt;/code&gt;. Pass a full comma-separated list to replace the default entirely, or use &lt;code&gt;--disable-*&lt;/code&gt; flags to turn off pieces of the default set. Back-compat aliases &lt;code&gt;clickhouse&lt;/code&gt;, &lt;code&gt;snowflake&lt;/code&gt;, and &lt;code&gt;athena&lt;/code&gt; map to &lt;code&gt;sql&lt;/code&gt;; &lt;code&gt;proxied&lt;/code&gt; maps to &lt;code&gt;tempo&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-search&lt;/code&gt;: Disable search tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-datasource&lt;/code&gt;: Disable datasource tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-incident&lt;/code&gt;: Disable incident tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-prometheus&lt;/code&gt;: Disable Prometheus tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-write&lt;/code&gt;: Disable write tools (read-only mode; refer to the following section).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-query&lt;/code&gt;: Disable query tools (tools that execute a query against a datasource; refer to the following section).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--enable-query&lt;/code&gt;: Keep the raw-SQL query tools registered under &lt;code&gt;--disable-write&lt;/code&gt; (refer to the following section).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--enable-write-tools&lt;/code&gt;: Comma-separated list of individual tool names to keep registered under &lt;code&gt;--disable-write&lt;/code&gt;, for example, &lt;code&gt;query_sql&lt;/code&gt;, &lt;code&gt;query_influxdb&lt;/code&gt;, or &lt;code&gt;generate_deeplink&lt;/code&gt;. Has no effect on a tool whose whole category is disabled.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-loki&lt;/code&gt;: Disable Loki tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-elasticsearch&lt;/code&gt;: Disable Elasticsearch tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-quickwit&lt;/code&gt;: Disable Quickwit tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-influxdb&lt;/code&gt;: Disable InfluxDB tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-alerting&lt;/code&gt;: Disable alerting tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-dashboard&lt;/code&gt;: Disable dashboard tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-folder&lt;/code&gt;: Disable folder tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-oncall&lt;/code&gt;: Disable OnCall tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-asserts&lt;/code&gt;: Disable Asserts tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-admin&lt;/code&gt;: Disable admin tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-pyroscope&lt;/code&gt;: Disable Pyroscope tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-navigation&lt;/code&gt;: Disable navigation (deeplink) tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-rendering&lt;/code&gt;: Disable rendering tools (panel or dashboard image export).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-snapshot&lt;/code&gt;: Disable snapshot tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-cloudwatch&lt;/code&gt;: Disable CloudWatch tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-cloudlogging&lt;/code&gt;: Disable Google Cloud Logging tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-examples&lt;/code&gt;: Disable query examples tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-sql&lt;/code&gt;: Disable SQL datasource tools (ClickHouse, Snowflake, Athena, MySQL, PostgreSQL, MSSQL). Aliases &lt;code&gt;--disable-clickhouse&lt;/code&gt;, &lt;code&gt;--disable-snowflake&lt;/code&gt;, &lt;code&gt;--disable-athena&lt;/code&gt; also work.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-runpanelquery&lt;/code&gt;: Disable run panel query tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-annotations&lt;/code&gt;: Disable annotation tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-tempo&lt;/code&gt;: Disable Tempo tracing tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-provisioning&lt;/code&gt;: Disable provisioning tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-agento11y&lt;/code&gt;: Disable Agent Observability tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-assistant&lt;/code&gt;: Disable Grafana Assistant tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-docs&lt;/code&gt;: Disable documentation tools.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;--disable-user&lt;/code&gt;: Disable user info tools.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-tool-limits&#34;&gt;Configure tool limits&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--max-loki-log-limit&lt;/code&gt;: Maximum number of log lines returned per &lt;code&gt;query_loki_logs&lt;/code&gt; call.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--loki-guardrail-mode&lt;/code&gt;: Loki query cost guardrail for &lt;code&gt;query_loki_logs&lt;/code&gt;: &lt;code&gt;off&lt;/code&gt; (default), &lt;code&gt;shadow&lt;/code&gt; (log queries that would be blocked, but let them run), or &lt;code&gt;enforce&lt;/code&gt; (reject them with rewrite guidance). The guardrail requires a selective stream selector, caps the effective time range (including range-vector durations like &lt;code&gt;[30d]&lt;/code&gt;), and pre-checks Loki&amp;rsquo;s index/stats byte estimate before running the query. On VictoriaLogs it applies only to selector-shaped (&lt;code&gt;{...}&lt;/code&gt;) queries — brace-less LogsQL passes through entirely and the byte-budget check never applies. Falls back to the &lt;code&gt;GRAFANA_LOKI_GUARDRAIL_MODE&lt;/code&gt; environment variable.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--loki-guardrail-max-bytes&lt;/code&gt;: Maximum bytes a single &lt;code&gt;query_loki_logs&lt;/code&gt; call may scan, estimated via Loki&amp;rsquo;s index/stats API. Defaults to 100 GiB; &lt;code&gt;0&lt;/code&gt; disables the byte-budget check. Falls back to &lt;code&gt;GRAFANA_LOKI_GUARDRAIL_MAX_BYTES&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--loki-guardrail-max-range&lt;/code&gt;: Maximum effective time range for a single &lt;code&gt;query_loki_logs&lt;/code&gt; call, including range-vector durations. Defaults to &lt;code&gt;24h&lt;/code&gt;; &lt;code&gt;0&lt;/code&gt; disables the range check. Falls back to &lt;code&gt;GRAFANA_LOKI_GUARDRAIL_MAX_RANGE&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The guardrail&amp;rsquo;s decisions are also exported as OTel counters (&lt;code&gt;mcp_loki_guardrail_admitted_total&lt;/code&gt;, &lt;code&gt;_would_block_total&lt;/code&gt;, &lt;code&gt;_blocked_total&lt;/code&gt;, &lt;code&gt;_fail_open_total&lt;/code&gt;), which is the recommended way to size the affected population before promoting from &lt;code&gt;shadow&lt;/code&gt; to &lt;code&gt;enforce&lt;/code&gt;. See &lt;a href=&#34;../../developer/observability-metrics-and-tracing/#loki-cost-guardrail-metrics&#34;&gt;Observability&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--dynamic-multi-org&lt;/code&gt;: Allow tool calls to select a Grafana organization per call via an optional &lt;code&gt;orgId&lt;/code&gt; argument. Off by default. See &lt;a href=&#34;../multi-organization-and-headers/&#34;&gt;Multi-organization support&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;run-without-query-execution&#34;&gt;Run without query execution&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;--disable-query&lt;/code&gt; removes every tool that executes a query against a datasource, and leaves the metadata and discovery tools in place.&lt;/p&gt;
&lt;p&gt;Use it when the assistant should be able to explore what exists — datasources, dashboards, metric names, labels, table schemas — without running potentially expensive or data-revealing queries; for example, with a service account that has &lt;code&gt;datasources:read&lt;/code&gt; but not &lt;code&gt;datasources:query&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The following tools are not registered when the flag is set:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Prometheus: &lt;code&gt;query_prometheus&lt;/code&gt;, &lt;code&gt;query_prometheus_histogram&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Loki: &lt;code&gt;query_loki_logs&lt;/code&gt;, &lt;code&gt;query_loki_patterns&lt;/code&gt; (&lt;code&gt;query_loki_stats&lt;/code&gt; and &lt;code&gt;analyze_loki_labels&lt;/code&gt; read the index rather than returning log content, so they stay registered)&lt;/li&gt;
&lt;li&gt;Elasticsearch and OpenSearch, Quickwit: &lt;code&gt;query_elasticsearch&lt;/code&gt;, &lt;code&gt;query_quickwit&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;SQL datasources: &lt;code&gt;query_sql&lt;/code&gt;, &lt;code&gt;query_influxdb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Graphite: &lt;code&gt;query_graphite&lt;/code&gt;, &lt;code&gt;query_graphite_density&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;CloudWatch: &lt;code&gt;query_cloudwatch&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Google Cloud Logging: &lt;code&gt;query_cloud_logging&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Pyroscope: &lt;code&gt;query_pyroscope&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Panels: &lt;code&gt;run_panel_query&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;code&gt;elasticsearch&lt;/code&gt;, &lt;code&gt;quickwit&lt;/code&gt;, &lt;code&gt;influxdb&lt;/code&gt;, and &lt;code&gt;runpanelquery&lt;/code&gt; categories contain nothing else, so they expose no tools at all when queries are disabled. Sibling tools such as &lt;code&gt;list_prometheus_metric_names&lt;/code&gt;, &lt;code&gt;list_loki_label_values&lt;/code&gt;, &lt;code&gt;describe_sql_table&lt;/code&gt;, &lt;code&gt;list_cloudwatch_metrics&lt;/code&gt;, and &lt;code&gt;list_cloud_logging_projects&lt;/code&gt; remain available.&lt;/p&gt;
&lt;p&gt;The flag gates the query tools and the &lt;code&gt;grafana_api_request&lt;/code&gt; POST-to-&lt;code&gt;/api/ds/query&lt;/code&gt; path, but doesn&amp;rsquo;t police every route to a datasource. In read-only mode, &lt;code&gt;grafana_api_request&lt;/code&gt; allows POST to &lt;code&gt;/api/ds/query&lt;/code&gt; only when query tools are enabled (same gate as the raw-SQL tools — blocked by &lt;code&gt;--disable-write&lt;/code&gt; unless &lt;code&gt;--enable-query&lt;/code&gt; overrides). &lt;code&gt;get_panel_image&lt;/code&gt;, which renders a panel server-side, is unaffected.&lt;/p&gt;
&lt;h3 id=&#34;query-execution-and-read-only-mode&#34;&gt;Query execution and read-only mode&lt;/h3&gt;
&lt;p&gt;The raw-SQL query tools — &lt;code&gt;query_sql&lt;/code&gt; and &lt;code&gt;query_influxdb&lt;/code&gt; — send the query to the datasource unfiltered, so they write whenever the datasource credentials permit it. Read-only mode removes them along with the other write tools.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--enable-query&lt;/code&gt; puts them back. Use it when the datasource credentials are known to be read-only and you want query execution in an otherwise read-only server. It doesn&amp;rsquo;t re-enable any other write tool, and it has no effect alongside &lt;code&gt;--disable-query&lt;/code&gt;, which always wins.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Flags&lt;/th&gt;
              &lt;th&gt;Safe query tools&lt;/th&gt;
              &lt;th&gt;Raw-SQL query tools&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;em&gt;(none)&lt;/em&gt;&lt;/td&gt;
              &lt;td&gt;Registered&lt;/td&gt;
              &lt;td&gt;Registered&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;--disable-write&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Registered&lt;/td&gt;
              &lt;td&gt;Not registered&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;--disable-write --enable-query&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Registered&lt;/td&gt;
              &lt;td&gt;Registered&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;--disable-query&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Not registered&lt;/td&gt;
              &lt;td&gt;Not registered&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;--disable-query --enable-query&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Not registered&lt;/td&gt;
              &lt;td&gt;Not registered&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;restrict-which-loki-streams-can-be-read&#34;&gt;Restrict which Loki streams can be read&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--loki-enforced-matchers&lt;/code&gt;: LogQL label matchers AND-ed into every native-Loki query to restrict which log streams can be read (e.g. &lt;code&gt;environment=~&amp;quot;prod|staging&amp;quot;&lt;/code&gt;). Unparseable queries are rejected; VictoriaLogs datasources are refused while set.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--loki-label-enumeration-fallback&lt;/code&gt;: What the label-enumeration tools do when negative enforced matchers can&amp;rsquo;t scope them: &lt;code&gt;reject&lt;/code&gt; (default) or &lt;code&gt;unfiltered&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-warning&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Warning&lt;/p&gt;&lt;p&gt;Enforcement applies only to the Loki query tools. Other tools can reach Loki log data through paths that never touch the enforced backend, so you must also disable them for the restriction to hold:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--disable-api&lt;/code&gt;: &lt;code&gt;grafana_api_request&lt;/code&gt; can query the Loki datasource proxy directly (full bypass).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--disable-rendering&lt;/code&gt;: &lt;code&gt;get_panel_image&lt;/code&gt; renders Loki panels server-side, producing images with unrestricted log lines.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--disable-assistant&lt;/code&gt;: &lt;code&gt;ask_assistant&lt;/code&gt; delegates to Grafana Assistant, which reads Loki server-side across all streams. It is only registered when write tools are enabled, so &lt;code&gt;--disable-write&lt;/code&gt; closes it too.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The server logs a warning at startup naming each of these that is still enabled. &lt;code&gt;run_panel_query&lt;/code&gt; is safe: it routes on the datasource&amp;rsquo;s real type resolved from its UID, so a Loki datasource always runs through the enforced query path even if the panel or the caller declares a different &lt;code&gt;datasourceType&lt;/code&gt;. Tempo tools expose only traces, not Loki logs, so they are not a bypass. Dashboard snapshots (&lt;code&gt;--disable-snapshot&lt;/code&gt;) can embed log-panel data captured outside enforcement.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;run-in-read-only-mode&#34;&gt;Run in read-only mode&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;--disable-write&lt;/code&gt; prevents write operations to Grafana. Use it with read-only service accounts, safer production assistants, or to avoid accidental changes. It also removes the raw-SQL query tools, which can write through the datasource; refer to the preceding section for &lt;code&gt;--enable-query&lt;/code&gt;, which keeps them.&lt;/p&gt;
&lt;p&gt;In read-only mode, &lt;code&gt;generate_deeplink&lt;/code&gt; ignores &lt;code&gt;shorten=true&lt;/code&gt; and returns the full URL, because Grafana creates short URLs through &lt;code&gt;POST /api/short-urls&lt;/code&gt;. Add &lt;code&gt;--enable-write-tools=generate_deeplink&lt;/code&gt; to keep URL shortening without re-enabling any other write tool.&lt;/p&gt;
&lt;p&gt;When enabled, the following writes are disabled:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dashboard tools&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;update_dashboard&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Folder tools&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;create_folder&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Incident tools&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;create_incident&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;add_activity_to_incident&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;update_incident&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Alerting tools&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;alerting_rules_write&lt;/code&gt; (create, update, delete)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;alerting_silences_write&lt;/code&gt; (create, update, delete)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;alerting_routing_write&lt;/code&gt; (create_contact_point)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;OnCall tools&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;update_alert_group&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Annotation tools&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;create_annotation&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;update_annotation&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;delete_annotation&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Snapshot tools&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;create_snapshot&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;delete_snapshot&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Agent Observability tools&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;agento11y_manage_evaluators&lt;/code&gt; (upsert, delete, fork, and test evaluators)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agento11y_manage_eval_rules&lt;/code&gt; (create, update, delete, and preview eval rules and guards)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agento11y_manage_eval_collections&lt;/code&gt; (save and delete saved conversations; create, update, and delete collections; add and remove collection members)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agento11y_manage_experiments&lt;/code&gt; (update and cancel experiments)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;agento11y_manage_test_suites&lt;/code&gt; (create and update test suites; create and publish versions; upsert and delete test cases)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Read operations (queries, lists, searches) stay available.&lt;/p&gt;
&lt;h2 id=&#34;configure-grafana-http-redirects&#34;&gt;Configure Grafana HTTP redirects&lt;/h2&gt;
&lt;p&gt;Outbound Grafana clients block redirects to a different scheme, host, or port by default. Use &lt;code&gt;--allow-cross-origin-redirects&lt;/code&gt; or set &lt;code&gt;GRAFANA_ALLOW_CROSS_ORIGIN_REDIRECTS=true&lt;/code&gt; to allow them. The flag takes precedence over the environment variable. Allowing these redirects can send Grafana credentials to the redirect target. Request-selected Grafana URLs remain pinned to their selected target.&lt;/p&gt;
&lt;h2 id=&#34;configure-client-tls-for-grafana&#34;&gt;Configure client TLS for Grafana&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--tls-cert-file&lt;/code&gt;: Client certificate for mTLS to Grafana.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--tls-key-file&lt;/code&gt;: Client private key.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--tls-ca-file&lt;/code&gt;: CA certificate for verifying Grafana’s server certificate.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--tls-skip-verify&lt;/code&gt;: Skip TLS verification (insecure; testing only).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-server-tls-for-streamable-http&#34;&gt;Configure server TLS for streamable-http&lt;/h2&gt;
&lt;p&gt;These flags secure the MCP HTTP server (between your MCP client and &lt;code&gt;mcp-grafana&lt;/code&gt;), not the connection from &lt;code&gt;mcp-grafana&lt;/code&gt; to Grafana:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--server.tls-cert-file&lt;/code&gt;: Server certificate for HTTPS.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--server.tls-key-file&lt;/code&gt;: Server private key.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;print-version-information&#34;&gt;Print version information&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--version&lt;/code&gt;: Print the version and exit.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../enable-and-disable-tools/&#34;&gt;Enable and disable tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../client-tls-grafana-connection/&#34;&gt;Client TLS (Grafana connection)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../server-tls-streamable-http/&#34;&gt;Server TLS (streamable-http)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../transports-and-addresses/&#34;&gt;Transports and addresses&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="command-line-flags">Command-line flags&lt;/h1>
&lt;p>The &lt;code>mcp-grafana&lt;/code> binary accepts flags for transports, tools, TLS, and observability. Run &lt;code>mcp-grafana --help&lt;/code> for the exact list in your installed build.&lt;/p>
&lt;h2 id="what-youll-achieve">What you&amp;rsquo;ll achieve&lt;/h2>
&lt;p>You can look up defaults, choose &lt;code>--disable-*&lt;/code> flags, or configure TLS without reading the source.&lt;/p></description></item><item><title>Health check endpoint</title><link>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/health-check-endpoint/</link><pubDate>Thu, 03 Sep 2026 07:21:20 +0000</pubDate><guid>https://grafana.com/docs/grafana/v13.1/developer-resources/mcp/configure/health-check-endpoint/</guid><content><![CDATA[&lt;h1 id=&#34;health-check-endpoint&#34;&gt;Health check endpoint&lt;/h1&gt;
&lt;p&gt;When you use the SSE (&lt;code&gt;-t sse&lt;/code&gt;) or streamable HTTP (&lt;code&gt;-t streamable-http&lt;/code&gt;) transport, the MCP server exposes a health check at &lt;code&gt;/healthz&lt;/code&gt;. Load balancers, monitoring, and orchestration can use it to verify that the server is running and accepting connections.&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 can probe readiness from scripts or upstream checks when the server uses an HTTP transport.&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 running with &lt;code&gt;-t sse&lt;/code&gt; or &lt;code&gt;-t streamable-http&lt;/code&gt; (not stdio).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;send-a-health-check-request&#34;&gt;Send a health check request&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Endpoint:&lt;/strong&gt; &lt;code&gt;GET /healthz&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Response:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Status code: &lt;code&gt;200 OK&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Body: &lt;code&gt;ok&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Examples:&lt;/strong&gt;&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;Bash&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-bash&#34;&gt;# For streamable HTTP or SSE transport with default listen address (localhost:8000)
curl http://localhost:8000/healthz

# Health check on a separate listen address (for example Kubernetes probes
# while --address is bound to 127.0.0.1 behind a sidecar)
./mcp-grafana -t streamable-http --address 127.0.0.1:8000 --healthz-address :8080
curl http://localhost:8080/healthz&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;/healthz&lt;/code&gt; handler only reports that the HTTP server is up; it does not check Grafana connectivity. A &lt;code&gt;--healthz-address&lt;/code&gt; listener is not wrapped by &lt;code&gt;--allowed-hosts&lt;/code&gt; / &lt;code&gt;--allowed-origins&lt;/code&gt; validation, matching &lt;code&gt;--metrics-address&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;:  The health check endpoint is only available when using SSE or streamable HTTP transports. It is &lt;strong&gt;not&lt;/strong&gt; available with the stdio transport (&lt;code&gt;-t stdio&lt;/code&gt;), because stdio does not start an HTTP server.&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;../transports-and-addresses/&#34;&gt;Transports and addresses&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../command-line-flags/&#34;&gt;Command-line flags&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="health-check-endpoint">Health check endpoint&lt;/h1>
&lt;p>When you use the SSE (&lt;code>-t sse&lt;/code>) or streamable HTTP (&lt;code>-t streamable-http&lt;/code>) transport, the MCP server exposes a health check at &lt;code>/healthz&lt;/code>. Load balancers, monitoring, and orchestration can use it to verify that the server is running and accepting connections.&lt;/p></description></item></channel></rss>