get_health
Grafana health
Check the Grafana instance is reachable and return its version and database status.
无需输入参数。

io.github.dockndevai由 GitHub 账号 dockndevai 发布v0.3.3更新于 Oct 27, 2026
Search & edit Grafana dashboards, query datasources (PromQL/LogQL/SQL), inspect alerts.
面向 Grafana 的本地 MCP 服务器:让助手搜索和读取仪表板、查询 Prometheus/Loki/SQL 数据源,并查看告警与注释。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
参照 仓库 中的启动说明。
A safe-by-default Model Context Protocol server for Grafana. It lets an agent explore and operate Grafana — search dashboards, read the dashboard JSON model, list and query datasources (Prometheus / Loki / SQL), inspect alert rules and annotations, and (in higher modes) create/update dashboards and folders, write annotations, and delete.
Part of the dockndevai MCP server suite — one governance model across all of them.
The server starts read-only (see Safe by default); higher-capability tools are only registered when you raise the mode.
You need a Grafana service account token (Administration → Service accounts → Add service account → Add token). Give it the least role that works — Viewer for read-only use, Editor to create/update, Admin only if you must delete.
See docs/CLIENTS.md for Claude Code / Cursor / Codex / VS Code / Windsurf snippets, and .env.example for every supported variable.
The access model is enforced by src/security.ts — defence in depth on top of the service-account token's own role:
GRAFANA_MODE — read-only (default) → read-write → admin. A tool is registered only if the mode allows its capability. Read-only exposes the 11 read tools; edits need read-write; deletes need admin.GRAFANA_ALLOW_DELETE — deletes are irreversible, so on top of admin mode they also require this flag.GRAFANA_FOLDER_ALLOWLIST / GRAFANA_PROTECTED_FOLDERS — confine which folders can be written to; mark folders (e.g. production) that may be read but never modified or deleted.GRAFANA_DATASOURCE_ALLOWLIST — restrict which datasources query_datasource may hit.GRAFANA_DRY_RUN — validate and log writes without executing them.GRAFANA_AUDIT_LOG — a JSON audit line per guarded operation, on stderr (default on).GRAFANA_ALLOW_DELETE gate.secureJsonData, passwords and tokens are stripped from every response.See SECURITY.md.
Conventions for the dashboard JSON model, panel/target shapes, PromQL/LogQL/SQL query patterns, folder organisation and safe editing live in the bundled skill: .claude/skills/grafana-dashboards-and-queries/SKILL.md. Agents that load it can build and edit dashboards to a consistent standard without being re-taught each time.
MIT
来源:README.md,提交 3216c7b
Grafana health
Check the Grafana instance is reachable and return its version and database status.
无需输入参数。
Search dashboards & folders
Search dashboards and folders by name/tag. Use this first to find a dashboard's UID before get_dashboard. Returns title, uid, type (dash-db | dash-folder), folder and tags.
tagtypelimitqueryList dashboards
List dashboards (optionally filtered by tag). Shorthand for search with type=dash-db.
taglimitGet dashboard
Return the full dashboard JSON model (panels, targets, templating, time) plus meta (folder, version, url) for a dashboard UID. This is the model you edit and pass back to create_or_update_dashboard.
uid必填List folders
List dashboard folders with their UIDs and titles.
无需输入参数。
Get folder
Return a folder's details by UID.
uid必填List datasources
List configured datasources (uid, name, type, url). Secrets (secureJsonData, passwords, tokens) are never returned. Use the uid with query_datasource.
无需输入参数。
Get datasource
Return a single datasource by UID (secrets redacted).
uid必填Query a datasource
Run a query against a datasource through Grafana's unified query API and return the result frames. For Prometheus/Loki set `expr` (PromQL / LogQL); for SQL datasources set `rawSql`. Reading data only — this never mutates anything. Use a bounded time range and a small maxDataPoints to keep results manageable.
toexprfromrawSqldatasourceUid必填maxDataPointsList alert rules
List Grafana-managed alert rules (via the provisioning API): title, condition, folder, state.
无需输入参数。
List annotations
List annotations (events overlaid on graphs), optionally within a time range or by tag.
tofromtagslimit已满足适用检查项的 90%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
npx -y @dockndevai/mcp-grafana{ "mcpServers": { "grafana": { "command": "npx", "args": ["-y", "@dockndevai/mcp-grafana"], "env": { "GRAFANA_URL": "http://localhost:3000", "GRAFANA_TOKEN": "glsa_...", "GRAFANA_MODE": "read-only" } } }}npm installnpm run buildGRAFANA_URL=http://localhost:3000 GRAFANA_TOKEN=glsa_… node dist/index.js# introspect without a live Grafana:echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | GRAFANA_TOKEN=x node dist/index.js