analytics
Grafana MCP, CLI, and Lua Integration for AI Agents
Grafana integration docs for AI agents: MCP gateway setup, Grafana CLI commands, Lua API reference, credentials, and function schemas.
7 functions 6 read 1 write API token auth
Grafana for agents
Credentials can be configured manually in web or CLI hosts.
Use this integration from Lua code mode, the headless integrations CLI, or the KosmoKrator MCP gateway. The same package metadata powers all three surfaces.
Machine-Readable Metadata
- integration_slug
grafana- route_slug
grafana- package
grafana- auth_strategy
api_tokenAPI token- cli_setup_supported
true- cli_runtime_supported
true- mcp_gateway_supported
true- lua_supported
true- supports_multi_account
true
Quick Links
Lua APIAgent-facing namespace and function reference. Grafana CLIHeadless setup and direct function calls. Grafana MCPMCP gateway setup for external clients. Submit feedbackReport missing tools, auth problems, wrong docs, or runtime issues. ContributeAdd tools or improve metadata in the integrations repo.
Grafana MCP Client Matrix
Use these pages when a specific agent client or framework needs copy-pasteable MCP setup for Grafana.
Claude Code Grafana MCP setup for Claude Code. Cursor Grafana MCP setup for Cursor. Codex Grafana MCP setup for Codex. OpenAI Agents Grafana MCP setup for OpenAI Agents SDK. Claude Agent SDK Grafana MCP setup for Claude Agent SDK. Vercel AI SDK Grafana MCP setup for Vercel AI SDK. LangChain Grafana MCP setup for LangChain. LangGraph Grafana MCP setup for LangGraph. CrewAI Grafana MCP setup for CrewAI. MCP clients Grafana MCP setup for Generic MCP Clients.
Grafana CLI Matrix
Use these pages for direct Grafana CLI workflows in scripts, CI, cron, and agent wrappers.
CI Grafana CLI for CI. Cron Jobs Grafana CLI for cron jobs. Shell Scripts Grafana CLI for shell scripts. Headless Automation Grafana CLI for headless automation. Coding Agents Grafana CLI for coding agents.
Function Catalog
| Function | Type | Parameters | Description |
|---|---|---|---|
grafana.grafana_list_dashboards | Read read | 3 | Search and list Grafana dashboards. Returns dashboard UIDs, titles, and folder info. Use query to filter by title. |
grafana.grafana_get_dashboard | Read read | 1 | Get a Grafana dashboard by its UID. Returns the full dashboard definition including panels, queries, and settings. |
grafana.grafana_create_dashboard | Write write | 3 | Create or update a Grafana dashboard. Provide the full dashboard JSON with panels, queries, and settings. Set overwrite to true to update an existing dashboard. |
grafana.grafana_list_datasources | Read read | 0 | List all configured datasources in Grafana. Returns datasource IDs, names, types (e.g., Prometheus, InfluxDB), and access info. |
grafana.grafana_list_alerts | Read read | 2 | List Grafana alerts. Optionally filter by dashboard ID or panel ID. Returns alert states, thresholds, and conditions. |
grafana.grafana_list_teams | Read read | 2 | List all Grafana teams. Returns team IDs, names, emails, and member counts with pagination support. |
grafana.grafana_get_current_user | Read read | 0 | Get the currently authenticated Grafana user. Useful for verifying credentials and identifying the connected account. |