Registry / observability / mcp-grafana

mcp-grafana

JSON →
library0.14.0pypypiunverified

MCP server for Grafana – enables AI agents to interact with Grafana via the Model Context Protocol. Current version: 0.14.0. Released roughly monthly by Grafana Labs.

pip install mcp-grafana
INSTALL
IMPORT
SIG · MCP-GRAFANA
M
mcp-grafana
observabilitypythonv0.14.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Server
from mcp_grafana import Server
from mcp import Server

Run the Grafana MCP server. Requires GRAFANA_URL and GRAFANA_API_KEY environment variables.

import os from mcp_grafana import main # Set environment variables for authentication os.environ['GRAFANA_URL'] = os.environ.get('GRAFANA_URL', 'http://localhost:3000') os.environ['GRAFANA_API_KEY'] = os.environ.get('GRAFANA_API_KEY', '') # Run the MCP server if os.environ['GRAFANA_API_KEY']: main() else: print('Set GRAFANA_API_KEY environment variable')
mcp-grafana --version
Debug
Known issues
breakingIn v0.13.0 the `search_logs` tool was removed. Tools that relied on it will fail.
fix
Use `search_logs` substitute if available, or query logs via `generic_request` tool added in v0.14.0.
affects: >=0.13.0
gotchaThe `GRAFANA_URL` must not have a trailing slash; mcp-grafana trim logic may cause double slashes in paths.
fix
Set GRAFANA_URL without trailing slash (e.g., http://localhost:3000).
affects: >=0.12.1
gotchaOpenTelemetry OTLP trace and log export is enabled only when environment variables `OTEL_EXPORTER_OTLP_ENDPOINT` or `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` are set. No telemetry by default.
fix
Set the environment variables to enable OTLP export.
affects: >=0.14.0
Upgrade
Version history
0.14.0latest on PyPI · released May 8, 2026
Audit
Dependencies
mcprequiredCore MCP server framework
grafana-clientrequiredInteracting with Grafana API
Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
2
Resources
mcp-grafana — pip install mcp-grafana · libregistry