Grafana MCP by usefulapi
Search dashboards, query data sources, list alert rules; add annotations in Grafana.
Should I use this
Quality & Safety
Based on automated analysis of tool definitions and protocol compliance.
Context Cost
This is the approximate number of tokens consumed each time the server's tools are loaded into a model's context. Higher counts reduce the attention available for other tasks.
Install
One-Click Install
Add this to your `claude_desktop_config.json` file:
{
"mcpServers": {
"grafana": {
"url": "https://grafana.usefulapi.io/mcp"
}
}
}Remote endpoints
https://grafana.usefulapi.io/mcpstreamable-httpWhat it can do
Tool inventory
Tools (13)
🟢grafana_get_current_user
Return the user or service account behind the token: id, login, name, the current orgId and the Grafana admin flag. Use it to check which token is in use. Grafana API: GET /api/user.
Input Schema
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢grafana_get_current_org
Return the organization the token belongs to: id, name and address. Grafana API: GET /api/org.
Input Schema
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢grafana_search(query, type, tag, folder_uids, starred, ...)
Search dashboards and folders by title, tag or folder. Each result has uid, title, type, url and folderUid. Good first call to find a dashboard uid. Grafana API: GET /api/search.
Input Schema
{
"type": "object",
"properties": {
"query": {
"description": "Text to match in the title.",
"type": "string"
},
"type": {
"description": "dash-db = dashboards, dash-folder = folders.",
"type": "string",
"enum": [
"dash-db",
"dash-folder"
]
},
"tag": {
"description": "Only items with all these tags.",
"type": "array",
"items": {
"type": "string"
}
},
"folder_uids": {
"description": "Only items in these folder uids.",
"type": "array",
"items": {
"type": "string"
}
},
"starred": {
"description": "true = only starred items.",
"type": "boolean"
},
"limit": {
"description": "Maximum number of results.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 1000
},
"page": {
"description": "Page number for pagination (default 1).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢grafana_get_dashboard(uid)
Return one dashboard by uid: its JSON model (panels, queries, variables) and metadata (version, folder, updated). Large dashboards return a large result. Grafana API: GET /api/dashboards/uid/{uid}.
Input Schema
{
"type": "object",
"properties": {
"uid": {
"type": "string",
"minLength": 1,
"description": "The Grafana uid (from a search or list tool)."
}
},
"required": [
"uid"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢grafana_list_folders(parent_uid, limit, page)
List dashboard folders: uid, title and url. Use parent_uid to list nested folders. Grafana API: GET /api/folders.
Input Schema
{
"type": "object",
"properties": {
"parent_uid": {
"description": "List only the children of this folder uid.",
"type": "string"
},
"limit": {
"description": "Maximum number of results.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 1000
},
"page": {
"description": "Page number for pagination (default 1).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢grafana_list_datasources
List the data sources of the stack: uid, name, type (for example prometheus or loki) and default flag. Use a uid with grafana_query_data. Grafana API: GET /api/datasources.
Input Schema
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢grafana_get_datasource(uid)
Return one data source by uid: name, type, url and settings (secrets are not returned). Grafana API: GET /api/datasources/uid/{uid}.
Input Schema
{
"type": "object",
"properties": {
"uid": {
"type": "string",
"minLength": 1,
"description": "The Grafana uid (from a search or list tool)."
}
},
"required": [
"uid"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢grafana_query_data(queries, from, to)
Run one or more queries against data sources (metrics, logs, traces) and return the frames. Each query names its datasource uid and the query text for that type, for example {refId, datasource:{uid}, expr} for Prometheus. Grafana API: POST /api/ds/query.
Input Schema
{
"type": "object",
"properties": {
"queries": {
"minItems": 1,
"maxItems": 26,
"type": "array",
"items": {
"type": "object",
"properties": {
"refId": {
"description": "Query id, unique in the request. Default: A, B, C in order.",
"type": "string"
},
"datasource": {
"type": "object",
"properties": {
"uid": {
"type": "string",
"minLength": 1
}
},
"required": [
"uid"
],
"description": "The data source uid, from grafana_list_datasources."
}
},
"required": [
"datasource"
],
"additionalProperties": {}
},
"description": "Query objects. Each needs datasource: {uid}; add the type's query field, for example expr for Prometheus."
},
"from": {
"default": "now-1h",
"description": "Start time: epoch ms or a relative time such as now-6h.",
"type": "string"
},
"to": {
"default": "now",
"description": "End time: epoch ms or a relative time such as now.",
"type": "string"
}
},
"required": [
"queries"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢grafana_list_org_users(query, limit)
List users and their roles in the current organization. Filter by text with query. Grafana API: GET /api/org/users.
Input Schema
{
"type": "object",
"properties": {
"query": {
"description": "Match on login, email or name.",
"type": "string"
},
"limit": {
"description": "Maximum number of results.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 1000
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢grafana_list_teams(query, page, per_page)
Search teams by name: id, uid, name, memberCount and email. Grafana API: GET /api/teams/search.
Input Schema
{
"type": "object",
"properties": {
"query": {
"description": "Text to match in the team name.",
"type": "string"
},
"page": {
"description": "Page number for pagination (default 1).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"per_page": {
"description": "Results per page (max 100).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢grafana_list_annotations(from, to, dashboard_uid, tags, type, ...)
List annotations (events on graphs) in a time range, optionally for one dashboard or tag. Times are epoch ms. Grafana API: GET /api/annotations.
Input Schema
{
"type": "object",
"properties": {
"from": {
"description": "Start time, epoch ms.",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"to": {
"description": "End time, epoch ms.",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"dashboard_uid": {
"description": "Only annotations of this dashboard uid.",
"type": "string"
},
"tags": {
"description": "Only annotations with these tags.",
"type": "array",
"items": {
"type": "string"
}
},
"type": {
"description": "annotation = manual events, alert = alert state changes.",
"type": "string",
"enum": [
"annotation",
"alert"
]
},
"limit": {
"description": "Maximum number of results.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 1000
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴grafana_create_annotation(text, time, time_end, dashboard_uid, panel_id, ...)
Add an event to a dashboard or to the stack: text, time, optional end time, tags and an optional dashboard uid and panel id. Writes data. Grafana API: POST /api/annotations.
Input Schema
{
"type": "object",
"properties": {
"text": {
"type": "string",
"minLength": 1,
"description": "The annotation text."
},
"time": {
"description": "Start time, epoch ms (default: now).",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"time_end": {
"description": "End time, epoch ms (for a range).",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"dashboard_uid": {
"description": "Attach to this dashboard uid.",
"type": "string"
},
"panel_id": {
"description": "Attach to this panel id (needs dashboard_uid).",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"tags": {
"description": "Tags for the annotation.",
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"text"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢grafana_list_alert_rules
List all alert rules of the stack with uid, title, folder, rule group, condition and labels. Grafana API: GET /api/v1/provisioning/alert-rules.
Input Schema
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}Community
Evidence