|
1 |
| -# MCP Server for Grafana |
| 1 | +# Grafana MCP server |
| 2 | + |
| 3 | +A [Model Context Protocol][mcp] (MCP) server for Grafana. |
| 4 | + |
| 5 | +This provides access to your Grafana instance and the surrounding ecosystem. |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- [x] Search for dashboards |
| 10 | +- [ ] List and fetch datasource information |
| 11 | +- [ ] Query datasources |
| 12 | + - [ ] Prometheus |
| 13 | + - [ ] Loki (log queries, metric queries) |
| 14 | + - [ ] Tempo |
| 15 | + - [ ] Pyroscope |
| 16 | +- [ ] Query Prometheus metadata |
| 17 | + - [ ] Metric names |
| 18 | + - [ ] Label names |
| 19 | + - [ ] Label values |
| 20 | +- [ ] Search, create, update and close incidents, including attaching notes and other activity |
| 21 | +- [ ] Start Sift investigations and view the results |
| 22 | + |
| 23 | +The list of tools is configurable, so you can choose which tools you want to make available to the MCP client. |
| 24 | +This is useful if you don't use certain functionality or if you don't want to take up too much of the context window. |
| 25 | + |
| 26 | +### Tools |
| 27 | + |
| 28 | +## Usage |
| 29 | + |
| 30 | +1. Create a service account in Grafana with enough permissions to use the tools you want to use, |
| 31 | +generate a service account token, and copy it to the clipboard for use in the configuration file. |
| 32 | +Follow the [Grafana documentation][service-account] for details. |
| 33 | + |
| 34 | +2. Add the server configuration to your client configuration file. For example, for Claude Desktop: |
| 35 | + |
| 36 | +```json |
| 37 | +{ |
| 38 | + "mcpServers": { |
| 39 | + "grafana": { |
| 40 | + "command": "uvx", |
| 41 | + "args": [ |
| 42 | + "mcp-grafana" |
| 43 | + ], |
| 44 | + "env": { |
| 45 | + "GRAFANA_URL": "http://localhost:3000", |
| 46 | + "GRAFANA_API_KEY": "<your service account token>" |
| 47 | + } |
| 48 | + } |
| 49 | + } |
| 50 | +} |
| 51 | +``` |
| 52 | + |
| 53 | +To disable a set of tools, set the environment variable `GRAFANA_TOOLS__<TOOL>__ENABLED` to `"false"`. |
| 54 | +For example, to disable the dashboard search tool, set `"GRAFANA_TOOLS__SEARCH__ENABLED": "false"`. |
| 55 | + |
| 56 | +[mcp]: https://modelcontextprotocol.io/ |
| 57 | +[service-account]: https://grafana.com/docs/grafana/latest/administration/service-accounts/ |
0 commit comments