> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up Grafana in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/grafana
Last updated: 2026-11-24

Share Grafana with your team in Claude, ChatGPT and Cursor through Metorial: service account token or basic authentication sign-in, 54 tools (20 read-only).

---

To give your team Grafana in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Grafana integration in a Metorial portal, and each person connects with a service account token. Agents can manage dashboards, data sources, alerts, and observability resources in Grafana. The integration has 54 tools, 20 read-only, 22 write and 12 destructive, plus 2 triggers.

**What you will learn**

- How an admin shares Grafana in a portal and how each person connects
- What Grafana asks for when you connect, and where to find it
- How to keep the 20 read-only tools and reject the other 34

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- A service account token from Grafana for each person, or one for a shared connection
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in methods

| Method | Type | What a person provides |
| --- | --- | --- |
| **Service Account Token** (default) | API token | `instanceUrl` and `token` |
| **Basic Authentication** | Custom credentials | `instanceUrl`, `username` and `password` |

The portal and `metorial setup` use **Service Account Token** unless someone picks another method.

### Service Account Token

To connect, a person enters these values:

- `instanceUrl`: Base URL of the Grafana instance, e.g. https://your-grafana.grafana.net
- `token`: Grafana Service Account token. Create one under Administration > Users and access > Service Accounts.

### Basic Authentication

To connect, a person enters these values:

- `instanceUrl`: Base URL of the Grafana instance, e.g. https://your-grafana.grafana.net
- `username`: Grafana username
- `password`: Grafana password

### Setup settings

Whichever method you pick, setup also asks for:

- `instanceUrl`: Base URL of the Grafana instance, e.g. https://your-grafana.grafana.net or https://grafana.example.com. Do not include a trailing slash or /api path.
- `organizationId` (optional): Organization ID to scope API requests to. If not set, the default organization context is used.
- `apiNamespace` (optional): Grafana App Platform namespace for /apis endpoints. Defaults to "default" for org 1 or org-&lt;organizationId> when organizationId is set. Grafana Cloud stacks can use stacks-&lt;stack_id>.

## Admin: share Grafana in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose Grafana. Under **Auth Method**, keep **Service Account Token** or pick another. For how members connect, choose **Each person connects** so everyone enters their own service account token, or **Shared connection** to enter one service account token for everyone.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from Grafana.

4. **Choose who gets it**

   Add the access groups that should see Grafana. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user Grafana integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search grafana
```

## Employee: connect Grafana

### In the portal

1. **Open Grafana in the catalog**

   Sign in to your portal and open Grafana. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. In the setup window, enter your service account token (instanceUrl and token).

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search grafana
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. `metorial setup` uses **Service Account Token**. To connect with **Basic Authentication** instead, find its ID with `metorial catalog get <catalog-item-id>` and add `--auth-method <auth-method-id>`.

### Add it to your AI client

`metorial install` adds your Grafana connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list grafana
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 20 read-only tools, such as `get_team` and `get_folder`, and lose the 22 write tools, such as `create_team` or `update_team`, and the 12 destructive tools, such as `delete_team` or `delete_folder`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list grafana
metorial tools <integration-id>
metorial call <integration-id> list_org_users -d '{}'
```

`metorial tools` lists the 54 tools, minus any you rejected. `list_org_users` takes no input. It lists all users in the current organization with their roles.

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (20)

- `get_dashboard`: Retrieve a dashboard by its UID, including the full dashboard model, metadata, folder information, and version history details. Needs `dashboardUid`.
- `find_annotations`: Search and filter annotations in Grafana.
- `get_alert_rule`: Retrieve a specific alert rule by its UID, including full condition configuration, labels, and annotations. Needs `ruleUid`.
- `get_team_members`: List all members of a team by team ID. Needs `teamId`.
- `get_notification_policies`: Retrieve the notification policy tree that controls how alerts are routed to contact points.
- `get_data_source`: Retrieve detailed information about a specific data source by its UID, including connection settings and configuration. Needs `dataSourceUid`.
- `list_contact_points`: List all contact points configured for alert notifications.
- `list_folders`: List all folders in the Grafana instance.
- `list_alert_rules`: List all Grafana-managed alert rules configured in the instance, including their conditions, evaluation intervals, and notification settings.
- `search_teams`: Search and list teams in the current organization.
- `search_dashboards`: Search and list dashboards in Grafana.
- `list_snapshots`: List dashboard snapshots.
- `list_data_sources`: List all configured data sources in the Grafana instance, including their types, URLs, and connection details.
- `list_org_users`: List all users in the current organization with their roles.
- `get_team`: Retrieve a Grafana team by ID, including its name, email, and timestamps. Needs `teamId`.
- `list_mute_timings`: List alert notification mute timings configured in Grafana.
- `list_playlists`: List Grafana playlists.
- `get_folder`: Retrieve a folder by UID, including its title, URL, parent folder, and version metadata. Needs `folderUid`.
- `get_playlist`: Retrieve a Grafana playlist by UID, including its rotation interval and dashboard selectors. Needs `playlistUid`.
- `get_mute_timing`: Retrieve a mute timing by name, including its configured recurring time intervals and provenance. Needs `name`.

