Get the FREE Ultimate OpenClaw Setup Guide →

grafana -analyzer

让AI助手直接分析你的Grafana监控数据 - A Model Context Protocol server for Grafana data analysis

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio sailingcoder-grafana-mcp-analyzer grafana-mcp-analyzer \
  --env CONFIG_PATH="https://raw.githubusercontent.com/SailingCoder/grafana-mcp-analyzer/main/config/grafana-config-play.js" \
  --env MAX_CHUNK_SIZE="100"

How to use

Grafana MCP Analyzer is a modular AI-assisted analysis tool that reads Grafana monitoring data and provides natural-language explanations, multi-turn dialogue capabilities, and actionable DevOps recommendations. It integrates with MCP (Model Context Protocol) to allow AI assistants like Claude or ChatGPT to query data sources such as Prometheus, MySQL, and Elasticsearch through Grafana, and then return structured insights, highlights, and optimization suggestions. With a configured MCP server, you can prompt the AI to interpret dashboards, perform health checks, and propose concrete remediation steps. The included example configuration demonstrates how to point the MCP server to a Grafana-related configuration file so the AI can access your data sources and health endpoints, enabling quick, hands-free operational analysis.

How to install

Prerequisites:

  • Node.js 18+ installed on your system
  • npm available
  1. Install the MCP analyzer globally using npm:
npm install -g grafana-mcp-analyzer
  1. Verify installation:
grafana-mcp-analyzer --version
  1. Prepare MCP configuration: create or edit your MCP config to point to the Grafana analyzer configuration (see example in README). You can store the config file anywhere accessible and reference it via CONFIG_PATH in the environment for the MCP server.

  2. Run the MCP server with your configuration (see mcp_config below for the expected structure).

Note: If you are behind a proxy or corporate firewall, ensure network access to Grafana and any remote data sources configured in your grafana-config-play.js.

Additional notes

Tips:

  • CONFIG_PATH supports absolute paths or remote URLs; using a remote URL is recommended for quick experiments.
  • MAX_CHUNK_SIZE controls how much data is fetched and processed in a single query; adjust based on data size and latency.
  • Ensure your Grafana endpoint is reachable from the environment running the MCP server and that any required authentication is configured in the Grafana config file.
  • When troubleshooting, start with a minimal grafana-config-play.js that accesses a small dataset or sample dashboard to verify end-to-end MCP interactions.
  • Regularly refresh CONFIG_PATH to pick up updated queries and health checks as your data sources evolve.

Related MCP Servers

Sponsor this space

Reach thousands of developers