This is documentation for the next version of Grafana documentation. For the latest stable release, go to the latest version.

Enterprise Open source

Install with uvx

uv is Astral’s Python package manager and toolchain. uvx runs a command from a published package in an isolated environment, without installing that package globally. It is similar to npx for Node.js.

Use uvx to run the Grafana MCP server without installing a release binary yourself.

What you’ll achieve

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.

Before you begin

  • Install uv and ensure uvx is in your $PATH.
  • Have a Grafana instance (Grafana 9.0 or later) and a service account token.

Add the server to your MCP client

Add the following to your MCP client configuration file. Replace http://localhost:3000 with your Grafana URL if it is different, and YOUR_SERVICE_ACCOUNT_TOKEN with your service account token.

JSON
{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": ["mcp-grafana"],
      "env": {
        "GRAFANA_URL": "http://localhost:3000",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<YOUR_SERVICE_ACCOUNT_TOKEN>"
      }
    }
  }
}

For Grafana Cloud, set GRAFANA_URL to your instance URL, for example https://myinstance.grafana.net.

Next steps