Grafana MCP server for dashboard and folder management

Grafana MCP server for dashboard and folder management

grafana-mcp-christian-schlichtherle•bychristian-schlichtherle

An MCP server that lets clients discover, edit, and test Grafana dashboards and folders across one or more Grafana clusters, with a label- and folder-based security model.

License: Not specified•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides tools to search, read, inspect, create, update, delete, and copy Grafana dashboards.
  • •Supports listing, creating, updating, moving, and deleting Grafana folders, optionally within a parent folder.
  • •Includes validation, comparison, snapshot, and panel rendering tools for testing dashboard quality and data.
  • •Manages dashboards across multiple Grafana instances with per-cluster configuration and optional authentication.

BEST FOR

  • •Teams that want an AI client to explore and enhance existing Grafana dashboards without risking accidental overwrites.
  • •Organizations managing dashboards across multiple Grafana environments, such as development and production clusters.
  • •Operators who need to restrict dashboard operations to specific folder hierarchies.

ABOUT GRAFANA-MCP-CHRISTIAN-SCHLICHTHERLE

Grafana MCP server for dashboard and folder management is cataloged as an MCP server attributed to christian-schlichtherle. An MCP server that lets clients discover, edit, and test Grafana dashboards and folders across one or more Grafana clusters, with a label- and folder-based security model. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Grafana MCP server for dashboard and folder management are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

How does the server prevent unintended changes to dashboards?

Dashboards created through the server are labeled as its origin, and only dashboards carrying the required protection labels can be updated or deleted.

Can access be limited to specific Grafana folders?

Yes, folder restrictions provide configurable access control to specific folders and subfolders.

How does the server authenticate to Grafana clusters?

It uses service account tokens supplied per cluster, automatically adding the Bearer token to requests.

Upstream README

View this exact version on GitHub

README.md · a535720a1d08 · Fetched 2026-11-13 13:48:37 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

Grafana MCP

This repository provides an MCP (Model Context Protocol) server for the comprehensive discovery, editing, and testing of dashboards and folders in one or more Grafana clusters. Its security model is based on labels and folders.

Quick Start

# Install and run with zero configuration (uses localhost:3000 by default)
uv sync
python main.py

# That's it! The server is ready to use with your local Grafana instance.

Features

  • Dashboard Protection: When creating Grafana dashboards, the MCP server labels them to mark itself as the origin
  • Selective Modification: Only dashboards with required protection labels can be updated or deleted
  • Unrestricted Reading: No restrictions for reading dashboards, allowing enhancement of existing dashboards by copying them
  • Folder Restrictions: Configurable access control to specific folders and subfolders
  • Multi-Cluster Support: Manage dashboards across multiple Grafana instances
  • Comprehensive Search: Full support for Grafana's search API with filtering options

Available MCP Tools

Discovery

Discover and explore Grafana resources across clusters.

Cluster Management

  • list_clusters() - List all configured Grafana cluster names
  • check_cluster_health(cluster: str) - Check health and connectivity of a Grafana cluster

Search Operations

  • search(cluster: str, *, query: str = "", tags: list = [], starred: bool = False, folder_uids: list = [], dashboard_uids: list = [], dashboard_ids: list = [], type: str = "", limit: int = 1000, page: int = 1) - Search dashboards and folders with comprehensive filtering options

Dashboard Discovery

  • read_dashboard(cluster: str, dashboard_uid: str) - Read any dashboard configuration and metadata (no restrictions)
  • inspect_dashboard(cluster: str, dashboard_uid: str) - Detailed structural analysis of dashboard panels, variables, datasources, and layout

Folder Discovery

  • list_folders(cluster: str, *, parent_uid: str = "") - List folders, optionally under a parent folder
  • get_folder(cluster: str, folder_uid: str) - Get detailed folder information including hierarchy and permissions

Datasource Discovery

  • list_datasources(cluster: str) - List all datasources in cluster with name, type, UID, and metadata

Editing

Create, modify, and manage Grafana resources with security controls.

Dashboard Management

  • create_dashboard(cluster: str, dashboard_json: dict, *, folder_uid: str = "") - Create new dashboard with automatic protection labels
  • update_dashboard(cluster: str, dashboard_uid: str, dashboard_json: dict) - Update existing dashboard (requires protection labels)
  • delete_dashboard(cluster: str, dashboard_uid: str) - Delete dashboard (requires protection labels)
  • copy_dashboard(source_cluster: str, source_uid: str, new_title: str, *, target_cluster: str = "", folder_uid: str = "", target_uid: str = "") - Copy dashboard with intelligent UID handling and auto-overwrite capabilities

Folder Management

  • create_folder(cluster: str, title: str, *, parent_uid: str = "") - Create new folder, optionally as subfolder
  • update_folder(cluster: str, folder_uid: str, title: str, *, parent_uid: str = "") - Update/rename/move folder to different parent
  • delete_folder(cluster: str, folder_uid: str, *, force_delete_rules: bool = False) - Delete folder with optional alert rule cleanup

Testing

Validate, test, and analyze dashboard quality and data accuracy.

Validation & Quality Assurance

  • validate_dashboard(cluster: str, dashboard_uid: str) - Comprehensive schema validation and best practices checking
  • compare_dashboards(cluster: str, dashboard_uid_a: str, dashboard_uid_b: str, *, compare_cluster_b: str = "") - Compare two dashboards showing structural and configuration differences

