Grafana Server – Overview | MCP Marketplace

✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more

UBOS Asset Marketplace: Grafana MCP Server - Unleash the Power of AI-Driven Observability

In today’s data-rich environment, observability is paramount. Understanding the performance and health of your systems requires more than just collecting metrics; it demands context, intelligent analysis, and the ability to act swiftly on insights. Enter the Grafana MCP (Model Context Protocol) Server, a powerful tool available on the UBOS Asset Marketplace designed to bridge the gap between Grafana’s robust monitoring capabilities and the world of AI-powered agents.

At UBOS, we believe that AI Agents will revolutionize how businesses operate. Our full-stack AI Agent Development Platform is focused on bringing the power of AI to every business department. We help you orchestrate AI Agents, connect them with your enterprise data, build custom AI Agents with your LLM model and Multi-Agent Systems. The Grafana MCP server is a key asset in realizing this vision, enabling AI Agents to leverage Grafana’s rich data for intelligent decision-making and automated actions.

What is an MCP Server?

Before diving into the specifics of the Grafana MCP Server, let’s clarify what an MCP (Model Context Protocol) Server is and why it’s crucial in the age of AI.

MCP is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). In essence, an MCP server acts as a bridge, allowing AI models to access and interact with external data sources and tools. This interaction unlocks a wide range of possibilities, from automated troubleshooting to proactive performance optimization.

The Grafana MCP Server, in particular, is designed to provide AI Agents with access to your Grafana instance and its surrounding ecosystem. This allows AI Agents to:

  • Understand system performance: Access dashboards, metrics, and logs to gain a comprehensive view of system health.
  • Identify anomalies: Detect unusual patterns and potential issues based on historical data and real-time monitoring.
  • Automate incident response: Trigger automated actions based on predefined rules and thresholds, reducing downtime and improving overall reliability.
  • Optimize resource allocation: Analyze resource utilization and identify opportunities for optimization, improving efficiency and reducing costs.

Use Cases: Transforming Observability with AI

The Grafana MCP Server opens up a plethora of use cases for AI-driven observability. Here are a few examples:

  • Automated Incident Management: Imagine an AI Agent that monitors your Grafana dashboards and automatically creates an incident in Grafana Incident when a critical threshold is breached. The agent can then enrich the incident with relevant logs and metrics, speeding up the troubleshooting process and reducing the impact of the issue.

  • Intelligent Performance Optimization: An AI Agent can analyze historical performance data from Grafana to identify bottlenecks and predict future performance issues. Based on this analysis, the agent can recommend or even automatically implement optimization strategies, such as scaling up resources or adjusting configuration parameters.

  • Proactive Anomaly Detection: By continuously monitoring logs and metrics, an AI Agent can learn the normal behavior of your systems and detect anomalies that might indicate an impending problem. This allows you to address issues before they impact your users.

  • Enhanced Security Monitoring: AI Agents can leverage Grafana’s data to detect and respond to security threats. For example, an agent can monitor network traffic logs for suspicious activity and automatically block malicious IP addresses.

  • AI-Powered Chatbots for Observability: Imagine a chatbot that can answer questions about your system’s performance by querying Grafana data through the MCP server. This empowers users to quickly get the information they need without having to manually navigate dashboards and logs.

Key Features: A Deep Dive

