Grafana MCP Server

DevOpsstdiossev0.4.2
Repository

MCP server for Grafana's observability platform. Enables AI agents to query metrics from Prometheus, search and analyze logs from Loki, query traces, list and manage dashboards, and investigate incidents. Useful for debugging production issues, building monitoring dashboards, and performing root cause analysis with AI assistance across the full Grafana LGTM stack.

Connect

Add this configuration to .claude/mcp.json

Transport:
{
  "mcpServers": {
    "grafana": {
      "command": "go",
      "args": [
        "run",
        "github.com/grafana/mcp-grafana@latest"
      ],
      "env": {
        "GRAFANA_URL": "<YOUR_GRAFANA_URL>",
        "GRAFANA_API_KEY": "<YOUR_GRAFANA_API_KEY>"
      }
    }
  }
}

Tools (4)

query_prometheus

Execute a PromQL query against Prometheus datasource.

{
  "type": "object",
  "required": [
    "expr"
  ],
  "properties": {
    "end": {
      "type": "string",
      "description": "End time (ISO 8601 or 'now')"
    },
    "expr": {
      "type": "string",
      "description": "PromQL expression to evaluate"
    },
    "step": {
      "type": "string",
      "description": "Query resolution step (e.g., '15s', '1m')"
    },
    "start": {
      "type": "string",
      "description": "Start time (ISO 8601 or relative like 'now-1h')"
    }
  }
}

query_loki

Execute a LogQL query against Loki datasource.

{
  "type": "object",
  "required": [
    "expr"
  ],
  "properties": {
    "end": {
      "type": "string",
      "description": "End time for the query range"
    },
    "expr": {
      "type": "string",
      "description": "LogQL expression to query logs"
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of log lines to return"
    },
    "start": {
      "type": "string",
      "description": "Start time for the query range"
    }
  }
}

list_dashboards

List all Grafana dashboards with optional search filter.

{
  "type": "object",
  "properties": {
    "tag": {
      "type": "string",
      "description": "Filter by dashboard tag"
    },
    "query": {
      "type": "string",
      "description": "Search query to filter dashboards"
    }
  }
}

list_alerts

List active and pending alert rules.

{
  "type": "object",
  "properties": {
    "state": {
      "enum": [
        "firing",
        "pending",
        "inactive"
      ],
      "type": "string",
      "description": "Filter alerts by state"
    }
  }
}

Resources

This server does not expose any resources.

Prompts

This server does not expose any prompts.

Server Information

Author
Grafana Labs (@grafana)
Repository
https://github.com/grafana/mcp-grafana
License
Apache-2.0
Version
0.4.2
Stars
2,100
Last Updated
May 26, 2026