Overview
What is Grafana MCP?
Grafana MCP is a Model Context Protocol (MCP) server that provides tools to interact with Grafana dashboards, data sources, alerts, and more. It is intended for users who want to connect AI assistants like Claude Code to a Grafana instance via the MCP standard.
How to use Grafana MCP?
Install the package from GitHub with pip install -e git+https://github.com/izaitsevfb/grafana-mcp.git#egg=grafana_mcp, then create a .env file with GRAFANA_URL and GRAFANA_API_TOKEN. Run the server with python -m grafana_mcp and add it to Claude Code using claude mcp add-json grafana with a stdio transport configuration.
Key features of Grafana MCP
- Dashboard management tools (list, get by UID, get info)
- Data source listing tool
- Organization information tool
- Token-based authentication with Grafana API
- Dashboard template resource bundled with the package
- Python-based, installable via pip from GitHub
Use cases of Grafana MCP
- Retrieve and inspect dashboards from a Grafana instance via an AI assistant
- List available data sources for monitoring context
- Query Grafana connection status and version information
- Automate Grafana-related tasks within a Claude Code workflow
- Explore organization-level metadata without the Grafana web UI
FAQ from Grafana MCP
What tools does Grafana MCP provide?
It provides get_grafana_info(), list_dashboards(), get_dashboard(uid), get_organization(), and list_datasources().
How do I authenticate with Grafana?
Create a .env file with GRAFANA_URL and GRAFANA_API_TOKEN, where the API token is generated in Grafana under Configuration → API Keys.
What are the runtime dependencies?
The package requires Python, grafana-client, python-dotenv, and mcp (Model Context Protocol server implementation).
Do I need a running Grafana instance to get started?
The test suite includes mocked tests that do not require an actual Grafana instance, but the server itself needs a valid Grafana URL and API token to function.
How do I add Grafana MCP to Claude Code?
Use the command claude mcp add-json grafana '{ "type": "stdio", "command": "python", "args": [ "-m", "grafana_mcp" ], "env": {} }'. Add --scope user for global availability.