Grafana MCP Server Integration

The Grafana MCP Server empowers AI assistants with real-time access to Grafana dashboards, datasources, and Prometheus queries—streamlining observability and DevOps workflows inside FlowHunt.

Grafana MCP Server Integration

What does “Grafana” MCP Server do?

The Grafana MCP (Model Context Protocol) Server is an integration layer that connects AI assistants with Grafana, enabling enhanced access to dashboards, data sources, and monitoring tools within the Grafana ecosystem. By exposing Grafana’s capabilities via MCP, the server allows AI-powered clients to perform tasks such as searching for dashboards, retrieving detailed dashboard information, managing dashboards, accessing and querying datasources, and executing Prometheus queries programmatically. This streamlines development and operational workflows by allowing AI assistants to interact directly with observability data, automate dashboard management, and facilitate real-time monitoring and troubleshooting, all within the context of AI-driven development environments.

List of Prompts

No explicit prompt templates are mentioned in the provided files or documentation.

List of Resources

  • Dashboards: Access and search Grafana dashboards by title or metadata, retrieve full dashboard details using unique identifiers, and manage dashboard content.
  • Datasources: List all configured datasources and fetch detailed information about each, particularly supporting Prometheus and Loki.
  • Prometheus Datasource Information: Retrieve and interact with Prometheus datasource information, including querying capabilities.
  • Panel Queries: Extract query strings and datasource info from every panel within a dashboard for advanced analytics or troubleshooting.

List of Tools

  • Search for dashboards: Search Grafana dashboards by title or metadata.
  • Get dashboard by UID: Retrieve detailed information for a specific dashboard using its unique identifier.
  • Update or create a dashboard: Modify or create new dashboards (with caution regarding context window limitations).
  • Get panel queries and datasource info: Fetch query strings and datasource details for dashboard panels.
  • List and fetch datasource information: List all configured datasources and retrieve info (Prometheus, Loki).
  • Query Prometheus: Execute PromQL queries (instant and range queries) against Prometheus datasources.

Use Cases of this MCP Server

  • Dashboard Management: Automate the search, retrieval, creation, and updating of Grafana dashboards, simplifying observability workflows for developers and SREs.
  • Data Source Exploration: Programmatically list, fetch, and analyze available datasources, aiding in infrastructure audits or onboarding.
  • Panel Query Extraction: Extract queries and datasource information from dashboard panels to assist in debugging, optimization, or documentation.
  • Automated Prometheus Querying: Enable AI assistants to execute Prometheus queries, supporting instant or range metric queries for monitoring and alerting.
  • DevOps Automation: Integrate Grafana observability capabilities into CI/CD pipelines or AI-driven troubleshooting, reducing manual dashboard operations.

How to set it up

Windsurf

  1. Ensure prerequisites such as Node.js and Docker are installed.
  2. Locate your Windsurf configuration file (commonly windsurf.config.json).
  3. Add the Grafana MCP Server using the following JSON snippet:
    {
      "mcpServers": {
        "grafana-mcp": {
          "command": "npx",
          "args": ["@grafana/mcp-grafana@latest"]
        }
      }
    }
    
  4. Save the configuration and restart Windsurf.
  5. Verify the setup by checking if the MCP server appears in the MCP servers list.

Securing API Keys Example

{
  "mcpServers": {
    "grafana-mcp": {
      "command": "npx",
      "args": ["@grafana/mcp-grafana@latest"],
      "env": {
        "GRAFANA_API_KEY": "${GRAFANA_API_KEY}"
      },
      "inputs": {
        "grafana_url": "https://your-grafana-instance"
      }
    }
  }
}

Claude

  1. Install prerequisites if required (Node.js, Docker).
  2. Open the Claude configuration file.
  3. Insert the MCP server configuration:
    {
      "mcpServers": {
        "grafana-mcp": {
          "command": "npx",
          "args": ["@grafana/mcp-grafana@latest"]
        }
      }
    }
    
  4. Save and restart Claude.
  5. Confirm the server registration in Claude’s MCP server status view.

