# Grafana — how to use (mcp.ai)

Connect your Grafana account and use 11 tools for developer tools straight from your AI agent. Connect with your own API key. Open and composable observability platform for metrics, logs, and traces.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_grafana?ms=1787296080000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `grafana_create_otlp_v1_logs`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/grafana`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/grafana/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/grafana/create/otlp/v1/logs` — Tool to create OTLP v1 logs in Grafana Loki. Use when you need to send OpenTelemetry Protocol logs to Grafana for ingestion and storage.
  - body: { resourceLogs: object[] }
- `POST https://api.mcp.ai/api/grafana/get/distributor/ha/tracker` — Tool to retrieve distributor HA tracker status. Use when you need to check which replica has been elected as leader for each Prometheus HA cluster.
- `POST https://api.mcp.ai/api/grafana/get/health` — Check Grafana server health and database connectivity. Returns 'ok' if Grafana's web server is running and can access the database. Use when you need to verify Grafana instance availability before per
- `POST https://api.mcp.ai/api/grafana/get/index/gateway/ring` — Tool to retrieve the index gateway hash ring status from Grafana Loki. Returns information about the state, health, and last heartbeat time of each index gateway in the ring.
- `POST https://api.mcp.ai/api/grafana/get/overrides/exporter/ring` — Tool to retrieve the overrides-exporter hash ring status as an HTML page. Use when you need to check the state, health, and heartbeat information of overrides-exporter instances. Only accessible when 
- `POST https://api.mcp.ai/api/grafana/get/ruler/ring` — Tool to retrieve the ruler ring status from Grafana Mimir. Use when you need to check the distributed hash ring topology and operational status of ruler instances.
- `POST https://api.mcp.ai/api/grafana/get/status` — Tool to check if a valid Grafana Enterprise license is available. Use when you need to verify license status or availability.
- `POST https://api.mcp.ai/api/grafana/get/store/gateway/tenants` — Retrieves store gateway tenants. Returns a list of tenants that have blocks stored in the store-gateway's configured storage. Use when you need to view which tenants have data stored on a store-gatewa
- `POST https://api.mcp.ai/api/grafana/post/acs` — Tool to perform SAML Assertion Consumer Service (ACS) operation. Use when processing SAML authentication responses from an identity provider. This endpoint typically handles the SAML assertion and ret
  - body: { relay_state?: string, saml_response: string }
- `POST https://api.mcp.ai/api/grafana/query/public/dashboard` — Query a panel on a public Grafana dashboard to retrieve time-series data and metrics. Use when you need to fetch visualization data from a publicly shared dashboard without authentication. Returns dat
  - body: { to: string, from: string, panel_id: integer, intervalMs?: integer, access_token: string, maxDataPoints?: integer, base_url_override?: string }
- `POST https://api.mcp.ai/api/grafana/retrieve/jwks` — Tool to retrieve JSON Web Key Set (JWKS) with all public keys for token verification. Use when you need to get the keys that can verify JWT tokens.

## Example prompts
- "What can I do in Grafana?"
- "Show me a summary of my Grafana account"

## More
- Page: https://mcp.ai/grafana
- Agent spec (llms.txt): https://mcp.ai/grafana/llms.txt
- Postman collection: https://mcp.ai/grafana/postman.json