### Write tools (22)

- `update_alert_rule`: Update an existing Grafana-managed alert rule. Needs `ruleUid`, `title`, `folderUid`, `ruleGroup`, `condition` and `queries`.
- `create_annotation`: Create a new annotation to mark an event on a dashboard or across the organization. Needs `text`.
- `update_folder`: Update a folder's title by its UID. Needs `folderUid` and `title`.
- `create_contact_point`: Create a new contact point for alert notifications. Needs `name`, `type` and `settings`.
- `create_folder`: Create a new folder for organizing dashboards. Needs `title`.
- `create_snapshot`: Create a dashboard snapshot for sharing. Needs `dashboard`.
- `create_data_source`: Create a new data source connection. Needs `name` and `type`.
- `create_alert_rule`: Create a new Grafana-managed alert rule. Needs `title`, `folderUid`, `ruleGroup`, `condition` and `queries`.
- `update_org_user_role`: Change a user's role within the current organization. Needs `userId` and `role`.
- `save_dashboard`: Create a new dashboard or update an existing one. Needs `dashboard`.
- `update_notification_policies`: Update the notification policy tree. Needs `receiver`.
- `add_org_user`: Add a user to the current organization with a specified role. Needs `loginOrEmail` and `role`.
- `create_team`: Create a new team in the current organization. Needs `name`.
- `add_team_member`: Add a user to a team by their user ID. Needs `teamId` and `userId`.
- `update_data_source`: Update an existing data source's configuration by its UID. Needs `dataSourceUid`.
- `update_annotation`: Update an existing annotation's text, tags, or time range. Needs `annotationId`.
- `create_mute_timing`: Create a mute timing for Grafana alert notification policies. Needs `name` and `timeIntervals`.
- `update_contact_point`: Update an existing alert notification contact point by UID. Needs `contactPointUid`, `name`, `type` and `settings`.
- `update_team`: Update a Grafana team's name and optional email address by ID. Needs `teamId` and `name`.
- `create_playlist`: Create a Grafana playlist that cycles through dashboards selected by UID or tag. Needs `playlistUid`, `title`, `interval` and `items`.
- `update_playlist`: Replace an existing Grafana playlist definition. Needs `playlistUid`, `title`, `interval` and `items`.
- `update_mute_timing`: Replace an existing mute timing by name. Needs `name` and `timeIntervals`.

### Destructive tools (12)

- `delete_alert_rule`: Delete a Grafana-managed alert rule by its UID. Needs `ruleUid`.
- `delete_annotation`: Delete an annotation by its ID. Needs `annotationId`.
- `delete_folder`: Delete a folder and optionally all alert rules within it. Needs `folderUid`.
- `remove_team_member`: Remove a user from a team. Needs `teamId` and `userId`.
- `delete_data_source`: Permanently delete a data source by its UID. Needs `dataSourceUid`.
- `delete_contact_point`: Delete a contact point by its UID. Needs `contactPointUid`.
- `remove_org_user`: Remove a user from the current organization. Needs `userId`.
- `delete_snapshot`: Delete a dashboard snapshot by its key. Needs `key`.
- `delete_dashboard`: Permanently delete a dashboard by its UID. Needs `dashboardUid`.
- `delete_team`: Delete a team by its ID. Needs `teamId`.
- `delete_mute_timing`: Delete a mute timing by name. Needs `name`.
- `delete_playlist`: Delete a Grafana playlist by UID. Needs `playlistUid`.

## Triggers

Grafana has 2 triggers, which fire on events in Grafana:

- `alert_notification`: Receives Grafana alert notifications via webhook.
- `annotation_events`: [Polling fallback] Polls for new annotations in Grafana.

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use Grafana there
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [Grafana on metorial.com](https://metorial.com/integrations/grafana): the integration overview