Cursor

  1. Prepare your environment (Node.js/Docker).
  2. Edit the cursor.config.json file.
  3. Add the following MCP server JSON block:
    {
      "mcpServers": {
        "grafana-mcp": {
          "command": "npx",
          "args": ["@grafana/mcp-grafana@latest"]
        }
      }
    }
    
  4. Save the file and restart Cursor.
  5. Ensure the MCP server is running and accessible.

Cline

  1. Confirm necessary prerequisites are installed.
  2. Open Cline’s configuration file.
  3. Insert the Grafana MCP server config:
    {
      "mcpServers": {
        "grafana-mcp": {
          "command": "npx",
          "args": ["@grafana/mcp-grafana@latest"]
        }
      }
    }
    
  4. Save changes and restart Cline.
  5. Check server status in Cline’s interface.

Securing API Keys Example

{
  "mcpServers": {
    "grafana-mcp": {
      "command": "npx",
      "args": ["@grafana/mcp-grafana@latest"],
      "env": {
        "GRAFANA_API_KEY": "${GRAFANA_API_KEY}"
      },
      "inputs": {
        "grafana_url": "https://your-grafana-instance"
      }
    }
  }
}

How to use this MCP inside flows

Using MCP in FlowHunt

To integrate MCP servers into your FlowHunt workflow, start by adding the MCP component to your flow and connecting it to your AI agent:

FlowHunt MCP flow

Click on the MCP component to open the configuration panel. In the system MCP configuration section, insert your MCP server details using this JSON format:

{
  "grafana-mcp": {
    "transport": "streamable_http",
    "url": "https://yourmcpserver.example/pathtothemcp/url"
  }
}

Once configured, the AI agent is now able to use this MCP as a tool with access to all its functions and capabilities. Remember to change “grafana-mcp” to whatever the actual name of your MCP server is and replace the URL with your own MCP server URL.


Overview

SectionAvailabilityDetails/Notes
Overview
List of PromptsNo prompt templates mentioned in repo/files
List of ResourcesDashboards, Datasources, Panel Queries, Prometheus
List of ToolsDashboard search, update, datasource, query tools
Securing API KeysExample configs for env vars provided
Sampling Support (less important in evaluation)Not mentioned

Based on the above, the Grafana MCP server is well-documented for setup and covers the core MCP primitives (resources, tools, API key security), but lacks explicit prompt templates and information about sampling support. It is a strong, practical project for Grafana users and developers.


MCP Score

Has a LICENSE✅ Apache-2.0
Has at least one tool
Number of Forks82
Number of Stars951

Frequently asked questions

What is the Grafana MCP Server?

The Grafana MCP Server is an integration layer that connects AI assistants to Grafana, enabling programmatic access to dashboards, datasources, and Prometheus querying. It empowers AI-driven automation for monitoring, troubleshooting, and observability inside FlowHunt.

Which Grafana features can AI assistants access via this MCP Server?

AI assistants can search, retrieve, create, and update dashboards, list and analyze datasources (like Prometheus and Loki), extract panel queries, and execute Prometheus queries—all programmatically within your workflow.

How do I configure the Grafana MCP Server for use in FlowHunt?

Add the MCP component to your FlowHunt flow, then insert your Grafana MCP server details using the streamable_http transport and your server URL. Make sure to secure your API keys using environment variables as shown in the setup instructions.

Is it safe to use my Grafana API Key with this MCP Server?

Yes, as long as you store your API key in environment variables and never hardcode it into configuration files. Example configs are provided to help you secure sensitive information.

What are typical use cases for the Grafana MCP Server?

Common use cases include automated dashboard management, datasource exploration, panel query extraction, running Prometheus queries for monitoring/alerting, and integrating observability into DevOps and CI/CD pipelines with AI assistance.

Supercharge Your Observability with Grafana MCP

Leverage AI to automate dashboard management and monitoring by integrating Grafana with FlowHunt’s MCP Server. Experience seamless, intelligent observability today.

Learn more