Grafana

vv0.14.0Monitoring & Observabilitystable

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.

grafanamcpai-integration
Share:
3,034
Stars
0
Downloads
0
Weekly
0/5

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

Query Grafana logs with natural language.
Intelligently cache and analyze log data for efficient access.
grafana

Maintainer

LicenseApache 2.0
Languagego
Versionvv0.14.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y grafana

Manual Installation

npx -y grafana

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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.

2

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 | sh
3

Test 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-grafana
4

Configure your MCP client

Add the Grafana MCP server to your Claude Desktop or Claude Code configuration with the required environment variables.

5

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.

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.

Quick Config Preview

{ "mcpServers": { "grafana": { "command": "npx", "args": ["-y", "grafana"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides