grafana -analyzer
让AI助手直接分析你的Grafana监控数据 - A Model Context Protocol server for Grafana data analysis
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
- Install the MCP analyzer globally using npm:
npm install -g grafana-mcp-analyzer
- Verify installation:
grafana-mcp-analyzer --version
-
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.
-
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
mcp-telegram
MCP Server for Telegram
agentql
Model Context Protocol server that integrates AgentQL's data extraction capabilities.
openapi
OpenAPI definitions, converters and LLM function calling schema composer.
last9
Last9 MCP Server
unity-api
Instant, accurate Unity API lookups instead of expensive source file reads, saving your agent tokens, context, and hallucinations
the-academy
A Socratic dialogue engine for AI agents.