Skip to content
Back to search

mcp-grafana

MCP server for Grafana

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026. Its scripts were only partly scanned.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/grafana/mcp-grafana with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/grafana/mcp-grafana'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/grafana--mcp-grafana/badge.svg)](/listings/grafana--mcp-grafana)

HTML

<a href="/listings/grafana--mcp-grafana"><img src="/api/listings/grafana--mcp-grafana/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Requires [uv](https://docs.astral.sh/uv/getting-started/installation/). Add the following to your MCP client configuration (e.g. Claude Desktop, Cursor):

{
  "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](#usage) for more installation options including Docker, binary, and Helm.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/plugin.json · Manifest · 17 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. {
  2. "name": "grafana",
  3. "version": "0.7.6",
  4. "description": "A Model Context Protocol (MCP) server for Grafana providing access to dashboards, datasources, and querying capabilities",
  5. "author": {
  6. "name": "Grafana Labs"
  7. },
  8. "homepage": "https://github.com/grafana/mcp-grafana",
  9. "repository": "https://github.com/grafana/mcp-grafana",
  10. "license": "Apache-2.0",
  11. "mcpServers": {
  12. "grafana": {
  13. "command": "node",
  14. "args": ["${CLAUDE_PLUGIN_ROOT}/.claude-plugin/install-binary.mjs"]
  15. }
  16. }
  17. }
