Grafana MCP Server
Official Grafana MCP server connecting AI assistants with dashboards, Prometheus metrics, Loki logs, SQL datasources, and alerts.
About this Server
Official Grafana MCP Server (`grafana` / `mcp-grafana`) connects AI agents directly to Grafana Cloud and on-premises instances. It equips assistants with tools to search, inspect, and patch dashboards, execute PromQL, LogQL, and TraceQL queries, query SQL datasources (ClickHouse, Snowflake, Athena, Postgres), inspect alerts and on-call rotations, and render panel images for reports.
Direct low-latency RPC protocol communication with structured JSON schemas.
Restricted capability bounds to prevent accidental modifications or leakage.
Security & Best Practices
When to Use (and When Not To)
- •Analyzing production metrics, query performance, and error logs directly from AI development assistants
- •Inspecting and modifying Grafana dashboards with token-efficient JSONPath property tools
- •Querying diverse SQL data warehouses (ClickHouse, Snowflake, Athena) through existing Grafana connections
- •App Store and Google Play customer review sentiment analytics (use App Store Review Intelligence MCP instead)
- •SEO rank tracking and Google Search Console performance data (use AltoRank MCP instead)
- •Raw terminal AWS CLI shell pipelines (use AWS Cloud MCP Server instead)
Install & Setup
claude mcp add grafana -- uvx mcp-grafanaExposed Tools & Endpoints
8 toolsFunctions your AI agent can invoke via this Model Context Protocol server
Finds dashboards by title keyword, folder UID, tag, or starred status.
Retrieves a compact summary of a dashboard (panel count, types, variables, metadata) to minimize context window usage.
Executes PromQL queries (instant vectors or range series) and histogram percentiles against Prometheus datasources.
Queries logs and stream statistics using LogQL with stream selectors and pattern detection.
Executes SQL queries with macro substitution ($__timeFilter) across ClickHouse, Snowflake, Athena, Postgres, and MySQL.
Lists all configured datasources (Prometheus, Loki, ClickHouse, CloudWatch, OpenSearch) and tests connectivity health.
Lists and inspects Grafana-managed and datasource-managed alert rules, evaluate states, and execution histories.
Renders a stored dashboard panel or ad-hoc Explore view into a PNG image for inclusion in automated reports.