# Grafana — Pipedream Connect

> Open and composable observability platform

- API slug: `grafana` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Data Analytics
- Website: https://grafana.com/
- This page (HTML): https://pipedream.com/apps/grafana
- Tools: 10 actions · 0 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: grafana`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "grafana",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Create Annotation:
const result = await mcp.callTool({
  name: "grafana-create-annotation",
  arguments: {
    text: "Text",
    dashboardUid: "Dashboard UID",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Grafana endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://api.example.com/v1/me

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuZXhhbXBsZS5jb20vdjEvbWU?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "grafana-create-annotation",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    grafana: { authProvisionId: "apn_xxxxxxx" },
    text: "Text",
    dashboardUid: "Dashboard UID",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (10)

### `grafana-create-annotation` — Create Annotation (Write)

Create an annotation on a dashboard or globally. Annotations mark events like deployments, incidents, or configuration changes on dashboard timelines. Use Search Dashboards to find the dashboard UID. Omit dashboardUid for a global annotation visible on all dashboards. Use time and timeEnd for range…

Full schema: https://pipedream.com/apps/grafana/actions/create-annotation.md

### `grafana-delete-dashboard` — Delete Dashboard (Write)

Permanently delete a Grafana dashboard by UID. This cannot be undone. Use Search Dashboards to find the dashboard UID.

Full schema: https://pipedream.com/apps/grafana/actions/delete-dashboard.md

### `grafana-get-current-user` — Get Current User (Read-only)

Get the current authenticated Grafana user's identity, including user ID, name, email, organization, and role. Use this to understand the user's permissions and organizational context. The user ID and org context may be needed when creating dashboards or filtering resources.

Full schema: https://pipedream.com/apps/grafana/actions/get-current-user.md

### `grafana-get-dashboard` — Get Dashboard (Read-only)

Get the full dashboard model by UID, including all panels, their queries, variables, and configuration. Use Search Dashboards first to find the dashboard UID. The returned model can be modified and saved back with Save Dashboard.

Full schema: https://pipedream.com/apps/grafana/actions/get-dashboard.md

### `grafana-list-alert-rules` — List Alert Rules (Read-only)

List all alert rules with their current state (firing, normal, pending, inactive). Returns rule definitions including conditions, labels, and annotations. Use this to answer questions like 'what alerts are firing?' or 'what alerts exist for service X?'

Full schema: https://pipedream.com/apps/grafana/actions/list-alert-rules.md

### `grafana-list-data-sources` — List Data Sources (Read-only)

List all configured data sources (Prometheus, Loki, InfluxDB, MySQL, etc.), their types, and UIDs. Use the data source UID with Query Data Source to execute queries. The type field indicates what query language to use (e.g., prometheus → PromQL, loki → LogQL, mysql → SQL).

Full schema: https://pipedream.com/apps/grafana/actions/list-data-sources.md

### `grafana-list-folders` — List Folders (Read-only)

List all dashboard folders. Folders organize dashboards into logical groups. Use folder UIDs with Search Dashboards to filter by folder, or with Save Dashboard to place a dashboard in a specific folder.

Full schema: https://pipedream.com/apps/grafana/actions/list-folders.md

### `grafana-query-data-source` — Query Data Source (Read-only)

Execute a query against any configured data source. Use List Data Sources first to discover available data sources and their UIDs. The query language depends on the data source type:

Full schema: https://pipedream.com/apps/grafana/actions/query-data-source.md

### `grafana-save-dashboard` — Save Dashboard (Write)

Create or update a Grafana dashboard. This is an upsert operation — if the dashboard UID exists, it updates; otherwise it creates. Use Get Dashboard to retrieve an existing dashboard model before modifying it. Use List Folders to find the target folder UID. Pass overwrite: true to force-save over…

Full schema: https://pipedream.com/apps/grafana/actions/save-dashboard.md

### `grafana-search-dashboards` — Search Dashboards (Read-only)

Search for dashboards by title, tag, or folder. Returns dashboard UIDs, titles, URLs, tags, and folder info. Use the UID with Get Dashboard to retrieve the full dashboard model. Use List Folders to discover folder UIDs for filtering.

Full schema: https://pipedream.com/apps/grafana/actions/search-dashboards.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