The Grafana MCP Server boasts a rich set of features designed to empower AI Agents with comprehensive access to Grafana’s capabilities. Let’s explore some of the key features in detail:

  • Dashboard Search: Enables AI Agents to quickly find relevant dashboards based on keywords and metadata. This is crucial for navigating complex environments with numerous dashboards.

  • Dashboard Access: Provides access to dashboard data, including panels, queries, and data sources. AI Agents can use this data to understand the current state of the system and identify potential issues.

    • Get Dashboard by UID: Retrieve a specific dashboard using its unique identifier (UID).
    • Update or Create Dashboards: Allows AI Agents to modify existing dashboards or create new ones based on specific needs. Note: Exercise caution when updating dashboards, as context window limitations may apply.
    • Get Dashboard Panel Queries: Extract the title, query string, and data source information from every panel in a dashboard. This provides AI Agents with a detailed understanding of the data being visualized.
  • Datasource Management: Allows AI Agents to list and fetch information about data sources configured in Grafana. This is essential for understanding the origins of the data being analyzed.

  • Data Querying: Enables AI Agents to directly query data sources supported by Grafana, including Prometheus and Loki.

    • Prometheus: Query metrics from Prometheus data sources.
    • Loki: Query logs and metrics from Loki data sources.
      • Log Queries: Retrieve logs using LogQL.
      • Metric Queries: Query metrics derived from logs.
  • Metadata Discovery: Provides access to metadata about Prometheus and Loki data sources, allowing AI Agents to understand the available metrics and labels.

    • Prometheus Metadata:
      • Metric Metadata: Retrieve metadata about available metrics.
      • Metric Names: List all available metric names.
      • Label Names: List label names matching a specific selector.
      • Label Values: List values for a specific label.
    • Loki Metadata:
      • Label Names: List all available label names in logs.
      • Label Values: List values for a specific log label.
      • Stats: Get statistics about log streams.
  • Incident Management: Enables AI Agents to interact with Grafana Incident, allowing them to create, update, and resolve incidents based on monitoring data.

    • Search, Create, Update, and Close Incidents: Full control over the incident lifecycle.
  • Sift Integration: Integrates with Sift, Grafana’s root cause analysis tool, allowing AI Agents to investigate issues and identify underlying causes.

    • Create Investigations: Start new Sift investigations based on events or anomalies detected in Grafana.
    • List Investigations: List existing Sift investigations, with options to limit the number of results.
    • Get Investigation: Retrieve a specific Sift investigation by its UUID.
    • Get Analyses: Retrieve a specific analysis from a Sift investigation.
    • Find Error Patterns in Logs: Use Sift to identify elevated error patterns in Loki logs.
    • Find Slow Requests: Use Sift to identify slow requests from Tempo data sources.
  • Alerting Integration: Allows AI Agents to access and manage Grafana alerts, enabling automated responses to critical events.

    • List and Fetch Alert Rule Information: Retrieve details about existing alert rules.
    • Get Alert Rule Statuses: Monitor the current status of alert rules (firing, normal, error, etc.).
    • List Contact Points: Retrieve a list of configured contact points for alert notifications.
  • Grafana OnCall Integration: Provides access to Grafana OnCall functionality, enabling AI Agents to manage schedules, shifts, and on-call users.

    • List and Manage Schedules: Manage OnCall schedules.
    • Get Shift Details: Retrieve details about specific OnCall shifts.
    • Get Current On-Call Users: Identify users currently on-call for a specific schedule.
    • List Teams and Users: Access information about teams and users in Grafana OnCall.
  • Admin Functionality: Provides access to administrative features, allowing AI Agents to manage teams and roles.

    • List Teams: Retrieve a list of all teams.

Configurable Toolset: Tailoring to Your Needs

One of the key advantages of the Grafana MCP Server is its configurable toolset. You can choose which tools you want to make available to the MCP client, allowing you to optimize the context window and focus on the functionality that is most relevant to your AI Agents.

To disable a category of tools, use the --disable-<category> flag when starting the server. For example, to disable the OnCall tools, use --disable-oncall. This allows you to fine-tune the server to your specific needs and avoid unnecessary overhead.

Getting Started: Seamless Integration with UBOS

Integrating the Grafana MCP Server with your UBOS environment is a straightforward process. Here’s a step-by-step guide:

  1. Create a Grafana Service Account: Create a service account in Grafana with the necessary permissions to access the tools you want to use. Generate a service account token and keep it safe.

  2. Install the MCP Server: You have several options for installing the mcp-grafana server:

    • Docker Image: Use the pre-built Docker image from Docker Hub.
    • Download Binary: Download the latest release from the GitHub releases page.
    • Build from Source: Build and install the server from source using the Go toolchain.
  3. Configure Your MCP Client: Add the server configuration to your client configuration file. The exact configuration will depend on the client you are using (e.g., Claude Desktop).

For example, here’s the configuration for Claude Desktop when using the binary:

{ “mcpServers”: { “grafana”: { “command”: “mcp-grafana”, “args”: [], “env”: { “GRAFANA_URL”: “http://localhost:3000”, “GRAFANA_API_KEY”: “” } } } }

And here’s the configuration when using Docker:

{ “mcpServers”: { “grafana”: { “command”: “docker”, “args”: [ “run”, “–rm”, “-p”, “8000:8000”, “-e”, “GRAFANA_URL”, “-e”, “GRAFANA_API_KEY”, “mcp/grafana” ], “env”: { “GRAFANA_URL”: “http://localhost:3000”, “GRAFANA_API_KEY”: “” } } } }

Debugging and Development

The Grafana MCP Server includes a debug mode that provides detailed logging of HTTP requests and responses, which can be helpful for troubleshooting. To enable debug mode, add the -debug flag to the command when starting the server.

Contributions to the project are welcome! If you have any suggestions or improvements, please open an issue or submit a pull request.

License

The Grafana MCP Server is licensed under the Apache License, Version 2.0.

Conclusion: Empowering AI with Observability

The Grafana MCP Server on the UBOS Asset Marketplace is a game-changer for AI-driven observability. By providing AI Agents with seamless access to Grafana’s rich data and functionality, it unlocks a wide range of use cases, from automated incident management to intelligent performance optimization.

With its configurable toolset, easy integration, and robust feature set, the Grafana MCP Server is an essential tool for any organization looking to leverage the power of AI to improve the performance, reliability, and security of their systems. Integrate Grafana MCP Server with UBOS Platform and unleash the full potential of your AI Agents.

Featured Templates

View More

Start your free trial

Build your solution today. No credit card required.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.