README.md · README · 1,678 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Grafana MCP server
  2. [![Unit Tests](https://github.com/grafana/mcp-grafana/actions/workflows/unit.yml/badge.svg)](https://github.com/grafana/mcp-grafana/actions/workflows/unit.yml)
  3. [![Integration Tests](https://github.com/grafana/mcp-grafana/actions/workflows/integration.yml/badge.svg)](https://github.com/grafana/mcp-grafana/actions/workflows/integration.yml)
  4. [![E2E Tests](https://github.com/grafana/mcp-grafana/actions/workflows/e2e.yml/badge.svg)](https://github.com/grafana/mcp-grafana/actions/workflows/e2e.yml)
  5. [![Go Reference](https://pkg.go.dev/badge/github.com/grafana/mcp-grafana.svg)](https://pkg.go.dev/github.com/grafana/mcp-grafana)
  6. [![MCP Catalog](https://archestra.ai/mcp-catalog/api/badge/quality/grafana/mcp-grafana)](https://archestra.ai/mcp-catalog/grafana__mcp-grafana)
  7. A [Model Context Protocol][mcp] (MCP) server for Grafana.
  8. This provides access to your Grafana instance and the surrounding ecosystem.
  9. ## Quick Start
  10. Requires [uv](https://docs.astral.sh/uv/getting-started/installation/). Add the following to your MCP client configuration (e.g. Claude Desktop, Cursor):
  11. ```json
  12. {
  13. "mcpServers": {
  14. "grafana": {
  15. "command": "uvx",
  16. "args": ["mcp-grafana"],
  17. "env": {
  18. "GRAFANA_URL": "http://localhost:3000",
  19. "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your service account token>"
  20. }
  21. }
  22. }
  23. }
  24. ```
  25. For Grafana Cloud, replace `GRAFANA_URL` with your instance URL (e.g. `https://myinstance.grafana.net`). See [Usage](#usage) for more installation options including Docker, binary, and Helm.
  26. ## Requirements
  27. - **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.
  28. ## Features
  29. _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._
  30. ### Dashboards
  31. - **Search for dashboards:** Find dashboards by title, folder UID, tag, or starred status
  32. - **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._
  33. - **List dashboard versions:** List saved versions of a dashboard as compact metadata (version number, author, timestamp, save message)
  34. - **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
  35. - **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
  36. - **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._
  37. - **Patch dashboard:** Apply specific changes to a dashboard without requiring the full JSON, significantly reducing context window usage for targeted modifications
  38. - **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
  39. ### Run Panel Query
  40. > **Note:** Run panel query tools are **disabled by default**. To enable them, add `runpanelquery` to your `--enabled-tools` flag.
  41. - **Run panel query:** Execute a dashboard panel's query with custom time ranges and variable overrides. Infinity panels run when the query uses the `backend` or `jq-backend` parser (Google Sheets queries always do); the default `simple` parser and the UQL and GROQ parsers work only in the browser. Neo4j panels on the `kniepdennis-neo4j-datasource` plugin run their Cypher query through the plugin, which opens read-only sessions. Elasticsearch panels interpolate variables in the Lucene query with the `lucene` format, as Grafana does, and auto date histograms use the same interval as `$__interval`.
  42. #### Context Window Management
  43. The dashboard tools now include several strategies to manage context window usage effectively ([issue #101](https://github.com/grafana/mcp-grafana/issues/101)):
  44. - **Use `get_dashboard_summary`** for dashboard overview and planning modifications
  45. - **Use `get_dashboard_property`** with JSONPath when you only need specific dashboard parts
  46. - **Avoid `get_dashboard_by_uid`** unless you specifically need the complete dashboard JSON
  47. ### Datasources
  48. - **List and fetch datasource information:** View all configured datasources and retrieve detailed information about each.
  49. - _Supported datasource types: Prometheus, Loki, ClickHouse, CloudWatch, Elasticsearch, OpenSearch, Snowflake, Athena._
  50. - **Datasource resources:** Each datasource you can access is also exposed as an MCP resource at `grafana://datasources/{uid}`, so you can attach one to a conversation directly (for example with `@` in Claude Code) instead of the model looking it up. Disabled along with the datasource tools.
  51. ### Query Examples
  52. > **Note:** Query examples tools are **disabled by default**. To enable them, add `examples` to your `--enabled-tools` flag.
  53. - **Get query examples:** Retrieve example queries for different datasource types to learn query syntax.
  54. ### Prometheus Querying
  55. - **Query Prometheus:** Execute PromQL queries (supports both instant and range metric queries) against Prometheus datasources.
  56. - **Query Prometheus metadata:** Retrieve metric metadata, metric names, label names, and label values from Prometheus datasources.
  57. - **Query histogram percentiles:** Calculate histogram percentile values (p50, p90, p95, p99) using histogram_quantile.
  58. ### Loki Querying
  59. - **Query Loki logs and metrics:** Run both log queries and metric queries using LogQL against Loki datasources.
  60. - **Query Loki metadata:** Retrieve label names, label values, and stream statistics from Loki datasources.
  61. - **Query Loki patterns:** Retrieve log patterns detected by Loki to identify common log structures and anomalies.
  62. ### InfluxDB Querying
  63. > **Note:** InfluxDB tools are **disabled by default**. To enable them, add `influxdb` to your `--enabled-tools` flag.
  64. - **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.
  65. ### SQL Datasource Querying
  66. > **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.
  67. Unified SQL tools support **ClickHouse, Snowflake, Athena, MySQL, PostgreSQL, MSSQL, and BigQuery** 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.
  68. - **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.
  69. - **List tables:** List tables in a database or schema with metadata (row counts, sizes where available).
  70. - **Describe table schema:** Get column names, types, nullability, defaults, and comments.
  71. - **Query SQL:** Execute SQL queries with datasource-specific macro substitution (`$__timeFilter(col)`, `$__from/$__to`, `$__interval`, `${varname}`), automatic limit enforcement, and template variable support.
  72. For **BigQuery**, configure the `grafana-bigquery-datasource` plugin in Grafana. Discovery uses `database` for the project and `schema` for the dataset. If `database` is omitted, the project defaults to datasource `defaultProject`, then the plugin's `/defaultProjects` endpoint (including GCE project discovery). Metadata is fetched through APIs only, without query jobs or table scans. Column descriptions and nested types are included; the plugin omits table descriptions/types, column nullability, and defaults.
  73. BigQuery queries require qualified table references such as `` `my-project.my_dataset.fct_events` `` and use the datasource's billing project. Optional `location` defaults to datasource `processingLocation`. Use `${name:sqlstring}` for escaped string variables. Row limits do not limit bytes scanned or query costs.
  74. ### CloudWatch Querying
  75. > **Note:** CloudWatch tools are **disabled by default**. To enable them, add `cloudwatch` to your `--enabled-tools` flag.
  76. - **List CloudWatch namespaces:** Discover available AWS CloudWatch namespaces.
  77. - **List CloudWatch metrics:** List metrics available in a specific namespace.
  78. - **List CloudWatch dimensions:** Get dimensions for filtering metric queries.
  79. - **Query CloudWatch:** Execute CloudWatch metric queries with time range support.
  80. - **List CloudWatch log groups:** Discover log groups, optionally filtered by name prefix.
  81. - **List CloudWatch log group fields:** Discover the fields available in a log group.
  82. - **Query CloudWatch Logs:** Run CloudWatch Logs Insights queries across one or more log groups.
  83. ### Google Cloud Logging Querying
  84. > **Note:** Google Cloud Logging tools are **disabled by default**. To enable them, add `cloudlogging` to your `--enabled-tools` flag. Requires the [Google Cloud Logging datasource plugin](https://grafana.com/grafana/plugins/googlecloud-logging-datasource/) (`googlecloud-logging-datasource`) version 1.8.0 or later, which needs Grafana 11.2+. Older plugin versions return a different response layout and `query_cloud_logging` reports an error asking for an upgrade.
  85. - **List Cloud Logging projects:** Discover the GCP project IDs the datasource can read logs from.
  86. - **List Cloud Logging buckets and views:** Discover log buckets and log views to scope a query.
  87. - **Query Cloud Logging:** Run Cloud Logging query language filters (e.g. `resource.type="k8s_container" AND severity>=ERROR`) with time range and limit; returns entries newest-first with severity, body, labels, and trace ID. GCP authentication is handled by the datasource configuration.
  88. ### Azure Monitor Querying
  89. > **Note:** Azure Monitor tools are **disabled by default**. To enable them, add `azuremonitor` to your `--enabled-tools` flag. They query through an Azure Monitor datasource (`grafana-azure-monitor-datasource`); Azure authentication is handled by the datasource configuration.
  90. - **Query Azure Log Analytics:** Run KQL against one or more Log Analytics workspaces or resources with time range and limit; returns columns and rows.
  91. - **Query Azure Resource Graph:** Run Resource Graph KQL to inventory Azure resources and their current state across subscriptions.
  92. ### Graphite Querying
  93. > **Note:** Graphite tools are **disabled by default**. To enable them, add `graphite` to your `--enabled-tools` flag.
  94. - **Query Graphite:** Execute Graphite render API queries against a Graphite datasource.
  95. - **List Graphite metrics:** Browse and discover Graphite metric paths.
  96. - **List Graphite tags:** List available Graphite tags and tag values.
  97. - **Query Graphite density:** Query Graphite metric density for a given pattern.
  98. ### Elasticsearch/OpenSearch Querying
  99. > **Note:** Elasticsearch/OpenSearch tools are **disabled by default**. To enable them, add `elasticsearch` to your `--enabled-tools` flag.
  100. - **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.
  101. ### Quickwit Querying
  102. > **Note:** Quickwit tools are **disabled by default**. To enable them, add `quickwit` to your `--enabled-tools` flag.
  103. - **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.
  104. ### Agent Observability
  105. > **Note:** Agent Observability tools are **disabled by default** and work only in Grafana Cloud. To enable them, add `agento11y` to your `--enabled-tools` flag.
  106. - **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.
  107. - **Get conversation detail:** Fetch a single conversation with all its generations, including prompts and outputs.
  108. - **Get generation detail and scores:** Fetch a single generation by ID, and its evaluation scores (evaluator, score key, value, passed, explanation).
  109. - **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.
  110. - **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.
  111. - **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.
  112. - **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.
  113. - **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`.
  114. - **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.
  115. ### Grafana Assistant
  116. > **Note:** Assistant tools are **disabled by default** and require the [Grafana Assistant](https://grafana.com/docs/grafana-cloud/machine-learning/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.
  117. - **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).
  118. ### Incidents
  119. - **Search, create, and update incidents:** Manage incidents in Grafana Incident, including searching, creating, adding activities, and reading or setting custom fields.
  120. - **Incident resources:** Active incidents that started in the last 30 days are also exposed as MCP resources at `grafana://irm/incidents/{id}`, so you can attach one to a conversation directly (for example with `@` in Claude Code). Disabled along with the incident tools.
  121. ### Alerting
  122. - **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.
  123. - **Create and update alert rules:** Create new alert rules or modify existing ones.
  124. - **Delete alert rules:** Remove alert rules by UID.
  125. - **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).
  126. ### Grafana OnCall
  127. - **List and manage schedules:** View and manage on-call schedules in Grafana OnCall.
  128. - **Get shift details:** Retrieve detailed information about specific on-call shifts.
  129. - **Get current on-call users:** See which users are currently on call for a schedule.
  130. - **List teams and users:** View all OnCall teams and users.
  131. - **List alert groups:** View and filter alert groups from Grafana OnCall by various criteria including state, integration, labels, and time range.
  132. - **Get alert group details:** Retrieve detailed information about a specific alert group by its ID.
  133. ### Admin
  134. > **Note:** Admin tools are **disabled by default**. To enable them, include `admin` in your `--enabled-tools` flag.
  135. - **List teams:** View all configured teams in Grafana.
  136. - **List Users:** View all users in an organization in Grafana.
  137. - **List all roles:** List all Grafana roles, with an optional filter for delegatable roles.
  138. - **Get role details:** Get details for a specific Grafana role by UID.
  139. - **List assignments for a role:** List all users, teams, and service accounts assigned to a role.
  140. - **List roles for users:** List all roles assigned to one or more users.
  141. - **List roles for teams:** List all roles assigned to one or more teams.
  142. - **List permissions for a resource:** List all permissions defined for a specific resource (dashboard, datasource, folder, etc.).
  143. - **Describe a Grafana resource:** List available permissions and assignment capabilities for a resource type.
  144. ### User
  145. - **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](#multi-organization-support) requests.
  146. ### Navigation
  147. - **Generate deeplinks:** Create accurate deeplink URLs for Grafana resources instead of relying on LLM URL guessing.
  148. - **Dashboard links:** Generate direct links to dashboards using their UID (e.g., `http://localhost:3000/d/dashboard-uid`)
  149. - **Panel links:** Create links to specific panels within dashboards with viewPanel parameter (e.g., `http://localhost:3000/d/dashboard-uid?viewPanel=5`)
  150. - **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.
  151. - **Time range support:** Add time range parameters to links (`from=now-1h&to=now`)
  152. - **Custom parameters:** Include additional query parameters like dashboard variables or refresh intervals
  153. ### Annotations
  154. - **Get Annotations:** Query annotations with filters. Supports time range, dashboard UID, tags, and match mode.
  155. - **Create Annotation:** Create a new annotation on a dashboard or panel.
  156. - **Create Graphite Annotation:** Create annotations using Graphite format (`what`, `when`, `tags`, `data`).
  157. - **Update Annotation:** Replace all fields of an existing annotation (full update).
  158. - **Patch Annotation:** Update only specific fields of an annotation (partial update).
  159. - **Delete Annotation:** Permanently delete an annotation by ID.
  160. - **Get Annotation Tags:** List available annotation tags with optional filtering.
  161. ### Snapshots
  162. - **List snapshots:** List dashboard snapshots with optional query and limit filters.
  163. - **Get snapshot:** Retrieve snapshot metadata and dashboard payload by snapshot key.
  164. - **Create snapshot:** Create a dashboard snapshot from a full dashboard payload, with optional expiration and external snapshot options.
  165. - **Delete snapshot:** Delete a snapshot by snapshot key.
  166. ### Rendering
  167. - **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. Defaults to 1000×750 CSS pixels for a panel or 1200×900 for a full dashboard, both at scale 1. Explore defaults to 1000×1000 at scale 1. Dimensions are subject to the image renderer's viewport limits. 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.
  168. - _Note: Requires the [Grafana Image Renderer](https://grafana.com/docs/grafana/latest/setup-grafana/image-rendering/) service to be installed and configured._
  169. ### Provisioning
  170. - **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.
  171. - **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.
  172. The list of tools is configurable, so you can choose which tools you want to make available to the MCP client.
  173. 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.
  174. To disable a category of tools, use the `--disable-<category>` flag when starting the server. For example, to disable
  175. the OnCall tools, use `--disable-oncall`, or to disable navigation deeplink generation, use `--disable-navigation`.
  176. #### RBAC Permissions
  177. 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.
  178. 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.
  179. **Note:** OnCall and other plugin-backed tools are authorized by plugin actions such as `grafana-irm-app.schedules:read`. The basic Viewer role includes the read actions and Editor the write actions. Incident tools need only `plugins.app:access`; IRM authorizes incident actions by basic role.
  180. Actions in `group/resource:verb` form, such as `dashboard.grafana.app/dashboards:get`, apply only to on-behalf-of access tokens. A service account needs only the other actions listed.
  181. For more information about Grafana RBAC, see the [official documentation](https://grafana.com/docs/grafana/latest/administration/roles-and-permissions/access-control/).
  182. #### RBAC Scopes
  183. Scopes define the specific resources that permissions apply to. Each action requires both the appropriate permission and scope combination.
  184. **Common Scope Patterns:**
  185. - **Broad access:** Use `*` wildcards for organization-wide access
  186. - `datasources:*` - Access to all datasources
  187. - `dashboards:*` - Access to all dashboards
  188. - `folders:*` - Access to all folders
  189. - `teams:*` - Access to all teams
  190. - **Limited access:** Use specific UIDs or IDs to restrict access to individual resources
  191. - `datasources:uid:prometheus-uid` - Access only to a specific Prometheus datasource
  192. - `dashboards:uid:abc123` - Access only to dashboard with UID `abc123`
  193. - `folders:uid:xyz789` - Access only to folder with UID `xyz789`
  194. - `teams:id:5` - Access only to team with ID `5`
  195. - `global.users:id:123` - Access only to user with ID `123`
  196. **Examples:**
  197. - **Full MCP server access:** Grant broad permissions for all tools
  198. ```
  199. datasources:* (datasources:read, datasources:query)
  200. dashboards:* (dashboards:read, dashboards:create, dashboards:write)
  201. folders:* (for dashboard creation and alert rules)
  202. teams:* (teams:read)
  203. global.users:* (users:read)
  204. ```
  205. - **Limited datasource access:** Only query specific Prometheus and Loki instances
  206. ```
  207. datasources:uid:prometheus-prod (datasources:query)
  208. datasources:uid:loki-prod (datasources:query)
  209. ```
  210. - **Dashboard-specific access:** Read only specific dashboards
  211. ```
  212. dashboards:uid:monitoring-dashboard (dashboards:read)
  213. dashboards:uid:alerts-dashboard (dashboards:read)
  214. ```
  215. ### Tools
  216. | Tool | Category | Description | Required RBAC Permissions | Required Scopes |
  217. | ----------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
  218. | `list_teams` | Admin* | List all teams | `teams:read` | `teams:*` or `teams:id:1` |
  219. | `list_users_by_org` | Admin* | List users in an organization, with search and pagination | `org.users:read` | `global.users:*` or `global.users:id:123` |
  220. | `list_all_roles` | Admin* | List all Grafana roles | `roles:read` | `roles:*` |
  221. | `get_role_details` | Admin* | Get details for a Grafana role | `roles:read` | `roles:uid:editor` |
  222. | `get_role_assignments` | Admin* | List assignments for a role | `roles:read`, `teams.roles:read`, `users.roles:read` | `roles:uid:editor` |
  223. | `list_user_roles` | Admin* | List roles for users | `users.roles:read` | `global.users:id:123` |
  224. | `list_team_roles` | Admin* | List roles for teams | `teams.roles:read` | `teams:id:7` |
  225. | `get_resource_permissions` | Admin* | List permissions for a resource | `dashboards.permissions:read`, `datasources.permissions:read`, `folders.permissions:read`, `serviceaccounts.permissions:read`, `teams.permissions:read`, `users.permissions:read` | `dashboards:uid:abcd1234` |
  226. | `get_resource_description` | Admin* | Describe a Grafana resource type | `dashboards.permissions:read`, `datasources.permissions:read`, `folders.permissions:read`, `serviceaccounts.permissions:read`, `teams.permissions:read`, `users.permissions:read` | `dashboards:*` |
  227. | `user_info` | User | Current identity, capabilities, and accessible organizations | None | — |
  228. | `search_dashboards` | Search | Search for dashboards by query, folder UID, folder path, tag, or starred | `dashboards:read`, `folders:read` | `dashboards:*` or `dashboards:uid:abc123` |
  229. | `search_folders` | Search | Search for folders by title | `folders:read` | `folders:*` or `folders:uid:xyz789` |
  230. | `get_dashboard_by_uid` | Dashboard | Get a dashboard by uid, optionally a saved version | `dashboard.grafana.app/dashboards:get`, `dashboards:read`, `dashboards:write` | `dashboards:uid:abc123` |
  231. | `list_dashboard_versions` | Dashboard | List saved versions of a dashboard (version, author, time, message) | `dashboards:read`, `dashboards:write` | `dashboards:uid:abc123` |
  232. | `update_dashboard` | Dashboard | Update or create a new dashboard | `dashboard.grafana.app/dashboards:create`, `dashboard.grafana.app/dashboards:get`, `dashboard.grafana.app/dashboards:update`, `dashboards:create`, `dashboards:read`, `dashboards:write`, `folders:read` | `dashboards:*`, `folders:*` or `folders:uid:xyz789` |
  233. | `get_dashboard_panel_queries` | Dashboard | Get panel title, queries, datasource UID and type from a dashboard | `dashboard.grafana.app/dashboards:get`, `dashboards:read`, `library.panels:read` | `dashboards:uid:abc123` |
  234. | `run_panel_query` | RunPanelQuery* | Execute one or more dashboard panel queries | `dashboard.grafana.app/dashboards:get`, `dashboards:read`, `datasources:query`, `datasources:read`, `library.panels:read` | `dashboards:uid:*`, `datasources:uid:*` |
  235. | `get_dashboard_property` | Dashboard | Extract specific parts of a dashboard using JSONPath expressions | `dashboard.grafana.app/dashboards:get`, `dashboards:read` | `dashboards:uid:abc123` |
  236. | `get_dashboard_summary` | Dashboard | Get a compact summary of a dashboard without full JSON | `dashboard.grafana.app/dashboards:get`, `dashboards:read` | `dashboards:uid:abc123` |
  237. | `create_folder` | Dashboard | Create a folder | `folders:create`, `folders:read`, `folders:write` | `folders:*` |
  238. | `list_datasources` | Datasources | List datasources | `datasources:read` | `datasources:*` |
  239. | `get_datasource` | Datasources | Get a datasource by UID or name | `datasources:read` | `datasources:uid:prometheus-uid` |
  240. | `check_datasources_health` | Datasources | Check the health of one or more datasources | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  241. | `create_datasource` | Datasources | Create a datasource | `datasources:create`, `datasources:read` | `datasources:*` |
  242. | `update_datasource` | Datasources | Update a datasource | `datasources:read`, `datasources:write` | `datasources:*` or `datasources:uid:abc123` |
  243. | `get_query_examples` | Examples* | Get example queries for a datasource type | None | `datasources:*` |
  244. | `query_prometheus` | Prometheus | Query metrics using PromQL without opening a chart | `datasources:query`, `datasources:read` | `datasources:uid:prometheus-uid` |
  245. | `render_grafana_app` | Rendering | Run an enabled query tool and display its result in the interactive Grafana App | `datasources:query`, `datasources:read` | `datasources:*` or `datasources:uid:<uid>` |
  246. | `list_prometheus_metric_metadata` | Prometheus | List metric metadata | `datasources:query`, `datasources:read` | `datasources:uid:prometheus-uid` |
  247. | `list_prometheus_metric_names` | Prometheus | List available metric names | `datasources:query`, `datasources:read` | `datasources:uid:prometheus-uid` |
  248. | `list_prometheus_label_names` | Prometheus | List label names matching a selector | `datasources:query`, `datasources:read` | `datasources:uid:prometheus-uid` |
  249. | `list_prometheus_label_values` | Prometheus | List values for a specific label | `datasources:query`, `datasources:read` | `datasources:uid:prometheus-uid` |
  250. | `query_prometheus_histogram` | Prometheus | Calculate histogram percentile values | `datasources:query`, `datasources:read` | `datasources:uid:prometheus-uid` |
  251. | `list_incidents` | Incident | List incidents in Grafana Incident, optionally with their custom field values | `plugins.app:access` | N/A |
  252. | `create_incident` | Incident | Create an incident in Grafana Incident, optionally setting custom fields | `plugins.app:access` | N/A |
  253. | `add_activity_to_incident` | Incident | Add an activity item to an incident in Grafana Incident | `plugins.app:access` | N/A |
  254. | `update_incident` | Incident | Update an incident in Grafana Incident (status, severity, title, or custom fields) | `plugins.app:access` | N/A |
  255. | `get_incident` | Incident | Get a single incident by ID, including its custom fields | `plugins.app:access` | N/A |
  256. | `list_incident_custom_fields` | Incident | List the custom fields configured for incidents, with their types and select options | `plugins.app:access` | N/A |
  257. | `query_loki_logs` | Loki | Query and retrieve logs using LogQL (either log or metric queries) | `datasources:query`, `datasources:read` | `datasources:uid:loki-uid` |
  258. | `list_loki_label_names` | Loki | List all available label names in logs | `datasources:query`, `datasources:read` | `datasources:uid:loki-uid` |
  259. | `list_loki_label_values` | Loki | List values for a specific log label | `datasources:query`, `datasources:read` | `datasources:uid:loki-uid` |
  260. | `query_loki_stats` | Loki | Get statistics about log streams | `datasources:query`, `datasources:read` | `datasources:uid:loki-uid` |
  261. | `query_loki_patterns` | Loki | Query detected log patterns to identify common structures | `datasources:query`, `datasources:read` | `datasources:uid:loki-uid` |
  262. | `analyze_loki_labels` | Loki | Audit a Loki label strategy (live or static) and optionally diagnose query performance | `datasources:query`, `datasources:read` | `datasources:uid:loki-uid` |
  263. | `suggest_loki_alloy_label_config` | Config | Generate an Alloy `loki.process` snippet enforcing approved labels | None | N/A |
  264. | `query_influxdb` | InfluxDB* | Query InfluxDB using InfluxQL (v1) or Flux (v2) | `datasources:query`, `datasources:read` | `datasources:uid:influxdb-uid` |
  265. | `list_sql_databases` | SQL* | List databases, schemas, or catalogs from a SQL datasource | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  266. | `list_sql_tables` | SQL* | List tables in a SQL datasource | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  267. | `describe_sql_table` | SQL* | Get column schema for a table | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  268. | `query_sql` | SQL* | Execute SQL queries with macro substitution | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  269. | `list_cloudwatch_namespaces` | CloudWatch* | List available AWS CloudWatch namespaces | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  270. | `list_cloudwatch_metrics` | CloudWatch* | List metrics in a namespace | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  271. | `list_cloudwatch_dimensions` | CloudWatch* | List dimensions for a metric | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  272. | `list_cloudwatch_dimension_values` | CloudWatch* | List values for a dimension key | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  273. | `query_cloudwatch` | CloudWatch* | Execute CloudWatch metric queries | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  274. | `list_cloudwatch_log_groups` | CloudWatch* | List CloudWatch log groups | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  275. | `list_cloudwatch_log_group_fields` | CloudWatch* | List fields discovered in a log group | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  276. | `query_cloudwatch_logs` | CloudWatch* | Execute CloudWatch Logs Insights queries | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  277. | `list_cloud_logging_projects` | Cloud Logging* | List GCP projects readable by a Google Cloud Logging datasource | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  278. | `list_cloud_logging_buckets` | Cloud Logging* | List log buckets in a GCP project | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  279. | `list_cloud_logging_views` | Cloud Logging* | List log views in a log bucket | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  280. | `query_cloud_logging` | Cloud Logging* | Query logs with the Cloud Logging query language | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  281. | `query_azure_log_analytics` | Azure Monitor* | Query Azure Log Analytics workspaces with KQL | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  282. | `query_azure_resource_graph` | Azure Monitor* | Query Azure Resource Graph with KQL | `datasources:query`, `datasources:read` | `datasources:uid:*` |
  283. | `query_elasticsearch` | Elasticsearch/OpenSearch* | Query Elasticsearch or OpenSearch using Lucene syntax or Query DSL | `datasources:query`, `datasources:read` | `datasources:uid:datasource-uid` |
  284. | `query_quickwit` | Quickwit* | Query Quickwit using Lucene syntax or Query DSL | `datasources:query`, `datasources:read` | `datasources:uid:quickwit-uid` |
  285. | `alerting_rules_read` | Alerting | List and inspect alert rules (list, get, versions) | `alert.rules.external:read`, `alert.rules:read`, `datasources:read`, `folders:read` | `folders:*` or `folders:uid:alerts-folder` |
  286. | `alerting_rules_write` | Alerting | Create, update and delete Grafana-managed rules, or explicitly create datasource-managed rules | `alert.provisioning.provenance:write`, `alert.rules.external:read`, `alert.rules.external:write`, `alert.rules:create`, `alert.rules:delete`, `alert.rules:read`, `alert.rules:write`, `datasources:read`, `folders:read` | `folders:*`, or `datasources:uid:<uid>` for external creation |
  287. | `alerting_manage_routing` | Alerting | Manage notification policies, contact points, and time intervals | `alert.notifications.external:read`, `alert.notifications.receivers:read`, `alert.notifications.routes:read`, `alert.notifications.time-intervals:read`, `alert.notifications:read`, `datasources:query`, `datasources:read`, `notifications.alerting.grafana.app/routingtrees:get` | Global scope |
  288. | `alerting_routing_write` | Alerting | Create Grafana-managed contact points by default, or explicitly create external Alertmanager receivers | `alert.notifications.external:read`, `alert.notifications.external:write`, `alert.notifications.receivers:create`, `alert.provisioning.provenance:write`, `datasources:read` | Global, or `datasources:uid:<uid>` for external creation |
  289. | `alerting_silences_read` | Alerting | List and inspect alerting silences (list, get) | `alert.instances:read`, `alert.silences:read` | Global scope |
  290. | `alerting_silences_write` | Alerting | Create, update, and expire alerting silences | `alert.instances:create`, `alert.instances:read`, `alert.instances:write`, `alert.silences:create`, `alert.silences:read`, `alert.silences:write` | Global scope |
  291. | `list_oncall_schedules` | OnCall | List schedules from Grafana OnCall | `grafana-irm-app.schedules:read`, `plugins.app:access` | Plugin-specific scopes |
  292. | `get_oncall_shift` | OnCall | Get details for a specific OnCall shift | `grafana-irm-app.schedules:read`, `plugins.app:access` | Plugin-specific scopes |
  293. | `get_current_oncall_users` | OnCall | Get users currently on-call for a specific schedule | `grafana-irm-app.schedules:read`, `grafana-irm-app.user-settings:read`, `plugins.app:access` | Plugin-specific scopes |
  294. | `list_oncall_teams` | OnCall | List teams from Grafana OnCall | `grafana-irm-app.user-settings:read`, `plugins.app:access` | Plugin-specific scopes |
  295. | `list_oncall_users` | OnCall | List users from Grafana OnCall | `grafana-irm-app.user-settings:read`, `plugins.app:access` | Plugin-specific scopes |
  296. | `list_alert_groups` | OnCall | List alert groups from Grafana OnCall with filtering options | `grafana-irm-app.alert-groups:read`, `plugins.app:access` | Plugin-specific scopes |
  297. | `get_alert_group` | OnCall | Get a specific alert group from Grafana OnCall by its ID | `grafana-irm-app.alert-groups:read`, `plugins.app:access` | Plugin-specific scopes |
  298. | `update_alert_group` | OnCall | Acknowledge, unacknowledge, resolve, or unresolve an alert group | `grafana-irm-app.alert-groups:read`, `grafana-irm-app.alert-groups:write`, `plugins.app:access` | Plugin-specific scopes |
  299. | `list_pyroscope_label_names` | Pyroscope | List label names matching a selector | `datasources:query`, `datasources:read` | `datasources:uid:pyroscope-uid` |
  300. | `list_pyroscope_label_values` | Pyroscope | List label values matching a selector for a label name | `datasources:query`, `datasources:read` | `datasources:uid:pyroscope-uid` |
  301. | `list_pyroscope_profile_types` | Pyroscope | List available profile types | `datasources:query`, `datasources:read` | `datasources:uid:pyroscope-uid` |
  302. | `query_pyroscope` | Pyroscope | Query profiles, metrics, or both from Pyroscope | `datasources:query`, `datasources:read` | `datasources:uid:pyroscope-uid` |
  303. | `get_assertions` | Asserts | Get assertion summary for a given entity | `plugins.app:access` | Plugin-specific scopes |
  304. | `agento11y_manage_conversations` | Agent Observability* | List, search, and fetch LLM conversations from Grafana Agent Observability | `grafana-agento11y-app.conversations:read`, `grafana-agento11y-app.data:read`, `plugins.app:access` | N/A |
  305. | `agento11y_manage_generations` | Agent Observability* | Fetch LLM generation details and evaluation scores from Grafana Agent Observability | `grafana-agento11y-app.conversations:read`, `grafana-agento11y-app.data:read`, `plugins.app:access` | N/A |
  306. | `agento11y_manage_agents` | Agent Observability* | Read the agent catalog: list agents, get one agent version in full, list version history, and per-version score aggregates | `grafana-agento11y-app.conversations:read`, `grafana-agento11y-app.data:read`, `plugins.app:access` | N/A |
  307. | `agento11y_manage_evaluators` | Agent Observability* | Manage evaluators, evaluator templates, and the judge catalog (list, get, upsert, fork, test, delete) | `grafana-agento11y-app.conversations:read`, `grafana-agento11y-app.data:read`, `plugins.app:access`; with writes enabled also `grafana-agento11y-app.eval:write` | N/A |
  308. | `agento11y_manage_eval_rules` | Agent Observability* | Manage eval rules and guards (list, get, create, update, preview, delete) | `grafana-agento11y-app.conversations:read`, `grafana-agento11y-app.data:read`, `plugins.app:access`; with writes enabled also `grafana-agento11y-app.eval:write` | N/A |
  309. | `agento11y_manage_eval_collections` | Agent Observability* | Manage saved conversations and the collections that group them (list, get, save, create, update, delete, add and remove members) | `grafana-agento11y-app.conversations:read`, `grafana-agento11y-app.data:read`, `plugins.app:access`; with writes enabled also `grafana-agento11y-app.eval:write` | N/A |
  310. | `agento11y_manage_experiments` | Agent Observability* | Read offline experiments, their trials, scores, artifact metadata, and filter facets; update and cancel an experiment | `grafana-agento11y-app.conversations:read`, `grafana-agento11y-app.data:read`, `plugins.app:access`; with writes enabled also `grafana-agento11y-app.eval:write` | N/A |
  311. | `agento11y_manage_test_suites` | Agent 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.conversations:read`, `grafana-agento11y-app.data:read`, `plugins.app:access`; with writes enabled also `grafana-agento11y-app.eval:write` | N/A |
  312. | `ask_assistant` | Assistant* | Send a prompt to Grafana Assistant and return the full text reply (multi-turn via `contextId`) | `grafana-assistant-app.chats:access`, `plugins.app:access` | Plugin-specific scopes |
  313. | `generate_deeplink` | Navigation | Generate accurate deeplink URLs for Grafana resources | None | N/A |
  314. | `get_annotations` | Annotations | Fetch annotations with filters | `annotations:read` | `annotations:*` or `annotations:id:123` |
  315. | `create_annotation` | Annotations | Create a new annotation (standard or Graphite format) | `annotations:create` | `annotations:*` |
  316. | `update_annotation` | Annotations | Update specific fields of an annotation (partial update) | `annotations:read`, `annotations:write` | `annotations:*` |
  317. | `delete_annotation` | Annotations | Delete an annotation by ID | `annotations:delete` | `annotations:*` |
  318. | `get_annotation_tags` | Annotations | List annotation tags with optional filtering | `annotations:read` | `annotations:*` |
  319. | `list_snapshots` | Snapshot | List dashboard snapshots with optional query and limit filters | `snapshots:read` | N/A |
  320. | `get_snapshot` | Snapshot | Get snapshot metadata and dashboard payload by snapshot key | None | N/A |
  321. | `create_snapshot` | Snapshot | Create a dashboard snapshot from a full dashboard payload | `dashboards:read`, `snapshots:create` | `dashboards:uid:abc123` |
  322. | `delete_snapshot` | Snapshot | Delete a dashboard snapshot by snapshot key | `dashboards:write`, `snapshots:delete` | `dashboards:uid:abc123` |
  323. | `get_panel_image` | Rendering | Render a stored dashboard or panel, a provisioning preview, or an ad-hoc Explore view as a PNG image | `dashboards:read`, `datasources:explore`, `datasources:query`, `datasources:read`, `provisioning.repositories:read` | `dashboards:uid:abc123` |
  324. | `list_provisioning_repositories` | Provisioning | List provisioning repositories (e.g. git-sync sources) with their source URL, branch, sync state, and health | `provisioning.grafana.app/repositories:list`, `provisioning.repositories:read` | N/A |
  325. | `validate_provisioning_file` | Provisioning | Dry-run-apply a file from a provisioning repository and report admission validation errors | `dashboard.grafana.app/dashboards:get`, `dashboards:read`, `folder.grafana.app/folders:get`, `folders:read`, `provisioning.grafana.app/repositories:get`, `provisioning.repositories:read` | N/A |
  326. | `search_docs` | Docs | Search Grafana documentation or list product groups (omit query to list products) | None | N/A |
  327. | `get_doc` | Docs | Fetch a documentation page; set outline_only for headings, or section for bounded retrieval | None | N/A |
  328. | `search_tempo_traces` | Tempo | Search traces with TraceQL | `datasources:query`, `datasources:read` | `datasources:uid:tempo-uid` |
  329. | `query_tempo_metrics` | Tempo | Compute metrics from traces with TraceQL | `datasources:query`, `datasources:read` | `datasources:uid:tempo-uid` |
  330. | `get_tempo_trace` | Tempo | Fetch a trace by ID | `datasources:query`, `datasources:read` | `datasources:uid:tempo-uid` |
  331. | `diff_tempo_traces` | Tempo | Compare two traces | `datasources:query`, `datasources:read` | `datasources:uid:tempo-uid` |
  332. | `list_tempo_attribute_names` | Tempo | List span and resource attribute names | `datasources:query`, `datasources:read` | `datasources:uid:tempo-uid` |
  333. | `list_tempo_attribute_values` | Tempo | List values for a trace attribute | `datasources:query`, `datasources:read` | `datasources:uid:tempo-uid` |
  334. | `get_tempo_traceql_docs` | Tempo | Get TraceQL documentation | None | N/A |
  335. | `query_graphite` | Graphite* | Query Graphite metrics | `datasources:query`, `datasources:read` | `datasources:uid:graphite-uid` |
  336. | `query_graphite_density` | Graphite* | Query Graphite metric density | `datasources:query`, `datasources:read` | `datasources:uid:graphite-uid` |
  337. | `list_graphite_metrics` | Graphite* | List Graphite metrics | `datasources:query`, `datasources:read` | `datasources:uid:graphite-uid` |
  338. | `list_graphite_tags` | Graphite* | List Graphite tags | `datasources:query`, `datasources:read` | `datasources:uid:graphite-uid` |
  339. | `get_plugin` | Plugins | Get an installed plugin | `plugins.app:access` | N/A |
  340. | `search_plugin_information` | Plugins | Search the grafana.com plugin catalog | None | N/A |
  341. | `install_plugin` | Plugins | Install a plugin | `plugins:install` | N/A |
  342. | `grafana_api_request` | API | Call a Grafana HTTP API endpoint | None | Depends on the endpoint |
  343. _* Disabled by default. Add category to `--enabled-tools` to enable._
  344. The `render_grafana_app` tool displays metrics and traces in compatible MCP hosts when the rendering and corresponding query categories are enabled. Source query tools return text and structured data for analysis. See [MCP Apps](docs/mcp-apps.md) for setup and library embedding.
  345. ## CLI Flags Reference
  346. The `mcp-grafana` binary supports various command-line flags for configuration:
  347. **Transport Options:**
  348. - `-t, --transport`: Transport type (`stdio`, `sse`, or `streamable-http`) - default: `stdio`
  349. - `--address`: The host and port for SSE/streamable-http server - default: `localhost:8000`
  350. - `--base-path`: Base path for the SSE/streamable-http server. `/healthz` and `/metrics` are always served at the server root, not under this prefix — they're internal-only endpoints for probes and scrapers, and keeping them off the application prefix makes it easier to expose the API through a reverse proxy without also exposing them
  351. - `--endpoint-path`: Endpoint path for the streamable-http server, appended to `--base-path` - default: `/mcp`
  352. - `--sse-keepalive`: Interval between ping requests sent to each SSE client, so reverse proxies and load balancers do not close an idle event stream (which ends the session). Set it below the proxy's idle timeout, e.g. `30s` behind ingress-nginx's default 60s `proxy-read-timeout`. A client is disconnected after 3 pings in a row go unanswered for half the interval each. Accepts Go duration strings, minimum `1s` - default: `0` (disabled). Only applies to `--transport sse`
  353. - `--server-name`: Server name used in the MCP handshake and OTel `service.name` - default: `mcp-grafana`. Overrides `GRAFANA_MCP_SERVER_NAME` env var
  354. - `--instructions-append`: Text appended to the server instructions returned to MCP clients on initialize, so every connecting agent sees it
  355. When `--address` uses port `0`, the operating system allocates a free port and the server atomically writes the bound address to `mcp-grafana-address` in its working directory. The file is created with mode `0600`.
  356. > [!NOTE]
  357. > Over SSE, per-request headers do not reach tool calls: `X-Grafana-Service-Account-Token` / `X-Grafana-API-Key`, `X-Grafana-Org-Id`, and headers listed in `GRAFANA_FORWARD_HEADERS` have no effect, tool calls use the server's environment credentials, and `X-Grafana-URL` overrides do not work. Use streamable-http when each caller needs its own Grafana URL, credentials, or organization.
  358. **HTTP Transport Security (SSE / streamable-http only):**
  359. `Host`/`Origin` validation is enforced on *every* route on the MCP listener — `/sse`, `/mcp`, and `/healthz` / `/metrics` when they share that listener — so a DNS-rebinding browser cannot reach any of them. Stdio transport is unaffected. `--healthz-address` and `--metrics-address` start a separate listener that is not wrapped.
  360. - `--allowed-hosts`: Comma-separated allowlist of `Host` header values. Defaults to loopback variants of `--address` (e.g. `localhost:8000,127.0.0.1:8000,[::1]:8000`). A value that parses to empty (unset, `,`, ` , `, etc.) also falls back to the defaults so a typo cannot silently disable the check. Requests with a `Host` header outside the allowlist are rejected with `403`. Pass `*` to disable `Host` validation — only safe when a trusted reverse proxy validates `Host`. K8s `httpGet` probes and external `/metrics` scrapes will need either an explicit hostname in this list, `*`, a `tcpSocket` probe, or a separate port (`--healthz-address` / `--metrics-address`).
  361. - `--allowed-origins`: Comma-separated allowlist of `Origin` header values. Empty by default — any request that carries an `Origin` header is rejected (browsers always send one for cross-origin requests, and no browser should be calling this server directly). Set to an explicit list to permit browser-based clients, or `*` to disable the check.
  362. - `--allow-grafana-url-override`: Enable `X-Grafana-URL` selection. Falls back to `GRAFANA_ALLOW_URL_OVERRIDE`; disabled by default. Without an allowlist, callers can select any HTTP(S) URL the server can reach.
  363. - `--allowed-grafana-urls`: Optional comma-separated exact Grafana base URL allowlist for URL overrides. Falls back to `GRAFANA_ALLOWED_URLS`. Requires `--allow-grafana-url-override`; an explicit empty flag disables an inherited list.
  364. **Caller Authentication (SSE / streamable-http only):**
  365. Optionally require MCP clients to authenticate *to the server*. This is separate from the credentials the server uses to reach Grafana. Stdio is unaffected.
  366. - `--server-auth-token`: Bearer token callers must send as `Authorization: Bearer <token>`. Falls back to the `MCP_GRAFANA_SERVER_TOKEN` environment variable. When set, requests without a valid token are rejected with `401` before any tool runs. Prefer the env var so the secret isn't visible in the process arguments.
  367. Caller authentication is enforced only when `--server-auth-token` is set. When it isn't and the server binds a non-loopback address, the server **starts but logs a security error** — emitted at the `error` log level so it isn't hidden by `--log-level` (loopback and stdio are unaffected); a future major release will make that a startup error. Use TLS (or TLS termination) whenever caller auth is enabled on a non-loopback address. When caller auth is enabled, the validated `Authorization` header is stripped before requests reach Grafana; combining `--server-auth-token` with `GRAFANA_FORWARD_HEADERS=Authorization` is rejected at startup.
  368. **Grafana URL overrides (streamable-http only):**
  369. > [!WARNING]
  370. > URL overrides let MCP callers select outbound HTTP(S) destinations. An allowlist limits URLs but does not authenticate callers or bind tokens to targets.
  371. >
  372. > Deploy behind an authenticating proxy that authorizes each target, replaces client-supplied URL and token headers, and supplies the matching token. Restrict the server's outbound network access to approved destinations.
  373. >
  374. > Without an allowlist, a fake request token can cause requests to any reachable HTTP(S) service, including internal and metadata services.
  375. Set `GRAFANA_ALLOW_URL_OVERRIDE=true` (or `--allow-grafana-url-override`) to enable selection for a large fleet. To restrict destinations, also set `GRAFANA_ALLOWED_URLS=https://one.example.com,https://two.example.com/grafana` (or `--allowed-grafana-urls`).
  376. Send these headers on each MCP request that selects a target:
  377. ```http
  378. X-Grafana-URL: https://one.example.com
  379. X-Grafana-Service-Account-Token: <token for one.example.com>
  380. ```
  381. If `--server-auth-token` is configured, also send `Authorization: Bearer <MCP caller token>`. This authenticates to the MCP server and is separate from `X-Grafana-Service-Account-Token`, which is for the selected Grafana instance. Your proxy can send a different Grafana token for each instance; the server never shares one configured token across them. The deprecated `X-Grafana-API-Key` header also works. A URL header without a request Grafana token is rejected. Use TLS for incoming requests because they carry tokens.
  382. The allowlist matches exact base URLs, including scheme, port, and path; wildcards are not supported. Grafana authentication is not an SSRF defense.
  383. For a selected URL, the server does not use `GRAFANA_SERVICE_ACCOUNT_TOKEN`, `GRAFANA_SERVICE_ACCOUNT_TOKEN_FILE`, `GRAFANA_API_KEY`, environment basic authentication, `GRAFANA_EXTRA_HEADERS`, or client certificates. TLS verification remains enabled even if `--tls-skip-verify` is set; a configured CA file still applies. Headers explicitly forwarded from that request still apply. Redirects and other Grafana API requests outside the selected base URL are blocked. Requests without `X-Grafana-URL` retain the usual `GRAFANA_URL` and environment credential behavior. This option applies to streamable HTTP only. It does not work over SSE, which does not pass per-request headers to tool calls; a selected URL there is used without the caller's token, so the calls fail.
  384. **Debug and Logging:**
  385. - `--debug`: Enable debug mode for detailed HTTP request/response logging
  386. - `--log-level`: Log level (`debug`, `info`, `warn`, `error`) - default: `info`
  387. **Grafana Client Options:**
  388. - `--grafana-timeout`: Time limit for requests made by the Grafana client. Accepts Go duration strings (e.g., `10s`, `500ms`) - default: `30s`
  389. - `--allow-cross-origin-redirects`: Allow outbound Grafana clients to follow redirects to a different scheme, host, or port. Defaults to false; `GRAFANA_ALLOW_CROSS_ORIGIN_REDIRECTS` is the environment fallback. Enabling this can send Grafana credentials to the redirect target. Request-selected Grafana URLs remain pinned to their selected target.
  390. - `--include-args-in-spans`: Include tool call arguments in OpenTelemetry spans. Only enable in non-production environments or when arguments are known not to contain PII - default: `false`
  391. **Observability:**
  392. - `--metrics`: Enable Prometheus metrics endpoint at `/metrics`
  393. - `--metrics-address`: Separate address for metrics server (e.g., `:9090`). If empty, metrics are served on the main server
  394. - `--healthz-address`: Separate address for `/healthz` (e.g., `:8080`). If empty, `/healthz` is served on the main server. Shares a listener with `--metrics-address` when the two addresses match. Side listeners skip Host/Origin validation.
  395. - `--slow-request-threshold`: Log an event when any MCP request (tool invocation, list, resource read, etc.) takes longer than this duration. Accepts Go duration strings (e.g., `500ms`, `5s`). Default `0` disables slow-request logging. See the [Slow-request logging](#slow-request-logging) section.
  396. - `--slow-request-log-level`: Log level for slow-request events (`info` or `warn`) - default: `warn`.
  397. **Anonymous Usage Statistics:**
  398. - `--usage-stats`: Anonymous usage statistics reporting: `enabled`, `disabled`, or `log` (print the report that would be sent to stderr and send nothing). Overrides the `GRAFANA_USAGE_STATS` env var, which in turn overrides `DO_NOT_TRACK`; any unrecognised value disables reporting. See the [Anonymous usage statistics](#anonymous-usage-statistics) section.
  399. **Tool Configuration:**
  400. - `--enabled-tools`: Comma-separated list of enabled categories - default: all categories except `admin`, `agento11y`, `assistant`, `athena`, `azuremonitor`, `clickhouse`, `cloudlogging`, `cloudwatch`, `dsquery`, `elasticsearch`, `examples`, `graphite`, `quickwit`, `runpanelquery`, and `snowflake`. To enable disabled categories, add them to the list (e.g., `"search,datasource,...,snowflake"`)
  401. - `--max-loki-log-limit`: Maximum number of log lines returned per `query_loki_logs` call - default: `100`. Note: Set this at least 1 below Loki's server-side `max_entries_limit_per_query` to allow truncation detection (the tool requests `limit+1` internally to detect if more data exists).
  402. - `--loki-guardrail-mode`: Loki query cost guardrail for `query_loki_logs` - default: `off`. Loki does not enforce `max_query_bytes_read` on log queries without a line filter, so a broad selector over a wide range can scan terabytes; the guardrail requires a selective stream selector, caps the effective time range (including range-vector durations like `[30d]`), and pre-checks Loki's index/stats byte estimate before running the query. `shadow` logs queries that would be blocked but lets them run (it still pays the index/stats round trip); `enforce` rejects them with rewrite guidance the LLM can act on. On VictoriaLogs the guardrail applies only to selector-shaped (`{...}`) queries — when no selector parses (the normal brace-less LogsQL shape), the query passes through entirely, and the byte-budget check never applies (no cheap index estimate). Env fallback: `GRAFANA_LOKI_GUARDRAIL_MODE`.
  403. - `--loki-guardrail-max-bytes`: Maximum bytes a single `query_loki_logs` call may scan, estimated via Loki's index/stats API - default: `107374182400` (100 GiB). `0` disables the byte-budget check. Env fallback: `GRAFANA_LOKI_GUARDRAIL_MAX_BYTES`.
  404. - `--loki-guardrail-on-estimate-failure`: What the Loki guardrail does when it cannot assess a query (no stream selector it understands, or the index/stats estimate failed) - default: `allow`. `allow` runs the query; `block` rejects it in `enforce` mode. `block` has no effect on VictoriaLogs, where such queries always run. Only applies when the guardrail is not `off`. Env fallback: `GRAFANA_LOKI_GUARDRAIL_ON_ESTIMATE_FAILURE`.
  405. - `--loki-guardrail-max-range`: Maximum effective time range for a single `query_loki_logs` call, including range-vector durations - default: `24h`. Accepts Go duration strings. `0` disables the range check. Env fallback: `GRAFANA_LOKI_GUARDRAIL_MAX_RANGE`.
  406. - `--prometheus-guardrail-mode`: Prometheus query guardrail for `query_prometheus`, `query_prometheus_histogram`, and the Prometheus queries of `run_panel_query` - default: `off`. The guardrail caps the effective time range of a query and the number of points per series it requests, before the query reaches the datasource. An independent opt-in selector policy can require a non-empty positive label constraint beyond the metric name in every vector selector; see [selector policy](docs/sources/configure/command-line-flags.md#prometheus-selector-policy) for examples and limits. `shadow` logs queries that would be blocked but lets them run; `enforce` rejects them with rewrite guidance the LLM can act on (`run_panel_query` reports it in the result's `errors` entry for that panel). Env fallback: `GRAFANA_PROMETHEUS_GUARDRAIL_MODE`.
  407. - `--prometheus-guardrail-require-selective-labels`: Require each vector selector to include a non-empty positive label constraint beyond the metric name. Default: `false`; independent of the range and points budgets, including when both are `0`. Only applies when the guardrail mode is not `off`. Env fallback: `GRAFANA_PROMETHEUS_GUARDRAIL_REQUIRE_SELECTIVE_LABELS`. Explicit CLI values, including `false`, override the environment.
  408. - `--prometheus-guardrail-max-range`: Maximum effective time range for a single PromQL query - default: `192h`. The effective range is the query's own time range (zero for instant queries) plus the longest range-vector or subquery window in the expression, where nested subquery ranges add up, so `max_over_time(rate(x[5m])[30d:1m])` reads 30d5m. Accepts Go duration strings, so write `192h`, not `8d`. `0` disables the range check. Env fallback: `GRAFANA_PROMETHEUS_GUARDRAIL_MAX_RANGE`.
  409. - `--prometheus-guardrail-max-points`: Maximum points per series a range query may request, `floor(range / step) + 1` - default: `11000`, Prometheus' own per-series limit. The guidance names the smallest `stepSeconds` that fits. `0` disables the points check. Env fallback: `GRAFANA_PROMETHEUS_GUARDRAIL_MAX_POINTS`.
  410. - `--prometheus-guardrail-max-metric-cardinality`: Opt-in TSDB scope policy. Default: `0` (disabled). An exact metric name reported above this series-count threshold requires a non-empty exact matcher on a configured scope label. Only active when the mode is not `off`. Env fallback: `GRAFANA_PROMETHEUS_GUARDRAIL_MAX_METRIC_CARDINALITY`.
  411. - `--prometheus-guardrail-cardinality-cache-ttl`: Lifetime of cached TSDB snapshots. Default: `10m`; `0` also uses `10m`. Env fallback: `GRAFANA_PROMETHEUS_GUARDRAIL_CARDINALITY_CACHE_TTL`.
  412. - `--prometheus-guardrail-cardinality-scope-labels`: Comma-separated labels whose non-empty exact matchers satisfy the cardinality policy. Default: `job,instance,namespace,pod,service,cluster`; empty uses these defaults. `__name__` is not allowed. Env fallback: `GRAFANA_PROMETHEUS_GUARDRAIL_CARDINALITY_SCOPE_LABELS`. Explicit CLI settings override the corresponding environment variables.
  413. Limits of the Prometheus guardrail: the points check budgets the requested resolution, not the number of series, samples, or subquery evaluations, and Grafana may align the range or widen the step. `offset` and `@` modifiers are ignored. Grafana macros such as `$__rate_interval` and `$__range` are filled in before the expression is measured, with the values Grafana uses (`$__rate_interval` is four times the step). Expressions the guardrail still cannot parse (for example ones with dashboard variables such as `$window`, or syntax only another dialect accepts) are checked against the query's own time range and step only, and run otherwise. `run_panel_query` has no step parameter, so it widens its 1-minute step for long ranges to stay within 11000 points, as Grafana does, or within a lower `--prometheus-guardrail-max-points` in `enforce` mode.
  414. - `--prometheus-enforced-matchers`: PromQL label matchers AND-ed into every native-Prometheus query to restrict which series can be read (e.g. `environment=~"prod|staging"`). Requires `--disable-api`. See [Prometheus query enforcement](#prometheus-query-enforcement).
  415. - `--loki-enforced-matchers`: LogQL label matchers AND-ed into every native-Loki query to restrict which log streams can be read (e.g. `environment=~"prod|staging"`). Requires `--disable-api`. See [Loki query enforcement](#loki-query-enforcement).
  416. - `--loki-label-enumeration-fallback`: What the label-enumeration tools do when negative enforced matchers can't scope them: `reject` (default) or `unfiltered`. See [Loki query enforcement](#loki-query-enforcement).
  417. - `--dashboard-schema`: Set to `v2` to make `update_dashboard` reject a classic v1 (`panels[]`) body that would create a new dashboard when Grafana serves dashboard schema v2; the error carries a minimal v2 body to retry with. Existing v1 dashboards stay editable, and a Grafana without v2 is unaffected. Default: empty (no change). Env fallback: `GRAFANA_DASHBOARD_SCHEMA`.
  418. - `--dynamic-multi-org`: Allow tool calls to select a Grafana organization per call via an optional `orgId` argument. Off by default. See [Dynamic (per-call) organization selection](#dynamic-per-call-organization-selection).
  419. - `--disable-search`: Disable search tools
  420. - `--disable-datasource`: Disable datasource tools
  421. - `--disable-incident`: Disable incident tools
  422. - `--disable-prometheus`: Disable prometheus tools
  423. - `--disable-write`: Disable write tools (create/update operations)
  424. - `--disable-query`: Disable query tools (tools that execute a query against a datasource); metadata and discovery tools stay available
  425. - `--enable-query`: Keep the raw-SQL query tools (`query_sql`, `query_influxdb`) registered even under `--disable-write`, and keep `query_datasource`, a source of `render_grafana_app`, available. For the raw-SQL tools it is equivalent to `--enable-write-tools=query_sql,query_influxdb`; kept as a shorthand for that common case.
  426. - `--enable-write-tools`: Comma separated list of individual tool names to keep registered even under `--disable-write`, for tools whose write behavior is scoped enough to opt back in independently. It works for every tool `--disable-write` removes, and for a tool with a read-only variant it keeps the full one. Has no effect on a tool whose whole category is disabled, and `--disable-query` still removes query tools. For example, `--enable-write-tools=generate_deeplink` keeps URL shortening (`shorten=true`) working under `--disable-write`, and `--enable-write-tools=alerting_rules_write` allows alert rule changes without enabling other write tools.
  427. - `--disable-loki`: Disable loki tools
  428. - `--disable-elasticsearch`: Disable elasticsearch and opensearch tools
  429. - `--disable-quickwit`: Disable quickwit tools
  430. - `--disable-influxdb`: Disable InfluxDB tools
  431. - `--disable-alerting`: Disable alerting tools
  432. - `--disable-dashboard`: Disable dashboard tools
  433. - `--disable-folder`: Disable folder tools
  434. - `--disable-oncall`: Disable oncall tools
  435. - `--disable-asserts`: Disable asserts tools
  436. - `--disable-admin`: Disable admin tools
  437. - `--disable-pyroscope`: Disable pyroscope tools
  438. - `--disable-navigation`: Disable navigation tools
  439. - `--disable-tempo`: Disable Tempo tracing tools. The deprecated alias `--disable-proxied` also works.
  440. - `--disable-annotations`: Disable annotation tools
  441. - `--disable-rendering`: Disable rendering tools (panel/dashboard image export)
  442. - `--disable-snapshot`: Disable snapshot tools
  443. - `--disable-cloudwatch`: Disable CloudWatch tools
  444. - `--disable-cloudlogging`: Disable Google Cloud Logging tools
  445. - `--disable-azuremonitor`: Disable Azure Monitor tools
  446. - `--disable-examples`: Disable query examples tools
  447. - `--disable-sql`: Disable SQL datasource tools (ClickHouse, Snowflake, Athena, MySQL, PostgreSQL, MSSQL, BigQuery). Aliases `--disable-clickhouse`, `--disable-snowflake`, `--disable-athena` also work.
  448. - `--disable-runpanelquery`: Disable run panel query tools
  449. - `--disable-graphite`: Disable Graphite tools
  450. - `--disable-dsquery`: Disable the `query_datasource` source of `render_grafana_app`
  451. - `--disable-plugin`: Disable plugin tools
  452. - `--disable-api`: Disable API tools
  453. - `--disable-config`: Disable config-generation tools
  454. - `--disable-provisioning`: Disable provisioning tools
  455. - `--disable-agento11y`: Disable Agent Observability tools
  456. - `--disable-assistant`: Disable Grafana Assistant tools
  457. - `--disable-docs`: Disable documentation tools
  458. - `--disable-user`: Disable user info tools
  459. ### Read-Only Mode
  460. The `--disable-write` flag provides a way to run the MCP server in read-only mode, preventing any write operations to your Grafana instance. This is useful for scenarios where you want to provide safe, read-only access such as:
  461. - Using service accounts with limited read-only permissions
  462. - Providing AI assistants with observability data without modification capabilities
  463. - Running in production environments where write access should be restricted
  464. - Testing and development scenarios where you want to prevent accidental modifications
  465. When `--disable-write` is enabled, the following write operations are disabled. Each one can be kept individually with `--enable-write-tools=<name>`:
  466. **Dashboard Tools:**
  467. - `update_dashboard`
  468. **Folder Tools:**
  469. - `create_folder`
  470. **Incident Tools:**
  471. - `create_incident`
  472. - `add_activity_to_incident`
  473. - `update_incident`
  474. **Alerting Tools:**
  475. - `alerting_rules_write` (create, update, delete operations)
  476. - `alerting_silences_write` (create, update, delete operations)
  477. - `alerting_routing_write` (create_contact_point operation)
  478. **OnCall Tools:**
  479. - `update_alert_group`
  480. **Annotation Tools:**
  481. - `create_annotation`
  482. - `update_annotation`
  483. - `delete_annotation`
  484. **Snapshot Tools:**
  485. - `create_snapshot`
  486. - `delete_snapshot`
  487. **Navigation Tools:**
  488. - `generate_deeplink` (`shorten=true` is ignored and the full URL is returned; pass `--enable-write-tools=generate_deeplink` to keep URL shortening)
  489. **Raw-SQL Query Tools:**
  490. These execute whatever query you give them without inspecting it, so they can write when the datasource credentials permit it — `query_sql` will run a `DROP TABLE`, `query_influxdb` will run a `DELETE`. Read-only mode therefore removes them. Pass `--enable-query` to keep them when the datasource credentials are known to be read-only.
  491. - `query_sql`
  492. - `query_influxdb`
  493. **Agent Observability Tools:**
  494. - `agento11y_manage_evaluators` (upsert, delete, fork, test evaluator operations)
  495. - `agento11y_manage_eval_rules` (create, update, delete, preview rule and guard operations)
  496. - `agento11y_manage_eval_collections` (save and delete saved conversations; create, update, delete collections; add and remove collection members)
  497. - `agento11y_manage_experiments` (update and cancel experiment operations)
  498. - `agento11y_manage_test_suites` (create and update test suites; create and publish versions; upsert and delete test cases)
  499. All read operations remain available, allowing you to query dashboards, run PromQL/LogQL queries, list resources, and retrieve data. The query languages that cannot express a write — PromQL, LogQL, TraceQL, the Elasticsearch DSL, Graphite, CloudWatch — keep their query tools in read-only mode; only the raw-SQL ones listed above are removed.
  500. ### Query-Free Mode
  501. The `--disable-query` flag removes every tool that executes a query against a datasource, while leaving the metadata and discovery tools in place. This is useful when you want an assistant that can explore what exists — datasources, dashboards, metric names, labels, table schemas — without running potentially expensive or data-revealing queries, for example when the service account has `datasources:read` but not `datasources:query`.
  502. It is the strongest of the three query settings, and it wins over `--enable-query`:
  503. | Flags | Safe query tools (`query_prometheus`, `query_loki_logs`, `run_panel_query`, …) | Raw-SQL query tools (`query_sql`, `query_influxdb`) |
  504. | --- | --- | --- |
  505. | _(none)_ | registered | registered |
  506. | `--disable-write` | registered | **not registered** |
  507. | `--disable-write --enable-query` | registered | registered |
  508. | `--disable-query` | not registered | not registered |
  509. | `--disable-query --enable-query` | not registered | not registered |
  510. When `--disable-query` is enabled, the following tools are not registered:
  511. **Prometheus Tools:**
  512. - `query_prometheus`
  513. - `query_prometheus_histogram`
  514. **Rendering Tools:**
  515. - `render_grafana_app`
  516. **Loki Tools:**
  517. - `query_loki_logs`
  518. - `query_loki_patterns`
  519. `query_loki_stats` and `analyze_loki_labels` stay registered: both send a selector to the datasource, but they read the index and return stream, chunk, and byte counts rather than log content.
  520. **Elasticsearch/OpenSearch and Quickwit Tools:**
  521. - `query_elasticsearch`
  522. - `query_quickwit`
  523. **InfluxDB Tools** (also removed by `--disable-write`, see above)**:**
  524. - `query_influxdb`
  525. **SQL Datasource Tools** (also removed by `--disable-write`, see above)**:**
  526. - `query_sql`
  527. **Graphite Tools:**
  528. - `query_graphite`
  529. - `query_graphite_density`
  530. **CloudWatch Tools:**
  531. - `query_cloudwatch`
  532. - `query_cloudwatch_logs`
  533. **Google Cloud Logging Tools:**
  534. - `query_cloud_logging`
  535. **Azure Monitor Tools:**
  536. - `query_azure_log_analytics`
  537. - `query_azure_resource_graph`
  538. **Pyroscope Tools:**
  539. - `query_pyroscope`
  540. **Run Panel Query Tools:**
  541. - `run_panel_query`
  542. The `elasticsearch`, `quickwit`, `influxdb`, `runpanelquery`, and `azuremonitor` categories contain nothing else, so they register no tools at all when queries are disabled. The sibling tools in every other category — `list_prometheus_metric_names`, `list_loki_label_values`, `describe_sql_table`, `list_cloudwatch_metrics`, `list_cloud_logging_projects`, and so on — remain available.
  543. Note that `--disable-query` gates the query tools and the `grafana_api_request` POST-to-`/api/ds/query` path, but does not police every route to a datasource. In read-only mode, `grafana_api_request` allows POST to `/api/ds/query` only when query tools are enabled (same gate as the raw-SQL tools — blocked by `--disable-write` unless `--enable-query` overrides). `get_panel_image`, which renders a panel server-side, is unaffected.
  544. **Client TLS Configuration (for Grafana connections):**
  545. - `--tls-cert-file`: Path to TLS certificate file for client authentication
  546. - `--tls-key-file`: Path to TLS private key file for client authentication
  547. - `--tls-ca-file`: Path to TLS CA certificate file for server verification
  548. - `--tls-skip-verify`: Skip TLS certificate verification (insecure)
  549. **Server TLS Configuration (streamable-http transport only):**
  550. - `--server.tls-cert-file`: Path to TLS certificate file for server HTTPS
  551. - `--server.tls-key-file`: Path to TLS private key file for server HTTPS
  552. **Version Information:**
  553. - `--version`: Print the version and exit
  554. ## Usage
  555. This MCP server works with both local Grafana instances and Grafana Cloud. For Grafana Cloud, use your instance URL (e.g., `https://myinstance.grafana.net`) instead of `http://localhost:3000` in the configuration examples below.
  556. 1. If using service account token authentication, create a service account in Grafana with enough permissions to use the tools you want to use,
  557. generate a service account token, and copy it to the clipboard for use in the configuration file.
  558. Follow the [Grafana service account documentation][service-account] for details on creating service account tokens.
  559. Tip: If you're not comfortable configuring fine-grained RBAC scopes, a simpler (but less restrictive) option is to assign the built-in `Editor` role to the service account. This grants broad read/write access that covers most MCP server operations — use it when convenience outweighs strict least-privilege requirements.
  560. > **Note:** The environment variable `GRAFANA_API_KEY` is deprecated and will be removed in a future version. Please migrate to using `GRAFANA_SERVICE_ACCOUNT_TOKEN` instead. The old variable name will continue to work for backward compatibility but will show deprecation warnings.
  561. #### Reading the service account token from a file
  562. Instead of passing the token inline via `GRAFANA_SERVICE_ACCOUNT_TOKEN`, you can point `GRAFANA_SERVICE_ACCOUNT_TOKEN_FILE` at a file path that contains the token. The file is read fresh on every request, so rotated tokens are picked up automatically without restarting the server.
  563. This is particularly useful in Kubernetes, where a Secret mounted as a volume is updated in place when the underlying Secret changes (typically within ~1 minute). Combined with the per-request client cache — which is keyed on the token value — a rotated token transparently produces a new client with no pod restart and no downtime:
  564. ```yaml
  565. env:
  566. - name: GRAFANA_SERVICE_ACCOUNT_TOKEN_FILE
  567. value: /var/run/secrets/grafana/token
  568. volumeMounts:
  569. - name: grafana-token
  570. mountPath: /var/run/secrets/grafana
  571. readOnly: true
  572. volumes:
  573. - name: grafana-token
  574. secret:
  575. secretName: grafana-mcp-token
  576. ```
  577. Surrounding whitespace (including a trailing newline) is trimmed from the file contents. If both `GRAFANA_SERVICE_ACCOUNT_TOKEN` and `GRAFANA_SERVICE_ACCOUNT_TOKEN_FILE` are set, the inline token takes precedence.
  578. ### Multi-Organization Support
  579. You can specify which organization to interact with using either:
  580. - **Environment variable:** Set `GRAFANA_ORG_ID` to the numeric organization ID
  581. - **HTTP header:** Set `X-Grafana-Org-Id` when using the streamable HTTP transport (header takes precedence over environment variable - meaning you can set a default org as well).
  582. When an organization ID is provided, the MCP server will set the `X-Grafana-Org-Id` header on all requests to Grafana, ensuring that operations are performed within the specified organization context.
  583. #### Dynamic (per-call) organization selection
  584. The options above fix the organization for the whole connection. To let a single connection target different organizations per tool call, start the server with the `--dynamic-multi-org` flag. This is off by default.
  585. When enabled, every tool accepts an optional `orgId` argument that overrides the connection's organization for that call (driving both the `X-Grafana-Org-Id` header and, for app-platform APIs, the resolved Kubernetes namespace). Proxied datasource tools are additionally discovered across every organization the credential can access. Calls that omit `orgId` use the connection's default organization.
  586. This only works for credentials that belong to more than one organization (e.g. a user or on-behalf-of identity); a service-account token remains bound to its single organization. Use the [`user_info`](#user) tool to discover which `orgId` values are valid.
  587. **Example with organization ID:**
  588. ```json
  589. {
  590. "mcpServers": {
  591. "grafana": {
  592. "command": "mcp-grafana",
  593. "args": [],
  594. "env": {
  595. "GRAFANA_URL": "http://localhost:3000",
  596. "GRAFANA_USERNAME": "<your username>",
  597. "GRAFANA_PASSWORD": "<your password>",
  598. "GRAFANA_ORG_ID": "2"
  599. }
  600. }
  601. }
  602. }
  603. ```
  604. ### Custom HTTP Headers
  605. You can add arbitrary HTTP headers to all Grafana API requests using the `GRAFANA_EXTRA_HEADERS` environment variable. The value should be a JSON object mapping header names to values.
  606. **Example with custom headers:**
  607. ```json
  608. {
  609. "mcpServers": {
  610. "grafana": {
  611. "command": "mcp-grafana",
  612. "args": [],
  613. "env": {
  614. "GRAFANA_URL": "http://localhost:3000",
  615. "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your token>",
  616. "GRAFANA_EXTRA_HEADERS": "{\"X-Custom-Header\": \"custom-value\", \"X-Tenant-ID\": \"tenant-123\"}"
  617. }
  618. }
  619. }
  620. }
  621. ```
  622. ### SOCKS5 Proxy
  623. You can route all requests this server makes to Grafana through a SOCKS5 proxy using the `GRAFANA_SOCKS5_PROXY` environment variable. The proxy is scoped to this server's Grafana traffic: it does not modify the global `HTTP_PROXY`/`HTTPS_PROXY` variables, and when set it overrides their proxy selection for Grafana transports only, without affecting other MCP servers or your shell session. When unset, behavior is unchanged.
  624. The URL must use the `socks5://` or `socks5h://` scheme (Go treats them identically: hostname resolution is delegated to the proxy) and may include credentials, e.g. `socks5://user:pass@127.0.0.1:1080`.
  625. **Example:**
  626. ```json
  627. {
  628. "mcpServers": {
  629. "grafana": {
  630. "command": "mcp-grafana",
  631. "args": [],
  632. "env": {
  633. "GRAFANA_URL": "http://localhost:3000",
  634. "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your token>",
  635. "GRAFANA_SOCKS5_PROXY": "socks5://127.0.0.1:1080"
  636. }
  637. }
  638. }
  639. }
  640. ```
  641. An invalid proxy URL is a startup error, and if building a proxied connection fails at runtime the server fails closed rather than silently sending Grafana traffic directly.
  642. ### Forwarding Headers from the Client (Streamable-HTTP Only)
  643. When the MCP server runs behind a gateway or reverse proxy that handles SSO (e.g. an AWS ALB with OIDC), each user's session cookie must reach Grafana so it can associate the request with the authenticated user. The `GRAFANA_FORWARD_HEADERS` environment variable enables this by specifying a comma-separated allowlist of header names to copy from the **incoming** HTTP request to every outbound Grafana API request.
  644. This only applies when using the streamable-http (`-t streamable-http`) transport. It has no effect in stdio or SSE mode.
  645. **Example: forward the session cookie**
  646. ```json
  647. {
  648. "env": {
  649. "GRAFANA_URL": "https://grafana.internal",
  650. "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your token>",
  651. "GRAFANA_FORWARD_HEADERS": "Cookie"
  652. }
  653. }
  654. ```
  655. You can forward multiple headers by separating them with commas:
  656. ```
  657. GRAFANA_FORWARD_HEADERS=Cookie,X-Session-Id
  658. ```
  659. Forwarded headers are merged with any headers defined in `GRAFANA_EXTRA_HEADERS`. If a header name appears in both, the value from the incoming request takes precedence for that request.
  660. Trace context headers (`traceparent`, `tracestate`, `baggage`) are the exception: the server propagates trace context itself, so a forwarded value never overrides the one it injects. See [observability](docs/sources/developer/observability-metrics-and-tracing.md#trace-context-propagation).
  661. 2. You have several options to install `mcp-grafana`:
  662. - **uvx (recommended)**: If you have [uv](https://docs.astral.sh/uv/getting-started/installation/) installed, no extra setup is needed — `uvx` will automatically download and run the server:
  663. ```bash
  664. uvx mcp-grafana
  665. ```
  666. - **Docker image**: Use the pre-built Docker image from Docker Hub.
  667. **Important**: The Docker image's entrypoint is configured to run the MCP server in SSE mode by default, but most users will want to use STDIO mode for direct integration with AI assistants like Claude Desktop:
  668. 1. **STDIO Mode**: For stdio mode you must explicitly override the default with `-t stdio` and include the `-i` flag to keep stdin open:
  669. ```bash
  670. docker pull grafana/mcp-grafana
  671. # For local Grafana:
  672. docker run --rm -i -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token> grafana/mcp-grafana -t stdio
  673. # For Grafana Cloud:
  674. docker run --rm -i -e GRAFANA_URL=https://myinstance.grafana.net -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token> grafana/mcp-grafana -t stdio
  675. ```
  676. > **Note — secure the networked modes:** In SSE and streamable-http modes the container binds a non-loopback address (`0.0.0.0:8000`). Without a caller token the server **starts but logs a security error** (at the `error` log level, so it isn't hidden by `--log-level`; and it will refuse to start in a future major release). Set `MCP_GRAFANA_SERVER_TOKEN` to require an `Authorization: Bearer <token>` from clients (recommended). STDIO mode is unaffected. See [Caller Authentication](#cli-flags-reference).
  677. 2. **SSE Mode**: In this mode, the server runs as an HTTP server that clients connect to. You must expose port 8000 using the `-p` flag:
  678. ```bash
  679. docker pull grafana/mcp-grafana
  680. docker run --rm -p 8000:8000 -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token> -e MCP_GRAFANA_SERVER_TOKEN=<caller auth token> grafana/mcp-grafana
  681. ```
  682. 3. **Streamable HTTP Mode**: In this mode, the server operates as an independent process that can handle multiple client connections. You must expose port 8000 using the `-p` flag: For this mode you must explicitly override the default with `-t streamable-http`
  683. ```bash
  684. docker pull grafana/mcp-grafana
  685. docker run --rm -p 8000:8000 -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token> -e MCP_GRAFANA_SERVER_TOKEN=<caller auth token> grafana/mcp-grafana -t streamable-http
  686. ```
  687. For HTTPS streamable HTTP mode with server TLS certificates:
  688. ```bash
  689. docker pull grafana/mcp-grafana
  690. docker run --rm -p 8443:8443 \
  691. -v /path/to/certs:/certs:ro \
  692. -e GRAFANA_URL=http://localhost:3000 \
  693. -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token> \
  694. -e MCP_GRAFANA_SERVER_TOKEN=<caller auth token> \
  695. grafana/mcp-grafana \
  696. -t streamable-http \
  697. -addr :8443 \
  698. --server.tls-cert-file /certs/server.crt \
  699. --server.tls-key-file /certs/server.key
  700. ```
  701. - **Download binary**: Download the latest release of `mcp-grafana` from the [releases page](https://github.com/grafana/mcp-grafana/releases) and place it in your `$PATH`.
  702. - **Build from source**: If you have a Go toolchain installed you can also build and install it from source, using the `GOBIN` environment variable
  703. to specify the directory where the binary should be installed. This should also be in your `$PATH`.
  704. ```bash
  705. GOBIN="$HOME/go/bin" go install github.com/grafana/mcp-grafana/v2/cmd/mcp-grafana@latest
  706. ```
  707. - **Deploy to Kubernetes using Helm**: use the [Helm chart from the Grafana helm-charts repository](https://github.com/grafana/helm-charts/tree/main/charts/grafana-mcp)
  708. ```bash
  709. helm repo add grafana https://grafana.github.io/helm-charts
  710. helm install --set grafana.apiKey=<Grafana_ApiKey> --set grafana.url=<GrafanaUrl> my-release grafana/grafana-mcp
  711. ```
  712. 3. Add the server configuration to your client configuration file. For example, for Claude Desktop:
  713. **If using uvx:**
  714. ```json
  715. {
  716. "mcpServers": {
  717. "grafana": {
  718. "command": "uvx",
  719. "args": ["mcp-grafana"],
  720. "env": {
  721. "GRAFANA_URL": "http://localhost:3000",
  722. "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your service account token>"
  723. }
  724. }
  725. }
  726. }
  727. ```
  728. **If using the binary:**
  729. ```json
  730. {
  731. "mcpServers": {
  732. "grafana": {
  733. "command": "mcp-grafana",
  734. "args": [],
  735. "env": {
  736. "GRAFANA_URL": "http://localhost:3000", // Or "https://myinstance.grafana.net" for Grafana Cloud
  737. "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your service account token>",
  738. // If using username/password authentication
  739. "GRAFANA_USERNAME": "<your username>",
  740. "GRAFANA_PASSWORD": "<your password>",
  741. // Optional: specify organization ID for multi-org support
  742. "GRAFANA_ORG_ID": "1"
  743. }
  744. }
  745. }
  746. }
  747. ```
  748. > Note: if you see `Error: spawn mcp-grafana ENOENT` in Claude Desktop, you need to specify the full path to `mcp-grafana`.
  749. **If using Docker:**
  750. ```json
  751. {
  752. "mcpServers": {
  753. "grafana": {
  754. "command": "docker",
  755. "args": [
  756. "run",
  757. "--rm",
  758. "-i",
  759. "-e",
  760. "GRAFANA_URL",
  761. "-e",
  762. "GRAFANA_SERVICE_ACCOUNT_TOKEN",
  763. "grafana/mcp-grafana",
  764. "-t",
  765. "stdio"
  766. ],
  767. "env": {
  768. "GRAFANA_URL": "http://localhost:3000", // Or "https://myinstance.grafana.net" for Grafana Cloud
  769. "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your service account token>",
  770. // If using username/password authentication
  771. "GRAFANA_USERNAME": "<your username>",
  772. "GRAFANA_PASSWORD": "<your password>",
  773. // Optional: specify organization ID for multi-org support
  774. "GRAFANA_ORG_ID": "1"
  775. }
  776. }
  777. }
  778. }
  779. ```
  780. > Note: The `-t stdio` argument is essential here because it overrides the default SSE mode in the Docker image.
  781. **Using VSCode with remote MCP server**
  782. If you're using VSCode and running the MCP server in SSE mode (which is the default when using the Docker image without overriding the transport), make sure your `.vscode/settings.json` includes the following:
  783. ```json
  784. "mcp": {
  785. "servers": {
  786. "grafana": {
  787. "type": "sse",
  788. "url": "http://localhost:8000/sse"
  789. }
  790. }
  791. }
  792. ```
  793. For HTTPS streamable HTTP mode with server TLS certificates:
  794. ```json
  795. "mcp": {
  796. "servers": {
  797. "grafana": {
  798. "type": "sse",
  799. "url": "https://localhost:8443/sse"
  800. }
  801. }
  802. }
  803. ```
  804. ### Debug Mode
  805. You can enable debug mode for the Grafana transport by adding the `-debug` flag to the command. This will provide detailed logging of HTTP requests and responses between the MCP server and the Grafana API, which can be helpful for troubleshooting.
  806. To use debug mode with the Claude Desktop configuration, update your config as follows:
  807. **If using the binary:**
  808. ```json
  809. {
  810. "mcpServers": {
  811. "grafana": {
  812. "command": "mcp-grafana",
  813. "args": ["-debug"],
  814. "env": {
  815. "GRAFANA_URL": "http://localhost:3000", // Or "https://myinstance.grafana.net" for Grafana Cloud
  816. "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your service account token>"
  817. }
  818. }
  819. }
  820. }
  821. ```
  822. **If using Docker:**
  823. ```json
  824. {
  825. "mcpServers": {
  826. "grafana": {
  827. "command": "docker",
  828. "args": [
  829. "run",
  830. "--rm",
  831. "-i",
  832. "-e",
  833. "GRAFANA_URL",
  834. "-e",
  835. "GRAFANA_SERVICE_ACCOUNT_TOKEN",
  836. "grafana/mcp-grafana",
  837. "-t",
  838. "stdio",
  839. "-debug"
  840. ],
  841. "env": {
  842. "GRAFANA_URL": "http://localhost:3000", // Or "https://myinstance.grafana.net" for Grafana Cloud
  843. "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your service account token>"
  844. }
  845. }
  846. }
  847. }
  848. ```
  849. > Note: As with the standard configuration, the `-t stdio` argument is required to override the default SSE mode in the Docker image.
  850. ### TLS Configuration
  851. If your Grafana instance is behind mTLS or requires custom TLS certificates, you can configure the MCP server to use custom certificates. The server supports the following TLS configuration options:
  852. - `--tls-cert-file`: Path to TLS certificate file for client authentication
  853. - `--tls-key-file`: Path to TLS private key file for client authentication
  854. - `--tls-ca-file`: Path to TLS CA certificate file for server verification
  855. - `--tls-skip-verify`: Skip TLS certificate verification (insecure, use only for testing)
  856. **Example with client certificate authentication:**
  857. ```json
  858. {
  859. "mcpServers": {
  860. "grafana": {
  861. "command": "mcp-grafana",
  862. "args": [
  863. "--tls-cert-file",
  864. "/path/to/client.crt",
  865. "--tls-key-file",
  866. "/path/to/client.key",
  867. "--tls-ca-file",
  868. "/path/to/ca.crt"
  869. ],
  870. "env": {
  871. "GRAFANA_URL": "https://secure-grafana.example.com",
  872. "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your service account token>"
  873. }
  874. }
  875. }
  876. }
  877. ```
  878. **Example with Docker:**
  879. ```json
  880. {
  881. "mcpServers": {
  882. "grafana": {
  883. "command": "docker",
  884. "args": [
  885. "run",
  886. "--rm",
  887. "-i",
  888. "-v",
  889. "/path/to/certs:/certs:ro",
  890. "-e",
  891. "GRAFANA_URL",
  892. "-e",
  893. "GRAFANA_SERVICE_ACCOUNT_TOKEN",
  894. "grafana/mcp-grafana",
  895. "-t",
  896. "stdio",
  897. "--tls-cert-file",
  898. "/certs/client.crt",
  899. "--tls-key-file",
  900. "/certs/client.key",
  901. "--tls-ca-file",
  902. "/certs/ca.crt"
  903. ],
  904. "env": {
  905. "GRAFANA_URL": "https://secure-grafana.example.com",
  906. "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your service account token>"
  907. }
  908. }
  909. }
  910. }
  911. ```
  912. The TLS configuration is applied to all HTTP clients used by the MCP server, including:
  913. - The main Grafana OpenAPI client
  914. - Prometheus datasource clients
  915. - Loki datasource clients
  916. - Incident management clients
  917. - Alerting clients
  918. - Asserts clients
  919. **Direct CLI Usage Examples:**
  920. For testing with self-signed certificates:
  921. ```bash
  922. ./mcp-grafana --tls-skip-verify -debug
  923. ```
  924. With client certificate authentication:
  925. ```bash
  926. ./mcp-grafana \
  927. --tls-cert-file /path/to/client.crt \
  928. --tls-key-file /path/to/client.key \
  929. --tls-ca-file /path/to/ca.crt \
  930. -debug
  931. ```
  932. With custom CA certificate only:
  933. ```bash
  934. ./mcp-grafana --tls-ca-file /path/to/ca.crt
  935. ```
  936. **Programmatic Usage:**
  937. If you're using this library programmatically, you can also create TLS-enabled context functions:
  938. ```go
  939. // Using struct literals
  940. tlsConfig := &mcpgrafana.TLSConfig{
  941. CertFile: "/path/to/client.crt",
  942. KeyFile: "/path/to/client.key",
  943. CAFile: "/path/to/ca.crt",
  944. }
  945. grafanaConfig := mcpgrafana.GrafanaConfig{
  946. Debug: true,
  947. TLSConfig: tlsConfig,
  948. }
  949. contextFunc := mcpgrafana.ComposedStdioContextFunc(grafanaConfig)
  950. // Or inline
  951. grafanaConfig := mcpgrafana.GrafanaConfig{
  952. Debug: true,
  953. TLSConfig: &mcpgrafana.TLSConfig{
  954. CertFile: "/path/to/client.crt",
  955. KeyFile: "/path/to/client.key",
  956. CAFile: "/path/to/ca.crt",
  957. },
  958. }
  959. contextFunc := mcpgrafana.ComposedStdioContextFunc(grafanaConfig)
  960. ```
  961. **URL validation:**
  962. When calling `NewGrafanaClient` directly (stdio or programmatic construction), pre-validate URLs to avoid a reachable panic:
  963. ```go
  964. if err := mcpgrafana.ValidateGrafanaURL(urlFromHeader); err != nil {
  965. http.Error(w, err.Error(), http.StatusBadRequest)
  966. return
  967. }
  968. client := mcpgrafana.NewGrafanaClient(ctx, urlFromHeader, apiKey, nil)
  969. ```
  970. ### Server TLS Configuration (Streamable HTTP Transport Only)
  971. When using the streamable HTTP transport (`-t streamable-http`), you can configure the MCP server to serve HTTPS instead of HTTP. This is useful when you need to secure the connection between your MCP client and the server itself.
  972. The server supports the following TLS configuration options for the streamable HTTP transport:
  973. - `--server.tls-cert-file`: Path to TLS certificate file for server HTTPS (required for TLS)
  974. - `--server.tls-key-file`: Path to TLS private key file for server HTTPS (required for TLS)
  975. **Note**: These flags are completely separate from the client TLS flags documented above. The client TLS flags configure how the MCP server connects to Grafana, while these server TLS flags configure how clients connect to the MCP server when using streamable HTTP transport.
  976. **Example with HTTPS streamable HTTP server:**
  977. ```bash
  978. ./mcp-grafana \
  979. -t streamable-http \
  980. --server.tls-cert-file /path/to/server.crt \
  981. --server.tls-key-file /path/to/server.key \
  982. -addr :8443
  983. ```
  984. This would start the MCP server on HTTPS port 8443. Clients would then connect to `https://localhost:8443/` instead of `http://localhost:8000/`.
  985. **Docker example with server TLS:**
  986. ```bash
  987. docker run --rm -p 8443:8443 \
  988. -v /path/to/certs:/certs:ro \
  989. -e GRAFANA_URL=http://localhost:3000 \
  990. -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token> \
  991. grafana/mcp-grafana \
  992. -t streamable-http \
  993. -addr :8443 \
  994. --server.tls-cert-file /certs/server.crt \
  995. --server.tls-key-file /certs/server.key
  996. ```
  997. ### Health Check Endpoint
  998. When using the SSE (`-t sse`) or streamable HTTP (`-t streamable-http`) transports, the MCP server exposes a health check endpoint at `/healthz`. This endpoint can be used by load balancers, monitoring systems, or orchestration platforms to verify that the server is running and accepting connections.
  999. **Endpoint:** `GET /healthz`
  1000. **Response:**
  1001. - Status Code: `200 OK`
  1002. - Body: `ok`
  1003. **Example usage:**
  1004. ```bash
  1005. # For streamable HTTP or SSE transport on default port
  1006. curl http://localhost:8000/healthz
  1007. # Probe a side listener while MCP stays on loopback (Kubernetes + sidecar)
  1008. ./mcp-grafana -t streamable-http --address 127.0.0.1:8000 --healthz-address :8080
  1009. curl http://127.0.0.1:8080/healthz
  1010. # With --base-path /my-base the MCP routes move under the prefix
  1011. # (/my-base/sse, /my-base/mcp), but healthz does not:
  1012. curl http://localhost:8000/healthz # 200 ok
  1013. curl http://localhost:8000/my-base/healthz # 404
  1014. ```
  1015. **Note:** The health check endpoint is only available when using SSE or streamable HTTP transports. It is not available when using the stdio transport (`-t stdio`), as stdio does not expose an HTTP server.
  1016. ### Anonymous Usage Statistics
  1017. The server can report anonymous usage statistics about itself to Grafana Labs: which tools were called, how many of those calls failed, and how the server is configured. One report covers one server **process** — not one user and not one conversation — and is sent every 4h plus once on shutdown. **Reporting is enabled by default**. To opt out, set `--usage-stats=disabled`, `GRAFANA_USAGE_STATS=disabled`, or `DO_NOT_TRACK=1`.
  1018. Tool arguments, resource names, queries, log lines, error messages and credentials are never sent. Flags are recorded by name only, never by value, and the Grafana instance is described only as `cloud` or `self_hosted` — never by URL, hostname, stack slug or org. Nothing is per user, per session or per client: there is no session identifier on the wire and no way to attribute a tool call to a particular client.
  1019. ```bash
  1020. # Turn reporting on
  1021. mcp-grafana --usage-stats=enabled
  1022. # Turn it off (or GRAFANA_USAGE_STATS=disabled)
  1023. mcp-grafana --usage-stats=disabled
  1024. # Print what would be sent, to stderr, and send nothing
  1025. GRAFANA_USAGE_STATS=log mcp-grafana
  1026. ```
  1027. `DO_NOT_TRACK=1` also disables reporting, following the cross-tool [DO_NOT_TRACK](https://donottrack.sh/) convention. Only `1` has any effect, it can only disable, and both `--usage-stats` and `GRAFANA_USAGE_STATS` override it, so a host that sets it globally can still opt one server back in.
  1028. `GRAFANA_USAGE_STATS_ENDPOINT` changes the destination. It is not an opt-out.
  1029. For the full field list, what is never sent, how to read the data and its limitations, see [Anonymous usage statistics](https://grafana.com/docs/grafana/latest/developer-resources/mcp/anonymous-usage-statistics/).
  1030. ### Observability
  1031. The MCP server supports Prometheus metrics, OpenTelemetry distributed tracing, and OpenTelemetry log export, following the [OTel MCP semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/mcp/). Tracing and log export are configured via standard `OTEL_*` environment variables and work with any transport.
  1032. **Note:** mcp-grafana currently only supports the OTLP/gRPC transport for both traces and logs. `OTEL_EXPORTER_OTLP_PROTOCOL` (and its `_TRACES_PROTOCOL` / `_LOGS_PROTOCOL` variants) are not honored — gRPC is used regardless.
  1033. #### Metrics
  1034. When using the SSE or streamable HTTP transports, enable Prometheus metrics with the `--metrics` flag:
  1035. ```bash
  1036. # Metrics served on the main server at /metrics
  1037. ./mcp-grafana -t streamable-http --metrics
  1038. # Metrics served on a separate address
  1039. ./mcp-grafana -t streamable-http --metrics --metrics-address :9090
  1040. ```
  1041. **Available Metrics:**
  1042. | Metric | Type | Description |
  1043. |--------|------|-------------|
  1044. | `mcp_server_operation_duration_seconds` | Histogram | Duration of MCP operations (labels: `mcp_method_name`, `gen_ai_tool_name`, `error_type`, `network_transport`, `mcp_protocol_version`) |
  1045. | `http_server_request_duration_seconds` | Histogram | Duration of HTTP server requests (from otelhttp) |
  1046. **Note:** Metrics are only available when using SSE or streamable HTTP transports. They are not available with the stdio transport.
  1047. When the [Loki cost guardrail](#cli-flags-reference) (`--loki-guardrail-mode`) is enabled, four more counters record its decisions:
  1048. | Metric | Type | Description |
  1049. |--------|------|-------------|
  1050. | `mcp_loki_guardrail_admitted_total` | Counter | Queries that passed every enabled check (labels: `backend`) |
  1051. | `mcp_loki_guardrail_would_block_total` | Counter | Queries that failed a check in `shadow` mode and ran anyway (labels: `backend`, `reason`) |
  1052. | `mcp_loki_guardrail_blocked_total` | Counter | Queries rejected in `enforce` mode (labels: `backend`, `reason`) |
  1053. | `mcp_loki_guardrail_fail_open_total` | Counter | Queries the guardrail could not evaluate and admitted (labels: `backend`, `cause`) |
  1054. `reason` is one of `selector`, `range`, `bytes`; `cause` is one of `unparseable`, `estimate_failed`; `backend` is one of `loki`, `victorialogs`, `unknown`. A query that trips several checks is counted once, labelled with the check that ran first (`selector`, then `range`, then `bytes`), so the four counters partition the guarded population. See [Observability](docs/sources/developer/observability-metrics-and-tracing.md#loki-cost-guardrail-metrics) for how to read them during a `shadow` → `enforce` rollout.
  1055. When the Prometheus guardrail (`--prometheus-guardrail-mode`) is enabled, four counters record its decisions in the same way:
  1056. | Metric | Type | Description |
  1057. |--------|------|-------------|
  1058. | `mcp_prometheus_guardrail_admitted_total` | Counter | Queries that passed every enabled check |
  1059. | `mcp_prometheus_guardrail_would_block_total` | Counter | Queries that failed a check in `shadow` mode and ran anyway (labels: `reason`) |
  1060. | `mcp_prometheus_guardrail_blocked_total` | Counter | Queries rejected in `enforce` mode (labels: `reason`) |
  1061. | `mcp_prometheus_guardrail_fail_open_total` | Counter | Queries admitted with an unavailable enabled assessment (labels: `reason`) |
  1062. `reason` is `selector`, `range`, `points`, or `cardinality` on `would_block` and `blocked`, counted once under the first check that failed in that order. `fail_open` uses `unparseable` or `cardinality_unknown`. The optional [cardinality policy](docs/sources/configure/command-line-flags.md#prometheus-cardinality-policy) uses cached top-N TSDB statistics to require explicit scope on known high-cardinality metrics; it does not estimate the selected series or prove that missing metrics are safe. Unsupported TSDB endpoints fail open for this policy. There is no `backend` label.
  1063. Library embedders should set `GrafanaConfig.MeterProvider` (the metrics counterpart of `GrafanaConfig.Logger`): the guardrail runs inside a tool handler, so it has no constructor option, and a process that installs a noop global `MeterProvider` would otherwise drop every recording.
  1064. #### Slow-request logging
  1065. The `--slow-request-threshold` flag emits a structured log event whenever an MCP request (tool invocation, list, resource read, etc.) exceeds the given duration. It is useful for diagnosing slow queries and tool calls without drowning in the full debug log.
  1066. ```bash
  1067. # Warn on any request slower than 500ms (works on all transports)
  1068. ./mcp-grafana -t streamable-http --slow-request-threshold 500ms
  1069. # Same thing on stdio (the feature is transport-agnostic, unlike --metrics)
  1070. ./mcp-grafana -t stdio --slow-request-threshold 500ms
  1071. # Log at INFO level instead of WARN (useful during investigation)
  1072. ./mcp-grafana -t streamable-http --slow-request-threshold 500ms --slow-request-log-level info
  1073. ```
  1074. The log event carries these structured attributes:
  1075. | Attribute | Description |
  1076. |-----------|-------------|
  1077. | `mcp.method` | The MCP method (e.g., `tools/call`, `tools/list`, `resources/read`) |
  1078. | `duration` | Observed request duration |
  1079. | `threshold` | Configured threshold |
  1080. | `tool` | Tool name (only present for `tools/call` methods) |
  1081. | `error` | Error value, when the request failed (best-effort context; content is controlled by upstream error wrapping) |
  1082. | `error.type` | Bounded-cardinality error classification (`_OTHER` for untyped errors) |
  1083. Slow-request logging works on all transports (including stdio) and does not require `--metrics`. The default threshold of `0` disables it entirely. Proxied tools flow through `tools/call` and are covered automatically.
  1084. #### Tracing
  1085. Distributed tracing is configured via standard `OTEL_*` environment variables and works independently of the `--metrics` flag. When `OTEL_EXPORTER_OTLP_ENDPOINT` (or the signal-specific `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`) is set, the server exports traces via OTLP/gRPC:
  1086. ```bash
  1087. # Send traces to a local Tempo instance
  1088. OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 \
  1089. OTEL_EXPORTER_OTLP_INSECURE=true \
  1090. ./mcp-grafana -t streamable-http
  1091. # Send traces to Grafana Cloud with authentication
  1092. OTEL_EXPORTER_OTLP_ENDPOINT=https://tempo-us-central1.grafana.net:443 \
  1093. OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic ..." \
  1094. ./mcp-grafana -t streamable-http
  1095. ```
  1096. Tool call spans follow semconv naming (`tools/call <tool_name>`) and include attributes like `gen_ai.tool.name`, `mcp.method.name`, and `mcp.session.id`. The server also supports W3C trace context propagation from the `_meta` field of tool call requests.
  1097. #### Logs
  1098. When `OTEL_EXPORTER_OTLP_ENDPOINT` (or the signal-specific `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`) is set, the server also exports structured logs via OTLP/gRPC in addition to the existing plain-text stderr output. The `otelslog` bridge automatically attaches `trace_id` and `span_id` from the active span, so log records correlate with the traces the server already emits.
  1099. Traces and logs resolve their endpoints independently, so the two signals can be enabled separately: setting only `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` enables tracing **without** log export, setting only `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` enables log export without tracing, and the generic `OTEL_EXPORTER_OTLP_ENDPOINT` enables both.
  1100. If you use the generic `OTEL_EXPORTER_OTLP_ENDPOINT` but want to disable log export (e.g. your backend does not support the `LogsService`), set:
  1101. ```bash
  1102. OTEL_LOGS_EXPORTER=none
  1103. ```
  1104. This prevents the server from creating an OTLP logs exporter regardless of the endpoint configuration, avoiding errors like `unknown service opentelemetry.proto.collector.logs.v1.LogsService`.
  1105. Stderr logging is unchanged when OTLP logging is enabled; you can continue to rely on container logs or pipe stderr to `/dev/null` if you prefer.
  1106. ```bash
  1107. # Send both logs and traces to a local OTel collector
  1108. OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 \
  1109. OTEL_EXPORTER_OTLP_INSECURE=true \
  1110. ./mcp-grafana -t streamable-http
  1111. ```
  1112. The transport is OTLP/gRPC (default port `4317`). Logs can be sent directly to any managed backend that accepts OTLP/gRPC — for example, Grafana Cloud — by pointing `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` (or the generic `OTEL_EXPORTER_OTLP_ENDPOINT`) at the remote gRPC endpoint and supplying auth via `OTEL_EXPORTER_OTLP_LOGS_HEADERS` (or `OTEL_EXPORTER_OTLP_HEADERS`), mirroring the tracing example above. A local OTel collector is **optional** — useful for fan-out, batching, or multi-backend routing, but not required.
  1113. The signal-specific variants `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`, `OTEL_EXPORTER_OTLP_LOGS_HEADERS`, `OTEL_EXPORTER_OTLP_LOGS_INSECURE`, `OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE`, `OTEL_EXPORTER_OTLP_LOGS_TIMEOUT`, and `OTEL_EXPORTER_OTLP_LOGS_COMPRESSION` are honored and override their generic `OTEL_EXPORTER_OTLP_*` counterparts — see the [OTel exporter spec](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) for the full list and precedence rules.
  1114. If the configured collector is unreachable, log records are buffered in memory (default queue: 2048) and the oldest records are dropped once the queue fills. The process continues without blocking the service. Configure a local OTel collector if you need lossless buffering during outages.
  1115. Logs are also exported under the stdio transport, which makes it easy to centralize logs from local `mcp-grafana` instances invoked by IDE clients.
  1116. **Docker example with metrics, tracing, and logs:**
  1117. ```bash
  1118. docker run --rm -p 8000:8000 \
  1119. -e GRAFANA_URL=http://localhost:3000 \
  1120. -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your token> \
  1121. -e OTEL_EXPORTER_OTLP_ENDPOINT=http://tempo:4317 \
  1122. -e OTEL_EXPORTER_OTLP_INSECURE=true \
  1123. grafana/mcp-grafana \
  1124. -t streamable-http --metrics
  1125. ```
  1126. ## Prometheus query enforcement
  1127. `--prometheus-enforced-matchers` lets an operator restrict which Prometheus series
  1128. native Prometheus tools can read, by AND-ing a fixed set of PromQL label matchers into
  1129. every vector selector in each native-Prometheus query the server issues. This is useful when a
  1130. datasource contains series that must not be exposed (e.g. metrics with sensitive tenant
  1131. or customer labels) but you cannot restrict access at the Prometheus layer.
  1132. ```bash
  1133. # Only ever read prod/staging environments (allowlist)
  1134. ./mcp-grafana --prometheus-enforced-matchers 'environment=~"prod|staging"' --disable-api --disable-rendering --disable-assistant
  1135. # Never read the vault or payments namespaces (exclusion)
  1136. ./mcp-grafana --prometheus-enforced-matchers 'namespace!~"vault|payments"' --disable-api --disable-rendering --disable-assistant
  1137. ```
  1138. How it works:
  1139. - The matchers are parsed once at startup (invalid input aborts the server) and
  1140. appended to every vector selector in each query. A user query can only ever
  1141. **narrow** results within the enforced bounds — it can never widen them.
  1142. - It covers `query_prometheus`, `query_prometheus_histogram`, and Prometheus panels in `run_panel_query`.
  1143. - Native-Prometheus discovery through `list_prometheus_label_names`,
  1144. `list_prometheus_label_values`, and `list_prometheus_metric_names` also applies
  1145. the matchers to every series selector, including when no selector is supplied.
  1146. - `list_prometheus_metric_metadata` is refused while enforcement is enabled:
  1147. Prometheus's metadata endpoint cannot filter by series labels and merges metadata
  1148. across targets. Cloud Monitoring discovery is also refused because its discovery
  1149. APIs cannot apply the full Prometheus matcher policy.
  1150. - It **fails closed**: any query that cannot be parsed is rejected rather than
  1151. sent unfiltered.
  1152. > [!IMPORTANT]
  1153. > Other enabled tools can bypass these matchers. Disable `grafana_api_request`
  1154. > with `--disable-api`, rendering tools with `--disable-rendering`, and Grafana
  1155. > Assistant with `--disable-assistant` (or `--disable-write`, unless
  1156. > `--enable-write-tools` names `ask_assistant`). In particular,
  1157. > `render_grafana_app` can send unfiltered Prometheus queries through its
  1158. > `query_datasource` source. `--disable-dsquery` closes that source, but does not
  1159. > disable server-side panel rendering. Existing dashboard snapshots can also
  1160. > contain unrestricted data; use `--disable-snapshot` when that matters.
  1161. ## Loki query enforcement
  1162. `--loki-enforced-matchers` lets an operator restrict which Loki log streams the
  1163. server can ever read, by AND-ing a fixed set of LogQL label matchers into every
  1164. native-Loki query the server issues. This is useful when a datasource contains
  1165. streams that must not be exposed (e.g. logs that may carry sensitive
  1166. information) but you cannot restrict access at the Grafana or Loki layer (OSS has
  1167. no per-datasource or per-user label access control).
  1168. ```bash
  1169. # Only ever read prod/staging environments (allowlist)
  1170. ./mcp-grafana --loki-enforced-matchers 'environment=~"prod|staging"' --disable-api
  1171. # Never read the vault or payments namespaces (exclusion)
  1172. ./mcp-grafana --loki-enforced-matchers 'namespace!~"vault|payments"' --disable-api
  1173. ```
  1174. How it works:
  1175. - The matchers are parsed once at startup (invalid input aborts the server) and
  1176. appended to every stream selector in each query. Because Loki AND-s matchers
  1177. within a selector, a user query can only ever **narrow** results within the
  1178. enforced bounds — it can never widen them. A user selector that conflicts with
  1179. the policy (e.g. asking for `{namespace="vault"}` under an exclusion) simply
  1180. returns nothing.
  1181. - It covers `query_loki_logs`, `query_loki_stats`, `query_loki_patterns`,
  1182. `list_loki_label_names`, and `list_loki_label_values`.
  1183. - It **fails closed**: any query that cannot be parsed is rejected rather than
  1184. sent unfiltered.
  1185. - **VictoriaLogs** datasources use LogsQL, which cannot be safely rewritten, so
  1186. they are refused entirely while enforcement is enabled.
  1187. - Purely-negative matchers cannot scope the label-enumeration endpoints (Loki
  1188. rejects a standalone selector with no positive matcher). Control that edge case
  1189. with `--loki-label-enumeration-fallback` (`reject` by default, or `unfiltered`
  1190. to allow unscoped enumeration of label *metadata* — log lines are never
  1191. exposed). Positive/allowlist matchers are not affected.
  1192. > [!IMPORTANT]
  1193. > Enforcement only applies to the Loki query tools. Other tools can reach Loki log
  1194. > data through paths that never touch the enforced backend, so for the restriction
  1195. > to actually hold you must also disable them:
  1196. >
  1197. > - `--disable-api` — `grafana_api_request` can query the Loki datasource proxy directly (full bypass).
  1198. > - `--disable-rendering` — `get_panel_image` renders Loki panels server-side, producing images with unrestricted log lines.
  1199. > - `--disable-assistant` — `ask_assistant` delegates to Grafana Assistant, which reads Loki server-side across all streams. Only registered when write tools are enabled, so `--disable-write` closes it too, unless `--enable-write-tools=ask_assistant` keeps it.
  1200. >
  1201. > The server logs a warning at startup naming each of these that is still enabled.
  1202. > `run_panel_query` is safe (it reuses the enforced query path). Tempo tools
  1203. > query traces, not Loki logs, so they are not a bypass. Dashboard
  1204. > snapshots (`--disable-snapshot`) can also embed log-panel data captured outside
  1205. > enforcement.
  1206. ## Troubleshooting
  1207. ### Grafana Version Compatibility
  1208. If you encounter the following error when using datasource-related tools:
  1209. ```
  1210. get datasource by uid : [GET /datasources/uid/{uid}][400] getDataSourceByUidBadRequest {"message":"id is invalid"}
  1211. ```
  1212. This typically indicates that you are using a Grafana version earlier than 9.0. The `/datasources/uid/{uid}` API endpoint was introduced in Grafana 9.0, and datasource operations will fail on earlier versions.
  1213. **Solution:** Upgrade your Grafana instance to version 9.0 or later to resolve this issue.
  1214. ## Development
  1215. Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) first — it covers what belongs in this server and how to propose it.
  1216. If you're **adding a new tool**, please [open a tool proposal](https://github.com/grafana/mcp-grafana/issues/new?template=new-tool-proposal.yml) before writing the code. Every default-on tool is sent to the model on every request by every user, so we'd rather discuss the idea than decline a finished pull request. Bug fixes, docs, tests and new parameters on existing tools need no proposal — just send a PR.
  1217. This project is written in Go. Tool versions and dev tasks live in `mise.toml`: install [mise](https://mise.jdx.dev/getting-started.html), run `mise install` to get the pinned tools, and `mise tasks` to list the tasks.
  1218. To run the server locally in STDIO mode (which is the default for local development), use:
  1219. ```bash
  1220. mise run run
  1221. ```
  1222. To run the server locally in SSE mode, use:
  1223. ```bash
  1224. go run ./cmd/mcp-grafana --transport sse
  1225. ```
  1226. You can also run the server using the SSE transport inside a custom built Docker image. Just like the published Docker image, this custom image's entrypoint defaults to SSE mode. To build the image, use:
  1227. ```
  1228. mise run build-image
  1229. ```
  1230. And to run the image in SSE mode (the default), use:
  1231. ```
  1232. docker run -it --rm -p 8000:8000 mcp-grafana:latest
  1233. ```
  1234. If you need to run it in STDIO mode instead, override the transport setting:
  1235. ```
  1236. docker run -it --rm mcp-grafana:latest -t stdio
  1237. ```
  1238. ### Testing
  1239. There are three types of tests available:
  1240. 1. Unit Tests (no external dependencies required):
  1241. ```bash
  1242. mise run test-unit
  1243. ```
  1244. You can also run unit tests with:
  1245. ```bash
  1246. mise run test
  1247. ```
  1248. 2. Integration Tests (requires docker containers to be up and running):
  1249. ```bash
  1250. mise run test-integration
  1251. ```
  1252. 3. Cloud Tests (requires cloud Grafana instance and credentials):
  1253. ```bash
  1254. mise run test-cloud
  1255. ```
  1256. > Note: Cloud tests are automatically configured in CI. For local development, you'll need to set up your own Grafana Cloud instance and credentials.
  1257. More comprehensive integration tests will require a Grafana instance to be running locally on port 3000; you can start one with Docker Compose:
  1258. ```bash
  1259. docker-compose up -d
  1260. ```
  1261. If you're adding more tools, please add integration tests for them. The existing tests should be a good starting point.
  1262. ### Linting
  1263. To lint the code, run:
  1264. ```bash
  1265. mise run lint
  1266. ```
  1267. This includes a custom linter that checks for unescaped commas in `jsonschema` struct tags. The commas in `description` fields must be escaped with `\\,` to prevent silent truncation. You can run just this linter with:
  1268. ```bash
  1269. mise run lint-jsonschema
  1270. ```
  1271. See the [JSONSchema Linter documentation](internal/linter/jsonschema/README.md) for more details.
  1272. ## License
  1273. This project is licensed under the [Apache License, Version 2.0](LICENSE).
  1274. [mcp]: https://modelcontextprotocol.io/
  1275. [service-account]: https://grafana.com/docs/grafana/latest/administration/service-accounts/#add-a-token-to-a-service-account-in-grafana

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.