Skip to content
MCP server

Grafana MCP

Read-only project-level Grafana MCP: Loki logs, metrics, traces, alerts, test/prod…

Runs locallyStatus and history
Install
Pricing
Open source
Runs
Locally
Version
0.1.3
Listing updated
5 days ago

About Grafana MCP

Grafana MCP is an open-source MCP server. It runs locally on your machine and is started by your AI client.

Read-only project-level Grafana MCP: Loki logs, metrics, traces, alerts, test/prod switching

Install

Run in a terminal

claude mcp add grafana-mcp --env GRAFANA_TEST_PASSWORD='<GRAFANA_TEST_PASSWORD>' --env GRAFANA_PROD_PASSWORD='<GRAFANA_PROD_PASSWORD>' -- npx -y grafana-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "grafana-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "grafana-mcp"
      ],
      "env": {
        "GRAFANA_TEST_PASSWORD": "<GRAFANA_TEST_PASSWORD>",
        "GRAFANA_PROD_PASSWORD": "<GRAFANA_PROD_PASSWORD>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "grafana-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "grafana-mcp"
      ],
      "env": {
        "GRAFANA_TEST_PASSWORD": "<GRAFANA_TEST_PASSWORD>",
        "GRAFANA_PROD_PASSWORD": "<GRAFANA_PROD_PASSWORD>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "grafana-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "grafana-mcp"
      ],
      "env": {
        "GRAFANA_TEST_PASSWORD": "<GRAFANA_TEST_PASSWORD>",
        "GRAFANA_PROD_PASSWORD": "<GRAFANA_PROD_PASSWORD>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "grafana-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "grafana-mcp"
      ],
      "env": {
        "GRAFANA_TEST_PASSWORD": "<GRAFANA_TEST_PASSWORD>",
        "GRAFANA_PROD_PASSWORD": "<GRAFANA_PROD_PASSWORD>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "grafana-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "grafana-mcp"
      ],
      "env": {
        "GRAFANA_TEST_PASSWORD": "<GRAFANA_TEST_PASSWORD>",
        "GRAFANA_PROD_PASSWORD": "<GRAFANA_PROD_PASSWORD>"
      }
    }
  }
}

Configuration

  • GRAFANA_TEST_URLGrafana base URL of the test environment, e.g. https://grafana.example.com
  • GRAFANA_TEST_USERGrafana username for the test environment (prefer a dedicated Viewer-role account)
  • GRAFANA_TEST_PASSWORDGrafana password for the test environment
  • GRAFANA_PROD_URLGrafana base URL of the production environment
  • GRAFANA_PROD_USERGrafana username for the production environment
  • GRAFANA_PROD_PASSWORDGrafana password for the production environment
  • GRAFANA_ENVDefault environment for this project (test by default)
  • GRAFANA_APPApp label value used to scope Loki queries for this project

Pricing

Open source

Grafana MCP FAQ

Is Grafana MCP free?

Yes. Grafana MCP is open source, so you can use and self-host it for free.

How do I add Grafana MCP to Claude Code?

Run this command in your terminal: claude mcp add grafana-mcp --env GRAFANA_TEST_PASSWORD='<GRAFANA_TEST_PASSWORD>' --env GRAFANA_PROD_PASSWORD='<GRAFANA_PROD_PASSWORD>' -- npx -y grafana-mcp