grafana-mcp-adapter
Provides tools for searching and retrieving Grafana dashboards, listing datasources, running PromQL/LogQL queries, and generating Grafana Explore links for log previews.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@grafana-mcp-adapterShow me the engine logs for Contoso over the last 6 hours."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
grafana-mcp-adapter
Read-only MCP server that exposes Grafana dashboards, datasources and metric/log queries as tools, for use by skills in the TICKETS workspace.
This is a private, standalone adapter: its own git repo, its own .env. It is
not part of ia-tooling and does not depend on its stack — it only makes HTTPS
calls out to the Grafana HTTP API (${GRAFANA_BASE_URL}/api). It was scaffolded by
cloning the structure of fathom-mcp-adapter.
Architecture
The adapter is the MCP server. Internally it calls the Grafana HTTP API directly (just as the Fathom adapter calls Fathom's REST API). MCP servers are not chained to one another.
Auth: a Grafana service account token sent as a Bearer token in the
Authorizationheader. Scope it to a read-only role (Viewer). Create the service account + token in Grafana → Administration → Service accounts.Most tools return raw payloads (dashboard JSON, datasource lists). The exceptions are the high-volume ones:
grafana_queryreturns a compact per-series digest by default (a fullupquery is ~8 MB of frames, far past what an MCP context wants), andgrafana_logs_linkreturns a capped preview. Both can be pushed back toward raw (raw=true/ a higherlimit).Read-only by design. Note that
grafana_queryis aPOST(Grafana's/api/ds/queryis POST-shaped) but only reads metrics/logs.
Related MCP server: mcp-grafana
Tools
Tool | Purpose |
| Config/connectivity check (makes one authenticated call). |
| Search dashboards by title substring and/or tags. |
| Full dashboard JSON by |
| List configured datasources (uid, name, type). |
| Run a PromQL/LogQL/etc. query against a datasource uid over a time range. Returns a per-series digest by default. |
| Build a permanent Grafana Explore (Loki) deep link for a customer's logs and return a preview of recent lines. |
grafana_query response shape
The raw /api/ds/query response carries a full timestamp+value array per series,
and a query like up can return thousands of series (~8 MB). By default the tool
collapses each series to its labels + a numeric digest and caps the list:
{
"results": {
"A": {
"status": 200,
"series_count": 3085, // total series before capping
"series": [ // capped to maxSeries (50)
{ "labels": { "job": "..." }, "count": 60, "first": 1, "last": 1, "min": 0, "max": 1, "avg": 0.98 }
],
"truncated": 3035 // how many series were dropped from `series`
}
}
}Pass raw=true to get the full (potentially very large) frames instead.
grafana_logs_link
Identify a customer/component with free text (client='april',
component='gateway'); it matches case-insensitively against the service_name
label, which on this instance encodes both (e.g.
graviteeio-ae-april-rec-engine). Returns { query, explore_url, range, preview_count, preview } — paste explore_url (a permanent Grafana 11+ Explore
link) into the ticket. The default range is the last hour; widen with
from/to. When nothing matches, it returns close service_name values as
suggestions so typos like aprl → april surface.
Examples (how a user asks for it)
Just ask in plain language — the agent maps it to the client / component /
from / to / line_filter arguments for you.
"Give me the last hour of API gateway logs for Northwind." →
{ "client": "northwind", "component": "gateway" }
"Show me the engine logs for Contoso over the last 6 hours." →
{ "client": "contoso", "component": "engine", "from": "now-6h" }
"Find the gateway errors for Globex in the last 3 hours, give me up to 200 lines." →
{ "client": "globex", "component": "gateway", "line_filter": "error", "from": "now-3h", "limit": 200 }
"I need the UI logs for Initech during yesterday's incident between 10:00 and 11:00." →
{ "client": "initech", "component": "ui", "from": "<epoch ms 10:00>", "to": "<epoch ms 11:00>" }
"Give me the production gateway logs for Northwind." →
{ "client": "northwind prod", "component": "gateway" }
(The environment — prod, rec, dev — isn't a separate argument: it lives
inside service_name, so just fold it into client as another word. Both
client and component are matched as case-insensitive substrings with .*
between them, so northwind prod matches …-northwind-prod-….)
Each call returns explore_url — paste it into the ticket as a permanent link —
plus a capped preview of the newest matching lines.
Setup
npm install
cp .env.example .env # then fill in GRAFANA_BASE_URL and GRAFANA_TOKEN
npm test
npm start # speaks MCP over stdioGRAFANA_TOKEN must come from .env (which is git-ignored) — never hardcode it.
Wiring into the TICKETS MCP session
Build the image and add a grafana entry to the TICKETS .mcp.json, alongside
fathom / zendesk / vectordb / github. It only needs HTTPS egress.
docker build -t grafana-mcp-adapter .// .mcp.json (TICKETS)
{
"mcpServers": {
"grafana": {
"command": "docker",
"args": ["run", "--rm", "-i", "--env-file", "/ABSOLUTE/PATH/TO/.env", "grafana-mcp-adapter"]
}
}
}Available Tools
6 toolsgrafana_get_dashboardA
Read-only fetch of a Grafana dashboard's full JSON by uid (panels, variables, queries, meta). Get the uid from grafana_search_dashboards.
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. Description calls it 'read-only', implying safety, but lacks details on side effects, permissions, or error conditions. Adequate but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, concise, front-loaded with key info. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Explains output content (full JSON with panels, variables, queries, meta) despite no output schema. Mentions prerequisite step. Minor gap: no mention of pagination or size limits.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has no description for 'uid'. Description adds that uid is the dashboard identifier and should come from search results, compensating for low schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description specifies a read-only fetch of a Grafana dashboard's full JSON by uid, listing contained elements (panels, variables, queries, meta). It differentiates from sibling tools by indicating uid source.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states to get uid from grafana_search_dashboards, providing a clear prerequisite. Does not list exclusions or alternatives but contextualizes usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grafana_healthA
Read-only Grafana health/config check.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states 'read-only' but does not specify what exact information the check returns (health vs config details). Minimal transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise: one short sentence that conveys the essential purpose. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no parameters, no output schema, and a simple health check, the description is adequate but could mention what information is returned (e.g., 'returns health status and config summary').
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, and schema coverage is 100%. The description adds no parameter meaning since there are none. Baseline score is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Read-only Grafana health/config check', using a specific verb ('check') and resource ('Grafana health/config'). It distinguishes from siblings like grafana_query or grafana_get_dashboard.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use or when-not-to-use guidance. The function is self-evident as a health check, but there are no exclusions or alternatives mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grafana_list_datasourcesA
Read-only list of configured Grafana datasources. Returns uid, name, type and is_default. Use a datasource uid with grafana_query.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description explicitly states the tool is 'Read-only', which is a key behavioral trait. With no annotations provided, the description carries the full burden and adequately discloses that the tool does not mutate state. It also mentions the return fields, adding transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the core purpose, and a second sentence providing a usage hint. No unnecessary words, every sentence adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no parameters and no output schema, the description is fully complete. It states the read-only nature, the returned fields, and a practical usage hint. No additional information is needed for an agent to use this tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has no parameters, so schema coverage is trivially 100%. The description does not add parameter information because there are none. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool is a 'Read-only list of configured Grafana datasources' and specifies the returned fields (uid, name, type, is_default). It distinguishes itself from sibling tools like grafana_query and grafana_get_dashboard by focusing solely on datasource listing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a clear usage hint: 'Use a datasource uid with grafana_query,' which indicates a common workflow. It does not explicitly mention when not to use this tool, but given the sibling tools are all distinct (no other list tool), this is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grafana_logs_linkA
Read-only: build a permanent Grafana Explore (Loki) link for a customer's logs AND return a preview of the most recent lines. Identify the customer/component with free text (e.g. client='april', component='gateway') — it matches case-insensitively against the service_name label, which encodes both. Optionally narrow with line_filter (substring that must appear in the log line). Default range is the last 1 hour; widen with from/to (e.g. from='now-6h'). Returns { query, explore_url, range, preview_count, preview }. Paste explore_url into the ticket; ask the user before widening the range since logs are large.
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Range end, e.g. 'now' or epoch ms. | now |
| from | No | Range start, e.g. 'now-1h', 'now-6h', or epoch ms. | now-1h |
| limit | No | Max preview lines (newest first). | |
| client | Yes | Customer name fragment, e.g. 'april', 'alliander', 'apim-cloudgate'. | |
| component | No | Component fragment, e.g. 'gateway', 'engine', 'ui'. | |
| line_filter | No | Only lines containing this substring. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses that client/component matching is case-insensitive against service_name label, default range is 1 hour, and the return format. Since no annotations are provided, the description carries the burden well.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single paragraph front-loaded with purpose, but includes procedural details. Could be slightly more structured, but remains concise given the information density.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Describes the return object with fields like query, explore_url, range, preview_count, preview, compensating for lack of output schema. Context with siblings is clear.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Adds meaning beyond the schema: explains how client and component map to service_name, that from/to have defaults, and that line_filter matches substrings. Schema coverage is 100%, so baseline is 3, but description adds value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool builds a permanent Grafana Explore link for logs and returns a preview of recent lines. It identifies the customer/component using free text, distinguishing itself from sibling query tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides guidelines on pasting the URL into a ticket and warns about widening the range due to large logs. However, it does not explicitly contrast with sibling tools like grafana_query.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grafana_queryA
Read-only metric/log query via Grafana's /api/ds/query. Provide the datasource uid (from grafana_list_datasources), a raw expression (PromQL for Prometheus, LogQL for Loki, etc.), and an optional time range. By default returns a compact per-series digest (labels + count/first/last/min/max/avg); pass raw=true for the full (potentially very large) frames.
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Range end, e.g. 'now' or epoch ms. | now |
| raw | No | Return the full raw frames instead of the per-series digest. Can be very large. | |
| expr | Yes | Query expression (PromQL/LogQL/etc.). | |
| from | No | Range start, e.g. 'now-1h' or epoch ms. | now-1h |
| datasource_uid | Yes | Datasource uid from grafana_list_datasources. | |
| max_data_points | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully discloses read-only nature, potential for large raw frames, and default digest format. This covers safety and size risks.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences with no wasted words. First sentence states purpose and endpoint, second and third provide usage and behavior. Efficient and front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, description explains return format (digest vs raw). Covers all required and optional parameters, references another tool, and mentions query language variations. Complete for a query tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 83% description coverage; description adds value by explaining datasource_uid source, expr language types, optional time range, and raw effect. Slight improvement over schema alone.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it is a 'Read-only metric/log query' via a specific API endpoint, with verb 'query' and resource 'metric/log'. It distinguishes from sibling tools like grafana_health or grafana_search_dashboards.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides explicit prerequisite (datasource uid from grafana_list_datasources), explains the raw parameter trade-off, and suggests default time range. It does not explicitly say when not to use but gives enough context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
grafana_search_dashboardsA
Read-only search of Grafana dashboards (by title substring and/or tags). Returns uid, title, folder, tags and url for each. Use the uid with grafana_get_dashboard to fetch the full dashboard JSON.
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | Filter by dashboard tags. | |
| limit | No | ||
| query | No | Title substring to match. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It states 'Read-only' indicating no mutation, and lists return fields. However, it does not disclose behavior like pagination, case sensitivity of subtitle search, or what happens when no query/tags are provided (likely returns all dashboards within limits). The limit parameter is mentioned in schema but not in description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences: first states purpose and return fields, second links to the sibling tool. Every sentence adds value, no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 3 parameters, no output schema, and no annotations, the description adequately covers purpose, return fields, and how to proceed for full details. Missing details like result count or explicit handling of empty search are minor gaps for a search tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 67% (tags and query described, limit not). The description combines query and tags with 'and/or', clarifying how they interact, which adds meaning beyond the schema. Limit is not addressed but has clear constraints in schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool performs a read-only search of Grafana dashboards by title substring and/or tags, and lists the returned fields (uid, title, folder, tags, url). This distinguishes it from the sibling grafana_get_dashboard, which fetches full dashboard JSON.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly guides the agent to use grafana_get_dashboard with the uid for full dashboard details, providing a clear alternative. However, it does not specify when to avoid using this tool, e.g., if needing other data types or filtering by fields not supported.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool targets a distinct Grafana operation: health check, datasource listing, dashboard search and retrieval, general querying, and a specialized logs link builder. No functional overlap exists.
All tools share the 'grafana_' prefix and mostly follow a verb_noun pattern (get_dashboard, list_datasources, search_dashboards). Exceptions like 'health' (noun) and 'logs_link' (noun_noun) are minor inconsistencies within an otherwise coherent scheme.
With 6 tools, the server covers the essential read-only Grafana operations without being excessive. Each tool serves a clear purpose and earns its place.
The set covers core read-only functionality: health, datasources, dashboards, querying, and logs linking. Missing are alerting and annotations, but the surface is complete for common exploration tasks and tools are well-connected (e.g., search_dashboards feeds get_dashboard).
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
An MCP server giving access to Grafana dashboards, data and more.
Read-only MCP server for AIStatusDashboard status, incidents, metrics, and fallback recommendations.
Read-only MCP server for turva.dev, an agent-readiness audit and advisory service.
Hosted MCP server for live public-data APIs and Skills for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables MCP-compatible agents to interact with Grafana instances for searching, creating, and updating dashboards, exploring logs via Loki, querying datasources, managing alerts, incidents, and on-call shifts, and accessing observability data.8Apache 2.0
- FlicenseNot gradedqualityDmaintenanceIn-cluster MCP server for read-only diagnostics of Grafana, Prometheus, Alertmanager, and Loki, enabling metric queries, alert listings, and log queries through Grafana datasource proxies with Kubernetes RBAC authentication.
- FlicenseNot gradedqualityDmaintenanceMCP server for Grafana that provides tools to interact with dashboards, data sources, alerts, and more.1
- FlicenseAqualityCmaintenanceRead-only MCP server that exposes Fathom meetings and transcripts as tools for use by skills in the TICKETS workspace.4
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/enrique-pastrana/grafana-mcp-adapter'
If you have feedback or need assistance with the MCP directory API, please join our Discord server