Data Verification & Testing

  • snapshot_dashboard(cluster: str, dashboard_uid: str, *, snapshot_name: str = "", expires_hours: int = 24, time_from: str = "now-6h", time_to: str = "now") - Create snapshot with current data for inspection and testing
  • test_panel_render(cluster: str, dashboard_uid: str, panel_id: int, *, width: int = 1000, height: int = 500, time_from: str = "now-6h", time_to: str = "now", save_to_file: str = "") - Render panel as PNG for visual validation

Configuration

Environment Variables

Configure the MCP server using these environment variables:

# Cluster URLs (space-separated key=value pairs, defaults to "localhost=http://localhost:3000")
export GRAFANA_CLUSTERS="localhost=http://localhost:3000 dev=https://grafana.dev.example.com prod=https://grafana.prod.example.com"

# Cluster API tokens (space-separated key=value pairs, optional)
# Only required for clusters that need authentication
export GRAFANA_TOKENS="dev=glsa_yyy prod=glsa_zzz"  # Note: localhost has no token (unauthenticated)

# Protection labels (space-separated, defaults to "MCP")
export GRAFANA_LABELS="MCP Claude"

# Folder restriction (defaults to "/" for root access)
export GRAFANA_FOLDER=/MCP

Local Development Without Authentication

For local development, you can run Grafana in a Docker container without authentication:

# Run Grafana without authentication
docker run -d \
  -p 3000:3000 \
  -e "GF_AUTH_ANONYMOUS_ENABLED=true" \
  -e "GF_AUTH_ANONYMOUS_ORG_ROLE=Admin" \
  -e "GF_AUTH_BASIC_ENABLED=false" \
  --name grafana \
  grafana/grafana:latest

# Configure MCP server for unauthenticated local access
export GRAFANA_CLUSTERS="localhost=http://localhost:3000"
# No GRAFANA_TOKENS needed!

# Or use the default configuration (no environment variables needed!)
# This defaults to localhost=http://localhost:3000 without authentication

# Run the MCP server
python main.py

Mixed Authentication Environments

You can mix authenticated and unauthenticated clusters:

# Local without auth, production with auth
export GRAFANA_CLUSTERS="localhost=http://localhost:3000 prod=https://grafana.prod.com"
export GRAFANA_TOKENS="prod=glsa_abc123"  # Only prod needs a token

Authentication Setup (For Production Clusters)

For production or authenticated Grafana clusters, you need to create service account tokens. Service accounts are the recommended way to authenticate with Grafana's HTTP API (API keys are deprecated).

Note: Skip this section if you're only using local unauthenticated Grafana instances.

Creating Service Account Tokens via Grafana UI

  1. Create Service Account:

    • Navigate to Administration → Users and access → Service Accounts
    • Click "Add service account"
    • Enter a Display name (e.g., "MCP Server")
    • Select appropriate Role: Viewer, Editor, or Admin
    • Click "Create"
  2. Generate Token:

    • Select your newly created service account
    • Click "Add service account token"
    • Enter a Display name for the token
    • Set Expiration date (or select "No expiration")
    • Click "Generate token"
    • Important: Copy and save the token immediately - it's only shown once!

Creating Service Account Tokens via API

# Create service account
curl -X POST -H "Content-Type: application/json" \
  -d '{"name": "mcp-server", "role": "Editor"}' \
  http://admin:admin@localhost:3000/api/serviceaccounts

# Create token for the service account (use ID from previous response)
curl -X POST -H "Content-Type: application/json" \
  -d '{"name": "mcp-token"}' \
  http://admin:admin@localhost:3000/api/serviceaccounts/{id}/tokens

Using Tokens

Tokens should be prefixed with glsa_ and used in the GRAFANA_TOKENS environment variable:

export GRAFANA_TOKENS="prod=glsa_abc123def456 dev=glsa_xyz789uvw012"

Authentication in Requests

The MCP server automatically adds the Bearer token to all requests:

Authorization: Bearer glsa_abc123def456

For more information, see the official Grafana documentation on service accounts.

Installation & Usage

  1. Install dependencies:

    uv sync
    # or
    pip install -e .
    
  2. Set environment variables (see Configuration section above)

  3. Run the MCP server:

    python main.py
    

The server will validate your configuration and start the MCP server, making all tools available to MCP clients.

Example Usage

# List all configured clusters
clusters = list_clusters()
# Returns: ["localhost", "prod"]

# Explore folder hierarchy
root_folders = list_folders("prod")  # List root-level folders
subfolders = list_folders("prod", parent_uid="folder123")  # List subfolders

# Search for dashboards and folders
dashboards = search("prod", query="monitoring", tags=["production"])
folders_only = search("prod", type="dash-folder", query="team")
dashboards_only = search("prod", type="dash-db", starred=True)

# Create and manage folders
folder = create_folder("prod", "Team Alpha", parent_uid="parent123")
updated = update_folder("prod", "folder123", "New Name", parent_uid="new_parent")

# Copy a dashboard into a specific folder
new_dash = copy_dashboard("prod", "abc123def", "My New Dashboard", folder_uid="folder123")

# Create a dashboard with protection labels automatically added
result = create_dashboard("prod", {
    "title": "Test Dashboard",
    "panels": [...],
    "tags": ["custom"]  # MCP labels will be automatically added
}, folder_uid="folder123")

Security Model

  • Label-Based Protection: Dashboards created by this MCP server are automatically tagged with protection labels
  • Selective Operations: Only dashboards with required labels can be updated or deleted
  • Folder Restrictions: Operations can be restricted to specific folder hierarchies
  • Token-Based Auth: Uses secure service account tokens instead of deprecated API keys
  • No Overwrites: Dashboard creation prevents accidental overwrites of existing dashboards

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Grafana MCP server for dashboard and folder management from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/grafana-mcp-christian-schlichtherle)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools