Logo de Grafana

Grafana

OrganizaçãoPopular
grafana

MCP server for Grafana

Publicado porgrafana
Repositóriomcp-grafana
IdiomaGo
Forks
449
Estrelas
3.5K
Ferramentas disponíveis
40
Tipo de transportestdio
Categorias
LicençaApache-2.0
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    Grafana disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 40 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    3.5K estrelas e 449 forks no repositório vinculado.

Grafana MCP server

Unit Tests Integration Tests E2E Tests Go Reference MCP Catalog

A [Model Context Protocol][mcp] (MCP) server for Grafana.

This provides access to your Grafana instance and the surrounding ecosystem.

Quick Start

Requires uv. Add the following to your MCP client configuration (e.g. Claude Desktop, Cursor):

json
{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": ["mcp-grafana"],
      "env": {
        "GRAFANA_URL": "http://localhost:3000",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your service account token>"
      }
    }
  }
}

For Grafana Cloud, replace GRAFANA_URL with your instance URL (e.g. https://myinstance.grafana.net). See Usage for more installation options including Docker, binary, and Helm.

Requirements

  • Grafana version 9.0 or later is required for full functionality. Some features, particularly datasource-related operations, may not work correctly with earlier versions due to missing API endpoints.

Features

The following features are currently available in MCP server. This list is for informational purposes only and does not represent a roadmap or commitment to future features.

Dashboards

  • Search for dashboards: Find dashboards by title, folder UID, tag, or starred status
  • Get dashboard by UID: Retrieve full dashboard details using its unique identifier. Pass optional version to load a saved snapshot instead of the current dashboard. Warning: Large dashboards can consume significant context window space.
  • List dashboard versions: List saved versions of a dashboard as compact metadata (version number, author, timestamp, save message)
  • Get dashboard summary: Get a compact overview of a dashboard including title, panel count, panel types, variables, and metadata without the full JSON to minimize context window usage
  • Get dashboard property: Extract specific parts of a dashboard using JSONPath expressions (e.g., $.title, $.panels[*].title) to fetch only needed data and reduce context window consumption
  • Update or create a dashboard: Modify existing dashboards or create new ones. Warning: Requires full dashboard JSON which can consume large amounts of context window space.
  • Patch dashboard: Apply specific changes to a dashboard without requiring the full JSON, significantly reducing context window usage for targeted modifications
  • Get panel queries and datasource info: Get the title, query string, and datasource information (including UID and type, if available) from every panel in a dashboard

Run Panel Query

Note: Run panel query tools are disabled by default. To enable them, add runpanelquery to your --enabled-tools flag.

  • Run panel query: Execute a dashboard panel's query with custom time ranges and variable overrides.

Context Window Management

The dashboard tools now include several strategies to manage context window usage effectively (issue #101):

  • Use get_dashboard_summary for dashboard overview and planning modifications
  • Use get_dashboard_property with JSONPath when you only need specific dashboard parts
  • Avoid get_dashboard_by_uid unless you specifically need the complete dashboard JSON

Datasources

  • List and fetch datasource information: View all configured datasources and retrieve detailed information about each.
    • Supported datasource types: Prometheus, Loki, ClickHouse, CloudWatch, Elasticsearch, OpenSearch, Snowflake, Athena.

Query Examples

Note: Query examples tools are disabled by default. To enable them, add examples to your --enabled-tools flag.

  • Get query examples: Retrieve example queries for different datasource types to learn query syntax.

Prometheus Querying

  • Query Prometheus: Execute PromQL queries (supports both instant and range metric queries) against Prometheus datasources.
  • Query Prometheus metadata: Retrieve metric metadata, metric names, label names, and label values from Prometheus datasources.
  • Query histogram percentiles: Calculate histogram percentile values (p50, p90, p95, p99) using histogram_quantile.

Loki Querying

  • Query Loki logs and metrics: Run both log queries and metric queries using LogQL against Loki datasources.
  • Query Loki metadata: Retrieve label names, label values, and stream statistics from Loki datasources.
  • Query Loki patterns: Retrieve log patterns detected by Loki to identify common log structures and anomalies.

InfluxDB Querying

Note: InfluxDB tools are disabled by default. To enable them, add influxdb to your --enabled-tools flag.

  • Query InfluxDB: Execute queries against InfluxDB datasources using either InfluxQL (v1.x) or Flux (v2.x). The dialect is inferred from the datasource configuration, or can be set explicitly via the dialect parameter.

SQL Datasource Querying

Note: SQL tools are disabled by default. To enable them, add sql to your --enabled-tools flag. Back-compat aliases clickhouse, snowflake, and athena also work.

Unified SQL tools support ClickHouse, Snowflake, Athena, MySQL, PostgreSQL, and MSSQL through a single set of tools. Queries go through Grafana's datasource plugins, so authentication is handled by datasource configuration — credentials are never seen by the MCP server.

  • List databases/schemas/catalogs: Discover organizational units for a SQL datasource. For Athena, omit catalog to list catalogs, or pass a catalog to list databases.
  • List tables: List tables in a database or schema with metadata (row counts, sizes where available).
  • Describe table schema: Get column names, types, nullability, defaults, and comments.
  • Query SQL: Execute SQL queries with datasource-specific macro substitution ($__timeFilter(col), $__from/$__to, $__interval, ${varname}), automatic limit enforcement, and template variable support.

CloudWatch Querying

Note: CloudWatch tools are disabled by default. To enable them, add cloudwatch to your --enabled-tools flag.

  • List CloudWatch namespaces: Discover available AWS CloudWatch namespaces.
  • List CloudWatch metrics: List metrics available in a specific namespace.
  • List CloudWatch dimensions: Get dimensions for filtering metric queries.
  • Query CloudWatch: Execute CloudWatch metric queries with time range support.

Graphite Querying

Note: Graphite tools are disabled by default. To enable them, add graphite to your --enabled-tools flag.

  • Query Graphite: Execute Graphite render API queries against a Graphite datasource.
  • List Graphite metrics: Browse and discover Graphite metric paths.
  • List Graphite tags: List available Graphite tags and tag values.
  • Query Graphite density: Query Graphite metric density for a given pattern.

Elasticsearch/OpenSearch Querying

Note: Elasticsearch/OpenSearch tools are disabled by default. To enable them, add elasticsearch to your --enabled-tools flag.

  • Query Elasticsearch/OpenSearch: Execute search queries against Elasticsearch or OpenSearch datasources using either Lucene query syntax or Elasticsearch Query DSL. Supports filtering by time range and retrieving logs, metrics, or any indexed data. Returns documents with their index, ID, source fields, and optional relevance score.

Quickwit Querying

Note: Quickwit tools are disabled by default. To enable them, add quickwit to your --enabled-tools flag.

  • Query Quickwit: Execute search queries against Quickwit datasources using Lucene query syntax or partial Elasticsearch-compatible Query DSL. Supports filtering by time range and retrieving logs or other indexed documents. Returns documents with their index, ID, source fields, and optional relevance score.

Agent Observability

Note: Agent Observability tools are disabled by default and work only in Grafana Cloud. To enable them, add agento11y to your --enabled-tools flag.

  • List and search conversations: List recent LLM conversations or search them with a filter expression (model, provider, agent, status, error type, eval results, and more) over a time range. Search results include error counts, rating summaries, evaluation summaries, and trace IDs.
  • Get conversation detail: Fetch a single conversation with all its generations, including prompts and outputs.
  • Get generation detail and scores: Fetch a single generation by ID, and its evaluation scores (evaluator, score key, value, passed, explanation).
  • Read the agent catalog: List the agents that send telemetry, fetch one agent version in full (complete system prompt, every tool with its JSON schema, and the models it ran on), walk an agent's version history, and compare evaluation score aggregates per version. Effective versions are sha256: hashes that a tool change never affects; for an agent that reports no version of its own they hash the system prompt, so a prompt edit mints a new version. Catalog and version rows carry a token_estimate, which is worth checking before fetching a full prompt.
  • Inspect evaluators and templates: Read the evaluators a score came from, the templates they were derived from, and the judge providers and models available to LLM-judge evaluators. With write tools enabled, also create, fork, test, and delete evaluators.
  • Inspect eval rules and guards: Read the asynchronous eval rules that bind evaluators to production traffic, and the guards (hook rules) that run inline and can warn or deny. With write tools enabled, also create, update, preview, and delete them. Writes and the non-persisting preview_rule and test_evaluator operations need the grafana-agento11y-app.eval:write permission, granted by the Agento11y Admin role.
  • Curate saved conversations and collections: Read the saved conversations (bookmarks that give a conversation a stable ID, name, and tags) and the collections that group them, including each collection's member count and the collections embedded in every saved-conversation row. With write tools enabled, also bookmark a conversation, create and edit collections, and add or remove members. These writes need the same grafana-agento11y-app.eval:write permission.
  • Read and edit test suites: List the versioned test suites that offline experiments run against, read one with its full version history, and page through the test cases of a version. With write tools enabled, also create a suite, rename or retag it, open a draft version, publish it, and write or delete its test cases. A published version is frozen, so an edit means opening a new draft. These writes need grafana-agento11y-app.eval:write.
  • Read offline experiments: List the evaluation runs over a test suite and read one with its headline pass rate, cost, and token totals. Drill down through a per-test-case report to trials, their scores with each judge's explanation, and their artifact metadata. With write tools enabled, also rename or retag an experiment and cancel a running one, which need grafana-agento11y-app.eval:write. Experiments are created by SDK runners, not by this tool.

Grafana Assistant

Note: Assistant tools are disabled by default and require the Grafana Assistant plugin (grafana-assistant-app) to be installed on the target Grafana instance. They are also write tools (the assistant may mutate stack state), so they are skipped when --disable-write is set. To enable them, add assistant to your --enabled-tools flag.

  • Ask the assistant: Send a natural-language prompt to Grafana Assistant and wait for the full text reply. The assistant may use tools, metrics, logs, and other stack context—broader than firing one isolated data-source query. Pass the returned contextId back in a follow-up call to continue the same conversation. Complex tasks can take several minutes; the call blocks until the reply is done or the request times out (5 minutes).

Incidents

  • Search, create, and update incidents: Manage incidents in Grafana Incident, including searching, creating, adding activities, and reading or setting custom fields.

Sift Investigations

  • List Sift investigations: Retrieve a list of Sift investigations, with support for a limit parameter.
  • Get Sift investigation: Retrieve details of a specific Sift investigation by its UUID.
  • Get Sift analyses: Retrieve a specific analysis from a Sift investigation.
  • Find error patterns in logs: Detect elevated error patterns in Loki logs using Sift.
  • Find slow requests: Detect slow requests using Sift (Tempo).

Alerting

  • List and fetch alert rule information: View alert rules and their statuses (firing/normal/error/etc.) in Grafana. Supports both Grafana-managed rules and datasource-managed rules from Prometheus or Loki datasources.
  • Create and update alert rules: Create new alert rules or modify existing ones.
  • Delete alert rules: Remove alert rules by UID.
  • Manage alerting routing: View notification policies, contact points, and time intervals. Supports both Grafana-managed contact points and receivers from external Alertmanager datasources (Prometheus Alertmanager, Mimir, Cortex).

Grafana OnCall

  • List and manage schedules: View and manage on-call schedules in Grafana OnCall.
  • Get shift details: Retrieve detailed information about specific on-call shifts.
  • Get current on-call users: See which users are currently on call for a schedule.
  • List teams and users: View all OnCall teams and users.
  • List alert groups: View and filter alert groups from Grafana OnCall by various criteria including state, integration, labels, and time range.
  • Get alert group details: Retrieve detailed information about a specific alert group by its ID.

Admin

Note: Admin tools are disabled by default. To enable them, include admin in your --enabled-tools flag.

  • List teams: View all configured teams in Grafana.
  • List Users: View all users in an organization in Grafana.
  • List all roles: List all Grafana roles, with an optional filter for delegatable roles.
  • Get role details: Get details for a specific Grafana role by UID.
  • List assignments for a role: List all users, teams, and service accounts assigned to a role.
  • List roles for users: List all roles assigned to one or more users.
  • List roles for teams: List all roles assigned to one or more teams.
  • List permissions for a resource: List all permissions defined for a specific resource (dashboard, datasource, folder, etc.).
  • Describe a Grafana resource: List available permissions and assignment capabilities for a resource type.

User

  • User info: Get the current Grafana identity — login, email, name, whether it is a Grafana (server) admin, the current organization, and the organizations the credential can access (with roles). Use it to discover valid orgId values for multi-organization requests.

Navigation

  • Generate deeplinks: Create accurate deeplink URLs for Grafana resources instead of relying on LLM URL guessing.
    • Dashboard links: Generate direct links to dashboards using their UID (e.g., http://localhost:3000/d/dashboard-uid)
    • Panel links: Create links to specific panels within dashboards with viewPanel parameter (e.g., http://localhost:3000/d/dashboard-uid?viewPanel=5)
    • Explore links: Generate links to Grafana Explore with pre-configured datasources (e.g., http://localhost:3000/explore?schemaVersion=1&panes={"a":{"datasource":"prometheus-uid"}}). Grafana below 10.2 does not understand panes, so the legacy ?left={...} format is emitted for those versions instead.
    • Time range support: Add time range parameters to links (from=now-1h&to=now)
    • Custom parameters: Include additional query parameters like dashboard variables or refresh intervals

Annotations

  • Get Annotations: Query annotations with filters. Supports time range, dashboard UID, tags, and match mode.
  • Create Annotation: Create a new annotation on a dashboard or panel.
  • Create Graphite Annotation: Create annotations using Graphite format (what, when, tags, data).
  • Update Annotation: Replace all fields of an existing annotation (full update).
  • Patch Annotation: Update only specific fields of an annotation (partial update).
  • Delete Annotation: Permanently delete an annotation by ID.
  • Get Annotation Tags: List available annotation tags with optional filtering.

Snapshots

  • List snapshots: List dashboard snapshots with optional query and limit filters.
  • Get snapshot: Retrieve snapshot metadata and dashboard payload by snapshot key.
  • Create snapshot: Create a dashboard snapshot from a full dashboard payload, with optional expiration and external snapshot options.
  • Delete snapshot: Delete a snapshot by snapshot key.

Rendering

  • Get panel or dashboard image: Render a Grafana dashboard panel or full dashboard as a PNG image. Returns the image as base64 encoded data for use in reports, alerts, or presentations. Supports customizing dimensions, time range, theme, scale, and dashboard variables. Also supports rendering not-yet-applied dashboards from a provisioning repository branch (e.g. a git-sync PR preview) via the optional provisioningPreview parameter.

Provisioning

  • List provisioning repositories: List provisioning repositories configured for this Grafana instance (e.g. git-sync sources), returning each repository's slug along with its source URL, branch, path, sync state, and health.
  • Validate provisioning file: Dry-run-apply a file from a provisioning repository at a given branch or commit. Returns whether it would be accepted, the resource action (create/update), the target resource type, and any structured validation errors — the same admission surface Grafana's PR commenter uses.

The list of tools is configurable, so you can choose which tools you want to make available to the MCP client. This is useful if you don't use certain functionality or if you don't want to take up too much of the context window. 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, or to disable navigation deeplink generation, use --disable-navigation.

RBAC Permissions

Each tool requires specific RBAC permissions to function properly. When creating a service account for the MCP server, ensure it has the necessary permissions based on which tools you plan to use. The permissions listed are the minimum required actions - you may also need appropriate scopes (e.g., datasources:*, dashboards:*, folders:*) depending on your use case.

Tip: If you're not familiar with Grafana RBAC or you want a quicker, simpler setup instead of configuring many granular scopes, you can assign a built-in role such as Editor to the service account. The Editor role grants broad read/write access that will allow most MCP server operations; it is less granular (and therefore less restrictive) than manually-applied scopes, so use it only when convenience is more important than strict least-privilege access.

Note: Grafana Incident and Sift tools use basic Grafana roles instead of fine-grained RBAC permissions:

  • Viewer role: Required for read-only operations (list incidents, get investigations)
  • Editor role: Required for write operations (create incidents, modify investigations)

For more information about Grafana RBAC, see the official documentation.

RBAC Scopes

Scopes define the specific resources that permissions apply to. Each action requires both the appropriate permission and scope combination.

Common Scope Patterns:

  • Broad access: Use * wildcards for organization-wide access

    • datasources:* - Access to all datasources
    • dashboards:* - Access to all dashboards
    • folders:* - Access to all folders
    • teams:* - Access to all teams
  • Limited access: Use specific UIDs or IDs to restrict access to individual resources

    • datasources:uid:prometheus-uid - Access only to a specific Prometheus datasource
    • dashboards:uid:abc123 - Access only to dashboard with UID abc123
    • folders:uid:xyz789 - Access only to folder with UID xyz789
    • teams:id:5 - Access only to team with ID 5
    • global.users:id:123 - Access only to user with ID 123

Examples:

  • Full MCP server access: Grant broad permissions for all tools

    datasources:* (datasources:read, datasources:query)
    dashboards:* (dashboards:read, dashboards:create, dashboards:write)
    folders:* (for dashboard creation and alert rules)
    teams:* (teams:read)
    global.users:* (users:read)
  • Limited datasource access: Only query specific Prometheus and Loki instances

    datasources:uid:prometheus-prod (datasources:query)
    datasources:uid:loki-prod (datasources:query)
  • Dashboard-specific access: Read only specific dashboards

    dashboards:uid:monitoring-dashboard (dashboards:read)
    dashboards:uid:alerts-dashboard (dashboards:read)

Tools

ToolCategoryDescriptionRequired RBAC PermissionsRequired Scopes
list_teamsAdminList all teamsteams:readteams:* or teams:id:1
list_users_by_orgAdminList all users in an organizationusers:readglobal.users:* or global.users:id:123
list_all_rolesAdminList all Grafana rolesroles:readroles:*
get_role_detailsAdminGet details for a Grafana roleroles:readroles:uid:editor
get_role_assignmentsAdminList assignments for a roleroles:readroles:uid:editor
list_user_rolesAdminList roles for usersroles:readglobal.users:id:123
list_team_rolesAdminList roles for teamsroles:readteams:id:7
get_resource_permissionsAdminList permissions for a resourcepermissions:readdashboards:uid:abcd1234
get_resource_descriptionAdminDescribe a Grafana resource typepermissions:readdashboards:*
user_infoUserCurrent identity, capabilities, and accessible organizationsNone (signed-in user)—
search_dashboardsSearchSearch for dashboards by query, folder UID, tag, or starreddashboards:readdashboards:* or dashboards:uid:abc123
get_dashboard_by_uidDashboardGet a dashboard by uid, optionally a saved versiondashboards:readdashboards:uid:abc123
list_dashboard_versionsDashboardList saved versions of a dashboard (version, author, time, message)dashboards:readdashboards:uid:abc123
update_dashboardDashboardUpdate or create a new dashboarddashboards:create, dashboards:writedashboards:*, folders:* or folders:uid:xyz789
get_dashboard_panel_queriesDashboardGet panel title, queries, datasource UID and type from a dashboarddashboards:readdashboards:uid:abc123
run_panel_queryRunPanelQuery*Execute one or more dashboard panel queriesdashboards:read, datasources:querydashboards:uid:*, datasources:uid:*
get_dashboard_propertyDashboardExtract specific parts of a dashboard using JSONPath expressionsdashboards:readdashboards:uid:abc123
get_dashboard_summaryDashboardGet a compact summary of a dashboard without full JSONdashboards:readdashboards:uid:abc123
list_datasourcesDatasourcesList datasourcesdatasources:readdatasources:*
get_datasourceDatasourcesGet a datasource by UID or namedatasources:readdatasources:uid:prometheus-uid
get_query_examplesExamples*Get example queries for a datasource typedatasources:readdatasources:*
query_prometheusPrometheusExecute a query against a Prometheus datasourcedatasources:querydatasources:uid:prometheus-uid
list_prometheus_metric_metadataPrometheusList metric metadatadatasources:querydatasources:uid:prometheus-uid
list_prometheus_metric_namesPrometheusList available metric namesdatasources:querydatasources:uid:prometheus-uid
list_prometheus_label_namesPrometheusList label names matching a selectordatasources:querydatasources:uid:prometheus-uid
list_prometheus_label_valuesPrometheusList values for a specific labeldatasources:querydatasources:uid:prometheus-uid
query_prometheus_histogramPrometheusCalculate histogram percentile valuesdatasources:querydatasources:uid:prometheus-uid
list_incidentsIncidentList incidents in Grafana Incident, optionally with their custom field valuesViewer roleN/A
create_incidentIncidentCreate an incident in Grafana Incident, optionally setting custom fieldsEditor roleN/A
add_activity_to_incidentIncidentAdd an activity item to an incident in Grafana IncidentEditor roleN/A
update_incidentIncidentUpdate an incident in Grafana Incident (status, severity, title, or custom fields)Editor roleN/A
get_incidentIncidentGet a single incident by ID, including its custom fieldsViewer roleN/A
list_incident_custom_fieldsIncidentList the custom fields configured for incidents, with their types and select optionsViewer roleN/A
query_loki_logsLokiQuery and retrieve logs using LogQL (either log or metric queries)datasources:querydatasources:uid:loki-uid
list_loki_label_namesLokiList all available label names in logsdatasources:querydatasources:uid:loki-uid
list_loki_label_valuesLokiList values for a specific log labeldatasources:querydatasources:uid:loki-uid
query_loki_statsLokiGet statistics about log streamsdatasources:querydatasources:uid:loki-uid
query_loki_patternsLokiQuery detected log patterns to identify common structuresdatasources:querydatasources:uid:loki-uid
analyze_loki_labelsLokiAudit a Loki label strategy (live or static) and optionally diagnose query performancedatasources:querydatasources:uid:loki-uid
suggest_loki_alloy_label_configConfigGenerate an Alloy loki.process snippet enforcing approved labelsN/AN/A
query_influxdbInfluxDBQuery InfluxDB using InfluxQL (v1) or Flux (v2)datasources:querydatasources:uid:influxdb-uid
list_sql_databasesSQL*List databases, schemas, or catalogs from a SQL datasourcedatasources:querydatasources:uid:*
list_sql_tablesSQL*List tables in a SQL datasourcedatasources:querydatasources:uid:*
describe_sql_tableSQL*Get column schema for a tabledatasources:querydatasources:uid:*
query_sqlSQL*Execute SQL queries with macro substitutiondatasources:querydatasources:uid:*
list_cloudwatch_namespacesCloudWatch*List available AWS CloudWatch namespacesdatasources:querydatasources:uid:*
list_cloudwatch_metricsCloudWatch*List metrics in a namespacedatasources:querydatasources:uid:*
list_cloudwatch_dimensionsCloudWatch*List dimensions for a metricdatasources:querydatasources:uid:*
list_cloudwatch_dimension_valuesCloudWatch*List values for a dimension keydatasources:querydatasources:uid:*
query_cloudwatchCloudWatch*Execute CloudWatch metric queriesdatasources:querydatasources:uid:*
query_elasticsearchElasticsearch/OpenSearch*Query Elasticsearch or OpenSearch using Lucene syntax or Query DSLdatasources:querydatasources:uid:datasource-uid
query_quickwitQuickwit*Query Quickwit using Lucene syntax or Query DSLdatasources:querydatasources:uid:quickwit-uid
alerting_manage_rulesAlertingManage alert rules (list, get, versions, create, update, delete)alert.rules:read + alert.rules:write for mutationsfolders:* or folders:uid:alerts-folder
alerting_manage_routingAlertingManage notification policies, contact points, and time intervalsalert.notifications:readGlobal scope
alerting_manage_silencesAlertingManage alerting silences (list, get, create, update, expire)alert.instances:read + alert.instances:write for mutationsGlobal scope
list_oncall_schedulesOnCallList schedules from Grafana OnCallgrafana-oncall-app.schedules:readPlugin-specific scopes
get_oncall_shiftOnCallGet details for a specific OnCall shiftgrafana-oncall-app.schedules:readPlugin-specific scopes
get_current_oncall_usersOnCallGet users currently on-call for a specific schedulegrafana-oncall-app.schedules:readPlugin-specific scopes
list_oncall_teamsOnCallList teams from Grafana OnCallgrafana-oncall-app.user-settings:readPlugin-specific scopes
list_oncall_usersOnCallList users from Grafana OnCallgrafana-oncall-app.user-settings:readPlugin-specific scopes
list_alert_groupsOnCallList alert groups from Grafana OnCall with filtering optionsgrafana-oncall-app.alert-groups:readPlugin-specific scopes
get_alert_groupOnCallGet a specific alert group from Grafana OnCall by its IDgrafana-oncall-app.alert-groups:readPlugin-specific scopes
update_alert_groupOnCallAcknowledge, unacknowledge, resolve, or unresolve an alert groupgrafana-oncall-app.alert-groups:write (and :read)Plugin-specific scopes
get_sift_investigationSiftRetrieve an existing Sift investigation by its UUIDViewer roleN/A
get_sift_analysisSiftRetrieve a specific analysis from a Sift investigationViewer roleN/A
list_sift_investigationsSiftRetrieve a list of Sift investigations with an optional limitViewer roleN/A
find_error_pattern_logsSiftFinds elevated error patterns in Loki logs.Editor roleN/A
find_slow_requestsSiftFinds slow requests from the relevant tempo datasources.Editor roleN/A
list_pyroscope_label_namesPyroscopeList label names matching a selectordatasources:querydatasources:uid:pyroscope-uid
list_pyroscope_label_valuesPyroscopeList label values matching a selector for a label namedatasources:querydatasources:uid:pyroscope-uid
list_pyroscope_profile_typesPyroscopeList available profile typesdatasources:querydatasources:uid:pyroscope-uid
query_pyroscopePyroscopeQuery profiles, metrics, or both from Pyroscopedatasources:querydatasources:uid:pyroscope-uid
get_assertionsAssertsGet assertion summary for a given entityPlugin-specific permissionsPlugin-specific scopes
agento11y_manage_conversationsAgent Observability*List, search, and fetch LLM conversations from Grafana Agent Observabilitygrafana-agento11y-app.conversations:readN/A
agento11y_manage_generationsAgent Observability*Fetch LLM generation details and evaluation scores from Grafana Agent Observabilitygrafana-agento11y-app.data:readN/A
agento11y_manage_agentsAgent Observability*Read the agent catalog: list agents, get one agent version in full, list version history, and per-version score aggregatesgrafana-agento11y-app.data:readN/A
agento11y_manage_evaluatorsAgent Observability*Manage evaluators, evaluator templates, and the judge catalog (list, get, upsert, fork, test, delete)grafana-agento11y-app.data:read + grafana-agento11y-app.eval:write for mutations and testsN/A
agento11y_manage_eval_rulesAgent Observability*Manage eval rules and guards (list, get, create, update, preview, delete)grafana-agento11y-app.data:read + grafana-agento11y-app.eval:write for mutations and previewsN/A
agento11y_manage_eval_collectionsAgent Observability*Manage saved conversations and the collections that group them (list, get, save, create, update, delete, add and remove members)grafana-agento11y-app.data:read + grafana-agento11y-app.eval:write for mutationsN/A
agento11y_manage_experimentsAgent Observability*Read offline experiments, their trials, scores, artifact metadata, and filter facets; update and cancel an experimentgrafana-agento11y-app.data:read + grafana-agento11y-app.eval:write for mutationsN/A
agento11y_manage_test_suitesAgent Observability*Manage the test suites that offline experiments run against, their versions, and their test cases (list, get, create, update, draft, publish, upsert, delete)grafana-agento11y-app.data:read + grafana-agento11y-app.eval:write for mutationsN/A
ask_assistantAssistant*Send a prompt to Grafana Assistant and return the full text reply (multi-turn via contextId)Plugin-specific permissionsPlugin-specific scopes
generate_deeplinkNavigationGenerate accurate deeplink URLs for Grafana resourcesNone (read-only URL generation)N/A
get_annotationsAnnotationsFetch annotations with filtersannotations:readannotations:* or annotations:id:123
create_annotationAnnotationsCreate a new annotation (standard or Graphite format)annotations:writeannotations:*
update_annotationAnnotationsUpdate specific fields of an annotation (partial update)annotations:writeannotations:*
delete_annotationAnnotationsDelete an annotation by IDannotations:deleteannotations:*
get_annotation_tagsAnnotationsList annotation tags with optional filteringannotations:readannotations:*
list_snapshotsSnapshotList dashboard snapshots with optional query and limit filtersdashboards:readdashboards:* or dashboards:uid:abc123
get_snapshotSnapshotGet snapshot metadata and dashboard payload by snapshot keydashboards:readdashboards:* or dashboards:uid:abc123
create_snapshotSnapshotCreate a dashboard snapshot from a full dashboard payloaddashboards:writedashboards:* or dashboards:uid:abc123
delete_snapshotSnapshotDelete a dashboard snapshot by snapshot keydashboards:writedashboards:* or dashboards:uid:abc123
get_panel_imageRenderingRender a stored dashboard or panel — or a provisioning preview from a repository branch — as a PNG imagedashboards:read

Instalação

TypingMind
Pré-requisitos:

Node.js 18+

{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": [
        "mcp-grafana"
      ],
      "env": {
        "GRAFANA_URL": "http://localhost:3000",
        "GRAFANA_API_KEY": "<your service account token>"
      }
    }
  }
}

Ferramentas disponíveis

  • add_activity_to_incident

    Add a note (userNote activity) to an existing incident's timeline using its ID. The note body can include URLs which will be attached as context. Use this to add context to an incident.

  • create_incident

    Create a new Grafana incident. Requires title, severity, and room prefix. Allows setting status and labels. This tool should be used judiciously and sparingly, and only after confirmation from the user, as it may notify or alarm lots of people.

  • fetch_pyroscope_profile

    Fetches a profile from a Pyroscope data source for a given time range. By default, the time range is tha past 1 hour. The profile type is required, available profile types can be fetched via the list_pyroscope_profile_types tool. Not all profile types are available for every service. Expect some queries to return empty result sets, this indicates the profile type does not exist for that query. In such a case, consider trying a related profile type or giving up. Matchers are not required, but highly recommended, they are generally used to select an application by the service_name label (e.g. {service_name="foo"}). Use the list_pyroscope_label_names tool to fetch available label names, and the list_pyroscope_label_values tool to fetch available label values. The returned profile is in DOT format.

  • find_error_pattern_logs

    Searches Loki logs for elevated error patterns compared to the last day's average, waits for the analysis to complete, and returns the results including any patterns found.

  • find_slow_requests

    Searches relevant Tempo datasources for slow requests, waits for the analysis to complete, and returns the results.

  • get_alert_rule_by_uid

    Retrieves the full configuration and detailed status of a specific Grafana alert rule identified by its unique ID (UID). The response includes fields like title, condition, query data, folder UID, rule group, state settings (no data, error), evaluation interval, annotations, and labels.

  • get_assertions

    Get assertion summary for a given entity with its type, name, env, site, namespace, and a time range

  • get_current_oncall_users

    Get the list of users currently on-call for a specific Grafana OnCall schedule ID. Returns the schedule ID, name, and a list of detailed user objects for those currently on call.

  • get_dashboard_by_uid

    Retrieves the complete dashboard, including panels, variables, and settings, for a specific dashboard identified by its UID.

  • get_dashboard_panel_queries

    Get the title, query string, and datasource information for each panel in a dashboard. The datasource is an object with fields uid (which may be a concrete UID or a template variable like "$datasource") and type. If the datasource UID is a template variable, it won't be usable directly for queries. Returns an array of objects, each representing a panel, with fields: title, query, and datasource (an object with uid and type).

  • get_datasource_by_name

    Retrieves detailed information about a specific datasource using its name. Returns the full datasource model, including UID, type, URL, access settings, JSON data, and secure JSON field status.

  • get_datasource_by_uid

    Retrieves detailed information about a specific datasource using its UID. Returns the full datasource model, including name, type, URL, access settings, JSON data, and secure JSON field status.

  • get_incident

    Get a single incident by ID. Returns the full incident details including title, status, severity, labels, timestamps, and other metadata.

  • get_oncall_shift

    Get detailed information for a specific Grafana OnCall shift using its ID. A shift represents a designated time period within a schedule when users are actively on-call. Returns the full shift details.

  • get_sift_analysis

    Retrieves a specific analysis from an investigation by its UUID. The investigation ID and analysis ID should be provided as strings in UUID format.

  • get_sift_investigation

    Retrieves an existing Sift investigation by its UUID. The ID should be provided as a string in UUID format (e.g. '02adab7c-bf5b-45f2-9459-d71a2c29e11b').

  • list_alert_rules

    Lists Grafana alert rules, returning a summary including UID, title, current state (e.g., 'pending', 'firing', 'inactive'), and labels. Supports filtering by labels using selectors and pagination. Example label selector: [{'name': 'severity', 'type': '=', 'value': 'critical'}]. Inactive state means the alert state is normal, not firing

  • list_contact_points

    Lists Grafana notification contact points, returning a summary including UID, name, and type for each. Supports filtering by name - exact match - and limiting the number of results.

  • list_datasources

    List available Grafana datasources. Optionally filter by datasource type (e.g., 'prometheus', 'loki'). Returns a summary list including ID, UID, name, type, and default status.

  • list_incidents

    List Grafana incidents. Allows filtering by status ('active', 'resolved') and optionally including drill incidents. Returns a preview list with basic details.

  • list_loki_label_names

    Lists all available label names (keys) found in logs within a specified Loki datasource and time range. Returns a list of unique label strings (e.g., ["app", "env", "pod"]). If the time range is not provided, it defaults to the last hour.

  • list_loki_label_values

    Retrieves all unique values associated with a specific labelName within a Loki datasource and time range. Returns a list of string values (e.g., for labelName="env", might return ["prod", "staging", "dev"]). Useful for discovering filter options. Defaults to the last hour if the time range is omitted.

  • list_oncall_schedules

    List Grafana OnCall schedules, optionally filtering by team ID. If a specific schedule ID is provided, retrieves details for only that schedule. Returns a list of schedule summaries including ID, name, team ID, timezone, and shift IDs. Supports pagination.

  • list_oncall_teams

    List teams configured in Grafana OnCall. Returns a list of team objects with their details. Supports pagination.

  • list_oncall_users

    List users from Grafana OnCall. Can retrieve all users, a specific user by ID, or filter by username. Returns a list of user objects with their details. Supports pagination.

  • list_prometheus_label_names

    List label names in a Prometheus datasource. Allows filtering by series selectors and time range.

  • list_prometheus_label_values

    Get the values for a specific label name in Prometheus. Allows filtering by series selectors and time range.

  • list_prometheus_metric_metadata

    List Prometheus metric metadata. Returns metadata about metrics currently scraped from targets. Note: This endpoint is experimental.

  • list_prometheus_metric_names

    List metric names in a Prometheus datasource. Retrieves all metric names and then filters them locally using the provided regex. Supports pagination.

  • list_pyroscope_label_names

    Lists all available label names (keys) found in profiles within a specified Pyroscope datasource, time range, and optional label matchers. Label matchers are typically used to qualify a service name ({service_name="foo"}). Returns a list of unique label strings (e.g., ["app", "env", "pod"]). Label names with double underscores (e.g. name) are internal and rarely useful to users. If the time range is not provided, it defaults to the last hour.

  • list_pyroscope_label_values

    Lists all available label values for a particular label name found in profiles within a specified Pyroscope datasource, time range, and optional label matchers. Label matchers are typically used to qualify a service name ({service_name="foo"}). Returns a list of unique label strings (e.g. for label name "env": ["dev", "staging", "prod"]). If the time range is not provided, it defaults to the last hour.

  • list_pyroscope_profile_types

    Lists all available profile types available in a specified Pyroscope datasource and time range. Returns a list of all available profile types (example profile type: "process_cpu:cpu:nanoseconds:cpu:nanoseconds"). A profile type has the following structure: ::::. Not all profile types are available for every service. If the time range is not provided, it defaults to the last hour.

  • list_sift_investigations

    Retrieves a list of Sift investigations with an optional limit. If no limit is specified, defaults to 10 investigations.

  • list_teams

    Search for Grafana teams by a query string. Returns a list of matching teams with details like name, ID, and URL.

  • list_users_by_org

    List users by organization. Returns a list of users with details like userid, email, role etc.

  • query_loki_logs

    Executes a LogQL query against a Loki datasource to retrieve log entries or metric values. Returns a list of results, each containing a timestamp, labels, and either a log line (line) or a numeric metric value (value). Defaults to the last hour, a limit of 10 entries, and 'backward' direction (newest first). Supports full LogQL syntax for log and metric queries (e.g., {app="foo"} |= "error", rate({app="bar"}[1m])). Prefer using query_loki_stats first to check stream size and list_loki_label_names and list_loki_label_values to verify labels exist.

  • query_loki_stats

    Retrieves statistics about log streams matching a given LogQL selector within a Loki datasource and time range. Returns an object containing the count of streams, chunks, entries, and total bytes (e.g., {"streams": 5, "chunks": 50, "entries": 10000, "bytes": 512000}). The logql parameter must be a simple label selector (e.g., {app="nginx", env="prod"}) and does not support line filters, parsers, or aggregations. Defaults to the last hour if the time range is omitted.

  • query_prometheus

    Query Prometheus using a PromQL expression. Supports both instant queries (at a single point in time) and range queries (over a time range). Time can be specified either in RFC3339 format or as relative time expressions like 'now', 'now-1h', 'now-30m', etc.

  • search_dashboards

    Search for Grafana dashboards by a query string. Returns a list of matching dashboards with details like title, UID, folder, tags, and URL.

  • update_dashboard

    Create or update a dashboard

Use o MCP de Grafana com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar Grafana, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione Grafana como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de Grafana.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "grafana": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-grafana"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de Grafana, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de Grafana.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar Grafana para me ajudar nesta tarefa?
Grafana
Claro. Já li.
Veja o que encontrei usando Grafana.

Perguntas frequentes

Para que serve o servidor MCP Grafana?

Grafana é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP Grafana com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar Grafana com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP Grafana com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com Grafana conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP Grafana ao TypingMind?

Grafana funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP Grafana oferece no TypingMind?

Grafana disponibiliza 40 ferramentas MCP que podem ser ativadas na página Plugins do TypingMind e usadas no chat ou atribuídas a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP Grafana?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se Grafana exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