Grafana
This MCP server enables natural-language querying of Grafana logs by automatically detecting log sources and service labels. It provides read-only access to log data with intelligent caching for efficient repeat queries.
What is Grafana?
Grafana is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to this mcp server enables natural-language querying of grafana logs by automatically detecting log sources and service labels. it provides read-only access to log data with intelligent caching for effic...
This MCP server enables natural-language querying of Grafana logs by automatically detecting log sources and service labels. It provides read-only access to log data with intelligent caching for efficient repeat queries.
This server falls under the Monitoring & Observability category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- This MCP server enables natural-language querying of Grafana
Use Cases
Maintainer
Works with
Installation
NPM
npx -y grafanaManual Installation
npx -y grafanaConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Grafana
mcp-grafana is the official Grafana MCP server that gives AI assistants natural-language access to your Grafana instance, including dashboards, data sources, alerts, incidents, and on-call schedules. It can query Prometheus, Loki, InfluxDB, CloudWatch, Elasticsearch, ClickHouse, Snowflake, and more through Grafana's unified data source layer, and supports dashboard modification, annotation management, image rendering, and Sift-powered investigation workflows. Platform engineers and SREs can use it to diagnose incidents, explore metrics, and manage alert rules through conversational AI without leaving their chat client.
Prerequisites
- Grafana 9.0 or later (self-hosted or Grafana Cloud)
- A Grafana service account token with appropriate permissions (Editor role for broad access)
- uv installed for the recommended uvx install method, or Docker/Go for alternatives
- An MCP-compatible client such as Claude Desktop or Claude Code
Create a Grafana service account token
In your Grafana instance, go to Administration > Service Accounts, create a service account with at least Viewer role (Editor for write operations), and generate a token. Copy the token — you will need it in your MCP configuration.
Install uv (if not already installed)
The recommended installation method uses uvx to run the server without a manual install step. Install uv using the official installer.
curl -LsSf https://astral.sh/uv/install.sh | shTest the server from the command line
Verify the server starts correctly by running it once with your credentials. Use Ctrl+C to stop it after confirming it connects.
GRAFANA_URL=http://localhost:3000 \
GRAFANA_SERVICE_ACCOUNT_TOKEN=your_token_here \
uvx mcp-grafanaConfigure your MCP client
Add the Grafana MCP server to your Claude Desktop or Claude Code configuration with the required environment variables.
Restart your MCP client and verify
Restart Claude Desktop to pick up the configuration. Ask Claude to list your Grafana dashboards to confirm the connection is working.
Grafana Examples
Client configuration
Add this to your Claude Desktop claude_desktop_config.json. Replace the URL and token with your actual Grafana instance details.
{
"mcpServers": {
"grafana": {
"command": "uvx",
"args": ["mcp-grafana"],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "your_service_account_token"
}
}
}
}Prompts to try
Use these prompts with Claude to explore and manage your Grafana instance.
- "List all dashboards in my Grafana instance"
- "Show me Loki logs for the payments service in the last 30 minutes"
- "What Prometheus alerts are currently firing?"
- "Query the p95 latency for the API service from Prometheus over the last hour"
- "Find error patterns in the logs from the authentication service today"Troubleshooting Grafana
Authentication error: 401 Unauthorized
Verify GRAFANA_SERVICE_ACCOUNT_TOKEN is correct and the token has not expired. Service account tokens in Grafana can have expiration dates. Alternatively use GRAFANA_USERNAME and GRAFANA_PASSWORD for basic auth, though service account tokens are preferred.
Data source queries return 'permission denied' errors
The service account role must match the operations you want to perform. A Viewer role can only read data. For alert management, dashboard editing, or incident creation, use an Editor or Admin role. You can also use granular RBAC scopes for least-privilege access.
uvx mcp-grafana not found or fails to start
Ensure uv is installed and on PATH: which uvx. If missing, install with curl -LsSf https://astral.sh/uv/install.sh | sh. As an alternative, use the Docker image: docker run -e GRAFANA_URL=... -e GRAFANA_SERVICE_ACCOUNT_TOKEN=... grafana/mcp-grafana -t stdio.
Frequently Asked Questions about Grafana
What is Grafana?
Grafana is a Model Context Protocol (MCP) server that this mcp server enables natural-language querying of grafana logs by automatically detecting log sources and service labels. it provides read-only access to log data with intelligent caching for efficient repeat queries. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Grafana?
Install via npm with the command: npx -y grafana. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with Grafana?
Grafana works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Grafana free to use?
Yes, Grafana is open source and available under the Apache 2.0 license. You can use it freely in both personal and commercial projects.
Grafana Alternatives — Similar Monitoring & Observability Servers
Looking for alternatives to Grafana? Here are other popular monitoring & observability servers you can use with Claude, Cursor, and VS Code.
Netdata
★ 78.9kReal-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Kubeshark
★ 11.9keBPF-powered network observability for Kubernetes. Indexes L4/L7 traffic with full K8s context, decrypts TLS without keys. Queryable by AI agents via MCP and humans via dashboard.
Mission Control
★ 4.9kSelf-hosted AI agent orchestration platform: dispatch tasks, run multi-agent workflows, monitor spend, and govern operations from one mission control dashboard.
Sentrux
★ 2.4kReal-time architectural sensor that helps AI agents close the feedback loop, enabling recursive self-improvement of code quality. Pure Rust.
OpenInference
★ 986OpenTelemetry Instrumentation for AI Observability
Thinkwatch
★ 967Enterprise AI bastion host for secure AI API and MCP access, with unified proxying, RBAC, audit logs, rate limiting, and cost tracking across OpenAI, Anthropic, Gemini, and self-hosted LLMs.
Browse More Monitoring & Observability MCP Servers
Explore all monitoring & observability servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Grafana in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Grafana?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.