<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Set up the Grafana MCP server on Grafana Labs</title><link>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/set-up/</link><description>Recent content in Set up the Grafana MCP server on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v13.0/developer-resources/mcp/set-up/index.xml" rel="self" type="application/rss+xml"/><item><title>Install with uvx</title><link>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/set-up/install-with-uvx/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/set-up/install-with-uvx/</guid><content><![CDATA[&lt;h1 id=&#34;install-with-uvx&#34;&gt;Install with uvx&lt;/h1&gt;
&lt;p&gt;&lt;a href=&#34;https://docs.astral.sh/uv/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;uv&lt;/code&gt;&lt;/a&gt; is Astral&amp;rsquo;s Python package manager and toolchain. &lt;a href=&#34;https://docs.astral.sh/uv/guides/tools/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;uvx&lt;/code&gt;&lt;/a&gt; runs a command from a published package in an isolated environment, without installing that package globally. It is similar to &lt;code&gt;npx&lt;/code&gt; for Node.js.&lt;/p&gt;
&lt;p&gt;Use &lt;code&gt;uvx&lt;/code&gt; to run the Grafana MCP server without installing a release binary 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 add the server to your MCP client configuration (for example, Claude Desktop or Cursor) and connect to Grafana using a URL and a service account token.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Install &lt;a href=&#34;https://docs.astral.sh/uv/getting-started/installation/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;uv&lt;/code&gt;&lt;/a&gt; and ensure &lt;code&gt;uvx&lt;/code&gt; is in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Have a Grafana instance (Grafana 9.0 or later) and a &lt;a href=&#34;/docs/grafana/latest/administration/service-accounts/#add-a-token-to-a-service-account-in-grafana&#34;&gt;service account token&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;add-the-server-to-your-mcp-client&#34;&gt;Add the server to your MCP client&lt;/h2&gt;
&lt;p&gt;Add the following to your MCP client configuration file. Replace &lt;code&gt;http://localhost:3000&lt;/code&gt; with your Grafana URL if it is different, and &lt;code&gt;YOUR_SERVICE_ACCOUNT_TOKEN&lt;/code&gt; with your service account token.&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;mcpServers&amp;#34;: {
    &amp;#34;grafana&amp;#34;: {
      &amp;#34;command&amp;#34;: &amp;#34;uvx&amp;#34;,
      &amp;#34;args&amp;#34;: [&amp;#34;mcp-grafana&amp;#34;],
      &amp;#34;env&amp;#34;: {
        &amp;#34;GRAFANA_URL&amp;#34;: &amp;#34;http://localhost:3000&amp;#34;,
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;: &amp;#34;&amp;lt;YOUR_SERVICE_ACCOUNT_TOKEN&amp;gt;&amp;#34;
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For Grafana Cloud, set &lt;code&gt;GRAFANA_URL&lt;/code&gt; to your instance URL, for example &lt;code&gt;https://myinstance.grafana.net&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;../install-with-docker/&#34;&gt;Install with Docker&lt;/a&gt; if you prefer to run the server in a container.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../configure/authentication/&#34;&gt;Configure authentication&lt;/a&gt; for service accounts and RBAC.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="install-with-uvx">Install with uvx&lt;/h1>
&lt;p>&lt;a href="https://docs.astral.sh/uv/" target="_blank" rel="noopener noreferrer">&lt;code>uv&lt;/code>&lt;/a> is Astral&amp;rsquo;s Python package manager and toolchain. &lt;a href="https://docs.astral.sh/uv/guides/tools/" target="_blank" rel="noopener noreferrer">&lt;code>uvx&lt;/code>&lt;/a> runs a command from a published package in an isolated environment, without installing that package globally. It is similar to &lt;code>npx&lt;/code> for Node.js.&lt;/p></description></item><item><title>Install with Docker</title><link>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/set-up/install-with-docker/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/set-up/install-with-docker/</guid><content><![CDATA[&lt;h1 id=&#34;install-with-docker&#34;&gt;Install with Docker&lt;/h1&gt;
&lt;p&gt;Run the Grafana MCP server using the official image from Docker Hub. The image &lt;strong&gt;defaults to SSE&lt;/strong&gt;, but most users will want to use STDIO mode for direct integration with AI assistants like Claude Desktop.&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 in a container and connect your MCP client. You can use stdio (typical for Claude Desktop and similar), SSE, streamable HTTP, or streamable HTTP with server TLS.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Docker &lt;a href=&#34;https://docs.docker.com/get-started/get-docker/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;installed&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;A Grafana instance (Grafana 9.0 or later) and a service account token.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;run-the-server-in-stdio-mode&#34;&gt;Run the server in STDIO mode&lt;/h2&gt;
&lt;p&gt;For direct integration with AI assistants, most users will want to use STDIO mode. Pass &lt;code&gt;-t stdio&lt;/code&gt; and &lt;code&gt;-i&lt;/code&gt; so the container keeps stdin open.&lt;/p&gt;
&lt;h3 id=&#34;local-grafana&#34;&gt;Local Grafana:&lt;/h3&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;docker pull grafana/mcp-grafana
docker run --rm -i \
  -e GRAFANA_URL=http://localhost:3000 \
  -e GRAFANA_SERVICE_ACCOUNT_TOKEN=&amp;lt;your service account token&amp;gt; \
  grafana/mcp-grafana -t stdio&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;grafana-cloud&#34;&gt;Grafana Cloud&lt;/h3&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;docker pull grafana/mcp-grafana
docker run --rm -i \
  -e GRAFANA_URL=https://myinstance.grafana.net \
  -e GRAFANA_SERVICE_ACCOUNT_TOKEN=&amp;lt;your service account token&amp;gt; \
  grafana/mcp-grafana -t stdio&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;run-the-server-in-sse-mode&#34;&gt;Run the server in SSE mode&lt;/h2&gt;
&lt;p&gt;In this mode, the server runs as an HTTP server that clients connect to. You must expose port &lt;strong&gt;8000&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;docker pull grafana/mcp-grafana
docker run --rm -p 8000:8000 \
  -e GRAFANA_URL=http://localhost:3000 \
  -e GRAFANA_SERVICE_ACCOUNT_TOKEN=&amp;lt;your service account token&amp;gt; \
  grafana/mcp-grafana&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Point your client at &lt;code&gt;http://localhost:8000/sse&lt;/code&gt; (or your host and port).&lt;/p&gt;
&lt;h2 id=&#34;run-the-server-in-streamable-http-mode&#34;&gt;Run the server in streamable HTTP mode&lt;/h2&gt;
&lt;p&gt;In this mode, the server operates as an independent process that can handle multiple client connections. You must expose port &lt;strong&gt;8000&lt;/strong&gt; and set &lt;code&gt;-t streamable-http&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;docker pull grafana/mcp-grafana
docker run --rm -p 8000:8000 \
  -e GRAFANA_URL=http://localhost:3000 \
  -e GRAFANA_SERVICE_ACCOUNT_TOKEN=&amp;lt;your service account token&amp;gt; \
  grafana/mcp-grafana -t streamable-http&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The default MCP path is &lt;code&gt;/mcp&lt;/code&gt; (see &lt;code&gt;--endpoint-path&lt;/code&gt;). Clients often use &lt;code&gt;http://localhost:8000/mcp&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;run-in-https-streamable-http-mode-with-server-tls-certificates&#34;&gt;Run in HTTPS streamable HTTP mode with server TLS certificates&lt;/h2&gt;
&lt;p&gt;To terminate TLS on the MCP server, mount certificates and set &lt;code&gt;--server.tls-cert-file&lt;/code&gt;, &lt;code&gt;--server.tls-key-file&lt;/code&gt;, and &lt;code&gt;--address&lt;/code&gt; (for example &lt;code&gt;:8443&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;docker pull grafana/mcp-grafana
docker run --rm -p 8443:8443 \
  -v /path/to/certs:/certs:ro \
  -e GRAFANA_URL=http://localhost:3000 \
  -e GRAFANA_SERVICE_ACCOUNT_TOKEN=&amp;lt;your service account token&amp;gt; \
  grafana/mcp-grafana \
  -t streamable-http \
  --address :8443 \
  --server.tls-cert-file /certs/server.crt \
  --server.tls-key-file /certs/server.key&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;../install-the-binary/&#34;&gt;Install the binary&lt;/a&gt; for a host-installed binary.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../client-configuration-examples/&#34;&gt;Client configuration examples&lt;/a&gt; for JSON snippets (including Docker).&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../configure/transports-and-addresses/&#34;&gt;Transports and addresses&lt;/a&gt; and &lt;a href=&#34;../../configure/server-tls-streamable-http/&#34;&gt;Server TLS (streamable-http)&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="install-with-docker">Install with Docker&lt;/h1>
&lt;p>Run the Grafana MCP server using the official image from Docker Hub. The image &lt;strong>defaults to SSE&lt;/strong>, but most users will want to use STDIO mode for direct integration with AI assistants like Claude Desktop.&lt;/p></description></item><item><title>Install the binary</title><link>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/set-up/install-the-binary/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/set-up/install-the-binary/</guid><content><![CDATA[&lt;h1 id=&#34;install-the-binary&#34;&gt;Install the binary&lt;/h1&gt;
&lt;p&gt;Install the Grafana MCP server by downloading a release binary or building from source. This gives you a single executable in your &lt;code&gt;$PATH&lt;/code&gt;.&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 have the &lt;code&gt;mcp-grafana&lt;/code&gt; binary available so your MCP client can run it directly (typically in stdio mode).&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;For source build: a Go toolchain (see &lt;a href=&#34;https://go.dev/doc/install&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Go install&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;download-a-release&#34;&gt;Download a release&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Open the &lt;a href=&#34;https://github.com/grafana/mcp-grafana/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;releases page&lt;/a&gt; on GitHub.&lt;/li&gt;
&lt;li&gt;Download the archive for your platform.&lt;/li&gt;
&lt;li&gt;Extract the binary and place it in a directory that is in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;build-from-source&#34;&gt;Build from source&lt;/h2&gt;
&lt;p&gt;If you have a Go toolchain installed you can also build and install it from source. Use &lt;code&gt;go install&lt;/code&gt; and set &lt;code&gt;GOBIN&lt;/code&gt; so the binary is installed where you want it (for example, a directory in your &lt;code&gt;$PATH&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;GOBIN=&amp;#34;$HOME/go/bin&amp;#34; go install github.com/grafana/mcp-grafana/cmd/mcp-grafana@latest&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Ensure &lt;code&gt;$GOBIN&lt;/code&gt; (or &lt;code&gt;$HOME/go/bin&lt;/code&gt;) is in your &lt;code&gt;$PATH&lt;/code&gt;. Then add the server to your MCP client config with &lt;code&gt;&amp;quot;command&amp;quot;: &amp;quot;mcp-grafana&amp;quot;&lt;/code&gt; (or the full path if needed).&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;../../configure/authentication/&#34;&gt;Configure authentication&lt;/a&gt; for Grafana credentials.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../deploy-with-helm/&#34;&gt;Deploy with Helm&lt;/a&gt; if you run the server on Kubernetes.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="install-the-binary">Install the binary&lt;/h1>
&lt;p>Install the Grafana MCP server by downloading a release binary or building from source. This gives you a single executable in your &lt;code>$PATH&lt;/code>.&lt;/p></description></item><item><title>Deploy with Helm</title><link>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/set-up/deploy-with-helm/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/set-up/deploy-with-helm/</guid><content><![CDATA[&lt;h1 id=&#34;deploy-with-helm&#34;&gt;Deploy with Helm&lt;/h1&gt;
&lt;p&gt;Deploy the Grafana MCP server on Kubernetes using the Helm chart from the Grafana helm-charts repository.&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 runs in your cluster and can be used by MCP clients that connect to it (for example, via SSE or streamable-http and an Ingress or LoadBalancer).&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;kubectl&lt;/code&gt; and Helm installed.&lt;/li&gt;
&lt;li&gt;A Grafana URL and API key (or service account token) for the server to use.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;install-the-chart&#34;&gt;Install the chart&lt;/h2&gt;
&lt;p&gt;Add the Grafana Helm repo and install the chart. Set &lt;code&gt;grafana.url&lt;/code&gt; and &lt;code&gt;grafana.apiKey&lt;/code&gt; (or the equivalent for your chart version) to your Grafana instance and token.&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;helm repo add grafana-community https://grafana-community.github.io/helm-charts
helm install --set grafana.apiKey=&amp;lt;Grafana_ApiKey&amp;gt; --set grafana.url=&amp;lt;GrafanaUrl&amp;gt; my-release grafana-community/grafana-mcp&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For full chart options and defaults, refer to the &lt;a href=&#34;https://github.com/grafana-community/helm-charts/tree/main/charts/grafana-mcp&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;grafana-mcp chart&lt;/a&gt; in the grafana-community helm-charts repository.&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;../../configure/authentication/&#34;&gt;Configure authentication&lt;/a&gt; for service accounts and tokens.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../configure/transports-and-addresses/&#34;&gt;Configure transports and addresses&lt;/a&gt; for SSE or streamable-http in-cluster.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="deploy-with-helm">Deploy with Helm&lt;/h1>
&lt;p>Deploy the Grafana MCP server on Kubernetes using the Helm chart from the Grafana helm-charts repository.&lt;/p>
&lt;h2 id="what-youll-achieve">What you&amp;rsquo;ll achieve&lt;/h2>
&lt;p>The server runs in your cluster and can be used by MCP clients that connect to it (for example, via SSE or streamable-http and an Ingress or LoadBalancer).&lt;/p></description></item><item><title>Client configuration examples</title><link>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/set-up/client-configuration-examples/</link><pubDate>Thu, 23 Apr 2026 10:03:11 +0200</pubDate><guid>https://grafana.com/docs/grafana/v13.0/developer-resources/mcp/set-up/client-configuration-examples/</guid><content><![CDATA[&lt;h1 id=&#34;client-configuration-examples&#34;&gt;Client configuration examples&lt;/h1&gt;
&lt;p&gt;This page walks through credentials, installation options, and MCP client JSON patterns for common editors and runtimes.&lt;/p&gt;
&lt;p&gt;The MCP server works with local Grafana and &lt;a href=&#34;/docs/grafana-cloud/&#34;&gt;Grafana Cloud&lt;/a&gt;. For Grafana Cloud, use your instance URL (for example, &lt;code&gt;https://myinstance.grafana.net&lt;/code&gt;) instead of &lt;code&gt;http://localhost:3000&lt;/code&gt; in the examples below.&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 copy working configuration blocks for uvx, the binary, Docker, VS Code remote, debug mode, and TLS.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;If you use a &lt;strong&gt;service account token&lt;/strong&gt;, create a service account in Grafana with the permissions your tools need, create a token, and copy it into your config. Refer to the &lt;a href=&#34;/docs/grafana/latest/administration/service-accounts/#add-a-token-to-a-service-account-in-grafana&#34;&gt;Grafana service account documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Tip: assigning the built-in &lt;strong&gt;Editor&lt;/strong&gt; role is a simple option when you do not want to tune every scope; it is broader than least-privilege.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&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 environment variable &lt;code&gt;GRAFANA_API_KEY&lt;/code&gt; is deprecated in favor of &lt;code&gt;GRAFANA_SERVICE_ACCOUNT_TOKEN&lt;/code&gt;. The old name still works but may log warnings.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;
&lt;p&gt;Install &lt;code&gt;mcp-grafana&lt;/code&gt; using one of the methods in &lt;a href=&#34;../../set-up/&#34;&gt;Set up&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the server block to your client configuration using one of the patterns below.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For organization targeting and custom headers, refer to &lt;a href=&#34;../../configure/multi-organization-and-headers/&#34;&gt;Multi-organization and headers&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;multi-organization-support&#34;&gt;Multi-organization support&lt;/h2&gt;
&lt;p&gt;You can specify which organization to interact with using either:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Environment variable:&lt;/strong&gt; Set &lt;code&gt;GRAFANA_ORG_ID&lt;/code&gt; to the numeric organization ID&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HTTP header:&lt;/strong&gt; Set &lt;code&gt;X-Grafana-Org-Id&lt;/code&gt; when using SSE or streamable HTTP transports (header takes precedence over environment variable - meaning you can set a default org as well).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When an organization ID is provided, the MCP server will set the &lt;code&gt;X-Grafana-Org-Id&lt;/code&gt; header on all requests to Grafana, ensuring that operations are performed within the specified organization context.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example with organization ID:&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;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;mcpServers&amp;#34;: {
    &amp;#34;grafana&amp;#34;: {
      &amp;#34;command&amp;#34;: &amp;#34;mcp-grafana&amp;#34;,
      &amp;#34;args&amp;#34;: [],
      &amp;#34;env&amp;#34;: {
        &amp;#34;GRAFANA_URL&amp;#34;: &amp;#34;http://localhost:3000&amp;#34;,
        &amp;#34;GRAFANA_USERNAME&amp;#34;: &amp;#34;&amp;lt;your username&amp;gt;&amp;#34;,
        &amp;#34;GRAFANA_PASSWORD&amp;#34;: &amp;#34;&amp;lt;your password&amp;gt;&amp;#34;,
        &amp;#34;GRAFANA_ORG_ID&amp;#34;: &amp;#34;2&amp;#34;
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;custom-http-headers&#34;&gt;Custom HTTP headers&lt;/h2&gt;
&lt;p&gt;You can add arbitrary HTTP headers to all Grafana API requests using the &lt;code&gt;GRAFANA_EXTRA_HEADERS&lt;/code&gt; environment variable. The value should be a JSON object mapping header names to values.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example with custom headers:&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;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;mcpServers&amp;#34;: {
    &amp;#34;grafana&amp;#34;: {
      &amp;#34;command&amp;#34;: &amp;#34;mcp-grafana&amp;#34;,
      &amp;#34;args&amp;#34;: [],
      &amp;#34;env&amp;#34;: {
        &amp;#34;GRAFANA_URL&amp;#34;: &amp;#34;http://localhost:3000&amp;#34;,
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;: &amp;#34;&amp;lt;your token&amp;gt;&amp;#34;,
        &amp;#34;GRAFANA_EXTRA_HEADERS&amp;#34;: &amp;#34;{\&amp;#34;X-Custom-Header\&amp;#34;: \&amp;#34;custom-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;install-options&#34;&gt;Install options&lt;/h2&gt;
&lt;p&gt;You can install &lt;code&gt;mcp-grafana&lt;/code&gt; in several ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;uvx (recommended)&lt;/strong&gt;: If you have &lt;a href=&#34;https://docs.astral.sh/uv/getting-started/installation/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;uv&lt;/a&gt; installed, no extra setup is needed — &lt;code&gt;uvx&lt;/code&gt; will automatically download and run the server:&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;uvx mcp-grafana&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Docker image&lt;/strong&gt;: Use the pre-built Docker image from Docker Hub.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: The Docker image&amp;rsquo;s entrypoint is configured to run the MCP server in SSE mode by default, but most users will want to use STDIO mode for direct integration with AI assistants like Claude Desktop:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;STDIO Mode&lt;/strong&gt;: For stdio mode you must explicitly override the default with &lt;code&gt;-t stdio&lt;/code&gt; and include the &lt;code&gt;-i&lt;/code&gt; flag to keep stdin open:&lt;/li&gt;
&lt;/ol&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;docker pull grafana/mcp-grafana
# For local Grafana:
docker run --rm -i -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=&amp;lt;your service account token&amp;gt; grafana/mcp-grafana -t stdio
# For Grafana Cloud:
docker run --rm -i -e GRAFANA_URL=https://myinstance.grafana.net -e GRAFANA_SERVICE_ACCOUNT_TOKEN=&amp;lt;your service account token&amp;gt; grafana/mcp-grafana -t stdio&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;&lt;strong&gt;SSE Mode&lt;/strong&gt;: In this mode, the server runs as an HTTP server that clients connect to. You must expose port 8000 using the &lt;code&gt;-p&lt;/code&gt; flag:&lt;/li&gt;
&lt;/ol&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;docker pull grafana/mcp-grafana
docker run --rm -p 8000:8000 -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=&amp;lt;your service account token&amp;gt; grafana/mcp-grafana&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ol start=&#34;3&#34;&gt;
&lt;li&gt;&lt;strong&gt;Streamable HTTP Mode&lt;/strong&gt;: In this mode, the server operates as an independent process that can handle multiple client connections. You must expose port 8000 using the &lt;code&gt;-p&lt;/code&gt; flag: For this mode you must explicitly override the default with &lt;code&gt;-t streamable-http&lt;/code&gt;&lt;/li&gt;
&lt;/ol&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;docker pull grafana/mcp-grafana
docker run --rm -p 8000:8000 -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=&amp;lt;your service account token&amp;gt; grafana/mcp-grafana -t streamable-http&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For HTTPS streamable HTTP mode with server TLS certificates:&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;docker pull grafana/mcp-grafana
docker run --rm -p 8443:8443 \
  -v /path/to/certs:/certs:ro \
  -e GRAFANA_URL=http://localhost:3000 \
  -e GRAFANA_SERVICE_ACCOUNT_TOKEN=&amp;lt;your service account token&amp;gt; \
  grafana/mcp-grafana \
  -t streamable-http \
  --address :8443 \
  --server.tls-cert-file /certs/server.crt \
  --server.tls-key-file /certs/server.key&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Download binary&lt;/strong&gt;: Download the latest release of &lt;code&gt;mcp-grafana&lt;/code&gt; from the &lt;a href=&#34;https://github.com/grafana/mcp-grafana/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;releases page&lt;/a&gt; and place it in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Build from source&lt;/strong&gt;: If you have a Go toolchain installed you can also build and install it from source, using the &lt;code&gt;GOBIN&lt;/code&gt; environment variable
to specify the directory where the binary should be installed. This should also be in your &lt;code&gt;$PATH&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;GOBIN=&amp;#34;$HOME/go/bin&amp;#34; go install github.com/grafana/mcp-grafana/cmd/mcp-grafana@latest&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Deploy to Kubernetes using Helm&lt;/strong&gt;: use the &lt;a href=&#34;https://github.com/grafana-community/helm-charts/tree/main/charts/grafana-mcp&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Helm chart from the grafana-community helm-charts repository&lt;/a&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;helm repo add grafana-community https://grafana-community.github.io/helm-charts
helm install --set grafana.apiKey=&amp;lt;Grafana_ApiKey&amp;gt; --set grafana.url=&amp;lt;GrafanaUrl&amp;gt; my-release grafana-community/grafana-mcp&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;add-the-server-to-your-client&#34;&gt;Add the server to your client&lt;/h2&gt;
&lt;p&gt;Add the server configuration to your client configuration file. For example, for Claude Desktop:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If using &lt;code&gt;uvx&lt;/code&gt;:&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;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;mcpServers&amp;#34;: {
    &amp;#34;grafana&amp;#34;: {
      &amp;#34;command&amp;#34;: &amp;#34;uvx&amp;#34;,
      &amp;#34;args&amp;#34;: [&amp;#34;mcp-grafana&amp;#34;],
      &amp;#34;env&amp;#34;: {
        &amp;#34;GRAFANA_URL&amp;#34;: &amp;#34;http://localhost:3000&amp;#34;,
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;: &amp;#34;&amp;lt;your service account token&amp;gt;&amp;#34;
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;If using the binary:&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;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;mcpServers&amp;#34;: {
    &amp;#34;grafana&amp;#34;: {
      &amp;#34;command&amp;#34;: &amp;#34;mcp-grafana&amp;#34;,
      &amp;#34;args&amp;#34;: [],
      &amp;#34;env&amp;#34;: {
        &amp;#34;GRAFANA_URL&amp;#34;: &amp;#34;http://localhost:3000&amp;#34;,  // Or &amp;#34;https://myinstance.grafana.net&amp;#34; for Grafana Cloud
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;: &amp;#34;&amp;lt;your service account token&amp;gt;&amp;#34;,
        // If using username/password authentication
        &amp;#34;GRAFANA_USERNAME&amp;#34;: &amp;#34;&amp;lt;your username&amp;gt;&amp;#34;,
        &amp;#34;GRAFANA_PASSWORD&amp;#34;: &amp;#34;&amp;lt;your password&amp;gt;&amp;#34;,
        // Optional: specify organization ID for multi-org support
        &amp;#34;GRAFANA_ORG_ID&amp;#34;: &amp;#34;1&amp;#34;
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&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;If you see &lt;code&gt;Error: spawn mcp-grafana ENOENT&lt;/code&gt; in Claude Desktop, specify the full path to &lt;code&gt;mcp-grafana&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;If using Docker:&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;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;mcpServers&amp;#34;: {
    &amp;#34;grafana&amp;#34;: {
      &amp;#34;command&amp;#34;: &amp;#34;docker&amp;#34;,
      &amp;#34;args&amp;#34;: [
        &amp;#34;run&amp;#34;,
        &amp;#34;--rm&amp;#34;,
        &amp;#34;-i&amp;#34;,
        &amp;#34;-e&amp;#34;,
        &amp;#34;GRAFANA_URL&amp;#34;,
        &amp;#34;-e&amp;#34;,
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;,
        &amp;#34;grafana/mcp-grafana&amp;#34;,
        &amp;#34;-t&amp;#34;,
        &amp;#34;stdio&amp;#34;
      ],
      &amp;#34;env&amp;#34;: {
        &amp;#34;GRAFANA_URL&amp;#34;: &amp;#34;http://localhost:3000&amp;#34;,  // Or &amp;#34;https://myinstance.grafana.net&amp;#34; for Grafana Cloud
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;: &amp;#34;&amp;lt;your service account token&amp;gt;&amp;#34;,
        // If using username/password authentication
        &amp;#34;GRAFANA_USERNAME&amp;#34;: &amp;#34;&amp;lt;your username&amp;gt;&amp;#34;,
        &amp;#34;GRAFANA_PASSWORD&amp;#34;: &amp;#34;&amp;lt;your password&amp;gt;&amp;#34;,
        // Optional: specify organization ID for multi-org support
        &amp;#34;GRAFANA_ORG_ID&amp;#34;: &amp;#34;1&amp;#34;
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&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 &lt;code&gt;-t stdio&lt;/code&gt; argument is essential here because it overrides the default SSE mode in the Docker image.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Using VSCode with remote MCP server&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re using VSCode and running the MCP server in SSE mode (which is the default when using the Docker image without overriding the transport), make sure your &lt;code&gt;.vscode/settings.json&lt;/code&gt; includes the following:&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;mcp&amp;#34;: {
  &amp;#34;servers&amp;#34;: {
    &amp;#34;grafana&amp;#34;: {
      &amp;#34;type&amp;#34;: &amp;#34;sse&amp;#34;,
      &amp;#34;url&amp;#34;: &amp;#34;http://localhost:8000/sse&amp;#34;
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you terminate TLS in front of an &lt;strong&gt;SSE&lt;/strong&gt; server (or the listener still speaks SSE on &lt;code&gt;/sse&lt;/code&gt;), your client URL might look like &lt;code&gt;https://localhost:8443/sse&lt;/code&gt; with &lt;code&gt;type: &amp;quot;sse&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you run &lt;strong&gt;streamable-http&lt;/strong&gt; with server TLS (for example the Docker example using &lt;code&gt;-t streamable-http&lt;/code&gt;, &lt;code&gt;--address :8443&lt;/code&gt;, and &lt;code&gt;--server.tls-*&lt;/code&gt;), the MCP HTTP endpoint is &lt;code&gt;--endpoint-path&lt;/code&gt; (default &lt;code&gt;/mcp&lt;/code&gt;), for example &lt;code&gt;https://localhost:8443/mcp&lt;/code&gt;. That is &lt;strong&gt;not&lt;/strong&gt; the same as &lt;code&gt;/sse&lt;/code&gt;; use the client and &lt;code&gt;type&lt;/code&gt; your editor documents for streamable HTTP, not the SSE snippet above.&lt;/p&gt;
&lt;h2 id=&#34;debug-mode&#34;&gt;Debug mode&lt;/h2&gt;
&lt;p&gt;You can enable debug mode for the Grafana transport by adding the &lt;code&gt;-debug&lt;/code&gt; flag to the command. This will provide detailed logging of HTTP requests and responses between the MCP server and the Grafana API, which can be helpful for troubleshooting.&lt;/p&gt;
&lt;p&gt;To use debug mode with the Claude Desktop configuration, update your config as follows:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If using the binary:&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;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;mcpServers&amp;#34;: {
    &amp;#34;grafana&amp;#34;: {
      &amp;#34;command&amp;#34;: &amp;#34;mcp-grafana&amp;#34;,
      &amp;#34;args&amp;#34;: [&amp;#34;-debug&amp;#34;],
      &amp;#34;env&amp;#34;: {
        &amp;#34;GRAFANA_URL&amp;#34;: &amp;#34;http://localhost:3000&amp;#34;,  // Or &amp;#34;https://myinstance.grafana.net&amp;#34; for Grafana Cloud
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;: &amp;#34;&amp;lt;your service account token&amp;gt;&amp;#34;
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;If using Docker:&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;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;mcpServers&amp;#34;: {
    &amp;#34;grafana&amp;#34;: {
      &amp;#34;command&amp;#34;: &amp;#34;docker&amp;#34;,
      &amp;#34;args&amp;#34;: [
        &amp;#34;run&amp;#34;,
        &amp;#34;--rm&amp;#34;,
        &amp;#34;-i&amp;#34;,
        &amp;#34;-e&amp;#34;,
        &amp;#34;GRAFANA_URL&amp;#34;,
        &amp;#34;-e&amp;#34;,
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;,
        &amp;#34;grafana/mcp-grafana&amp;#34;,
        &amp;#34;-t&amp;#34;,
        &amp;#34;stdio&amp;#34;,
        &amp;#34;-debug&amp;#34;
      ],
      &amp;#34;env&amp;#34;: {
        &amp;#34;GRAFANA_URL&amp;#34;: &amp;#34;http://localhost:3000&amp;#34;,  // Or &amp;#34;https://myinstance.grafana.net&amp;#34; for Grafana Cloud
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;: &amp;#34;&amp;lt;your service account token&amp;gt;&amp;#34;
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&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;As with the standard configuration, the &lt;code&gt;-t stdio&lt;/code&gt; argument is required to override the default SSE mode in the Docker image.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;tls-configuration-client-to-grafana&#34;&gt;TLS configuration (client to Grafana)&lt;/h2&gt;
&lt;p&gt;If your Grafana instance is behind mTLS or requires custom TLS certificates, configure the MCP server to use the correct certificates when calling Grafana:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--tls-cert-file&lt;/code&gt;: Path to TLS certificate file for client authentication&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--tls-key-file&lt;/code&gt;: Path to TLS private key file for client authentication&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--tls-ca-file&lt;/code&gt;: Path to TLS CA certificate file for server verification&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--tls-skip-verify&lt;/code&gt;: Skip TLS certificate verification (insecure; use only for testing)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Example with client certificate authentication:&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;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;mcpServers&amp;#34;: {
    &amp;#34;grafana&amp;#34;: {
      &amp;#34;command&amp;#34;: &amp;#34;mcp-grafana&amp;#34;,
      &amp;#34;args&amp;#34;: [
        &amp;#34;--tls-cert-file&amp;#34;,
        &amp;#34;/path/to/client.crt&amp;#34;,
        &amp;#34;--tls-key-file&amp;#34;,
        &amp;#34;/path/to/client.key&amp;#34;,
        &amp;#34;--tls-ca-file&amp;#34;,
        &amp;#34;/path/to/ca.crt&amp;#34;
      ],
      &amp;#34;env&amp;#34;: {
        &amp;#34;GRAFANA_URL&amp;#34;: &amp;#34;https://secure-grafana.example.com&amp;#34;,
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;: &amp;#34;&amp;lt;your service account token&amp;gt;&amp;#34;
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Example with Docker:&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;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;mcpServers&amp;#34;: {
    &amp;#34;grafana&amp;#34;: {
      &amp;#34;command&amp;#34;: &amp;#34;docker&amp;#34;,
      &amp;#34;args&amp;#34;: [
        &amp;#34;run&amp;#34;,
        &amp;#34;--rm&amp;#34;,
        &amp;#34;-i&amp;#34;,
        &amp;#34;-v&amp;#34;,
        &amp;#34;/path/to/certs:/certs:ro&amp;#34;,
        &amp;#34;-e&amp;#34;,
        &amp;#34;GRAFANA_URL&amp;#34;,
        &amp;#34;-e&amp;#34;,
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;,
        &amp;#34;grafana/mcp-grafana&amp;#34;,
        &amp;#34;-t&amp;#34;,
        &amp;#34;stdio&amp;#34;,
        &amp;#34;--tls-cert-file&amp;#34;,
        &amp;#34;/certs/client.crt&amp;#34;,
        &amp;#34;--tls-key-file&amp;#34;,
        &amp;#34;/certs/client.key&amp;#34;,
        &amp;#34;--tls-ca-file&amp;#34;,
        &amp;#34;/certs/ca.crt&amp;#34;
      ],
      &amp;#34;env&amp;#34;: {
        &amp;#34;GRAFANA_URL&amp;#34;: &amp;#34;https://secure-grafana.example.com&amp;#34;,
        &amp;#34;GRAFANA_SERVICE_ACCOUNT_TOKEN&amp;#34;: &amp;#34;&amp;lt;your service account token&amp;gt;&amp;#34;
      }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The TLS configuration is applied to all HTTP clients used by the MCP server, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The main Grafana OpenAPI client&lt;/li&gt;
&lt;li&gt;Prometheus datasource clients&lt;/li&gt;
&lt;li&gt;Loki datasource clients&lt;/li&gt;
&lt;li&gt;Incident management clients&lt;/li&gt;
&lt;li&gt;Sift investigation clients&lt;/li&gt;
&lt;li&gt;Alerting clients&lt;/li&gt;
&lt;li&gt;Asserts clients&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Direct CLI usage examples:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For testing with self-signed certificates:&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-skip-verify -debug&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With client certificate authentication:&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 \
  -debug&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With custom CA certificate only:&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-ca-file /path/to/ca.crt&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Programmatic usage (Go):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re using this library programmatically, you can also create TLS-enabled context functions:&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;Go&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-go&#34;&gt;// Using struct literals
tlsConfig := &amp;amp;mcpgrafana.TLSConfig{
    CertFile: &amp;#34;/path/to/client.crt&amp;#34;,
    KeyFile:  &amp;#34;/path/to/client.key&amp;#34;,
    CAFile:   &amp;#34;/path/to/ca.crt&amp;#34;,
}
grafanaConfig := mcpgrafana.GrafanaConfig{
    Debug:     true,
    TLSConfig: tlsConfig,
}
contextFunc := mcpgrafana.ComposedStdioContextFunc(grafanaConfig)

// Or inline
grafanaConfig := mcpgrafana.GrafanaConfig{
    Debug: true,
    TLSConfig: &amp;amp;mcpgrafana.TLSConfig{
        CertFile: &amp;#34;/path/to/client.crt&amp;#34;,
        KeyFile:  &amp;#34;/path/to/client.key&amp;#34;,
        CAFile:   &amp;#34;/path/to/ca.crt&amp;#34;,
    },
}
contextFunc := mcpgrafana.ComposedStdioContextFunc(grafanaConfig)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For a shorter overview, refer to &lt;a href=&#34;../../configure/client-tls-grafana-connection/&#34;&gt;Client TLS (Grafana connection)&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;server-tls-configuration-streamable-http-transport-only&#34;&gt;Server TLS configuration (Streamable HTTP transport only)&lt;/h2&gt;
&lt;p&gt;When using the streamable HTTP transport (&lt;code&gt;-t streamable-http&lt;/code&gt;), you can configure the MCP server to serve HTTPS instead of HTTP. This is useful when you need to secure the connection between your MCP client and the server itself.&lt;/p&gt;
&lt;p&gt;The server supports the following TLS configuration options for the streamable HTTP transport:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--server.tls-cert-file&lt;/code&gt;: Path to TLS certificate file for server HTTPS (required for TLS)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--server.tls-key-file&lt;/code&gt;: Path to TLS private key file for server HTTPS (required for TLS)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: These flags are completely separate from the client TLS flags documented above. The client TLS flags configure how the MCP server connects to Grafana, while these server TLS flags configure how clients connect to the MCP server when using streamable HTTP transport.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;
Example with HTTPS streamable HTTP server&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;This would start the MCP server on HTTPS port 8443. Clients would then connect to &lt;code&gt;https://localhost:8443/mcp&lt;/code&gt; instead of &lt;code&gt;http://localhost:8000/mcp&lt;/code&gt; (the default &lt;code&gt;--endpoint-path&lt;/code&gt; is &lt;code&gt;/mcp&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Docker example:&lt;/strong&gt;
Docker example with server TLS:&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;docker run --rm -p 8443:8443 \
  -v /path/to/certs:/certs:ro \
  -e GRAFANA_URL=http://localhost:3000 \
  -e GRAFANA_SERVICE_ACCOUNT_TOKEN=&amp;lt;your service account token&amp;gt; \
  grafana/mcp-grafana \
  -t streamable-http \
  --address :8443 \
  --server.tls-cert-file /certs/server.crt \
  --server.tls-key-file /certs/server.key&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../../configure/server-tls-streamable-http/&#34;&gt;Server TLS (streamable-http)&lt;/a&gt; for more detail.&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;../../configure/health-check-endpoint/&#34;&gt;Health check endpoint&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../developer/observability-metrics-and-tracing/&#34;&gt;Observability (metrics and tracing)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../troubleshooting/&#34;&gt;Troubleshooting&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="client-configuration-examples">Client configuration examples&lt;/h1>
&lt;p>This page walks through credentials, installation options, and MCP client JSON patterns for common editors and runtimes.&lt;/p>
&lt;p>The MCP server works with local Grafana and &lt;a href="/docs/grafana-cloud/">Grafana Cloud&lt;/a>. For Grafana Cloud, use your instance URL (for example, &lt;code>https://myinstance.grafana.net&lt;/code>) instead of &lt;code>http://localhost:3000&lt;/code> in the examples below.&lt;/p></description></item></channel></rss>