You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+35-38
Original file line number
Diff line number
Diff line change
@@ -45,49 +45,47 @@ This is useful if you don't use certain functionality or if you don't want to ta
45
45
## Usage
46
46
47
47
1. Create a service account in Grafana with enough permissions to use the tools you want to use,
48
-
generate a service account token, and copy it to the clipboard for use in the configuration file.
49
-
Follow the [Grafana documentation][service-account] for details.
50
-
51
-
2. Add the server configuration to your client configuration file. For example, for Claude Desktop:
52
-
53
-
```json
54
-
{
55
-
"mcpServers": {
56
-
"grafana": {
57
-
"command": "uvx",
58
-
"args": [
59
-
"mcp-grafana"
60
-
],
61
-
"env": {
62
-
"GRAFANA_URL": "http://localhost:3000",
63
-
"GRAFANA_API_KEY": "<your service account token>"
64
-
}
65
-
}
66
-
}
67
-
}
68
-
```
48
+
generate a service account token, and copy it to the clipboard for use in the configuration file.
49
+
Follow the [Grafana documentation][service-account] for details.
69
50
70
-
> Note: if you see `Error: spawn uvx ENOENT` in Claude Desktop, you need to specify the full path to `uvx` (see [discussion](https://github.com/orgs/modelcontextprotocol/discussions/20))
51
+
2. Download the latest release of `mcp-grafana` from the [releases page](https://github.com/grafana/mcp-grafana/releases) and place it in your `$PATH`.
71
52
72
-
To disable a category of tools, set the environment variable `GRAFANA_TOOLS__<CATEGORY>__ENABLED` to `"false"`.
73
-
For example, to disable the search tools, set `"GRAFANA_TOOLS__SEARCH__ENABLED": "false"`.
53
+
If you have a Go toolchain installed you can also build and install it from source, using the `GOBIN` environment variable
54
+
to specify the directory where the binary should be installed. This should also be in your `PATH`.
74
55
75
-
## Development
56
+
```bash
57
+
GOBIN="$HOME/go/bin" go install github.com/grafana/mcp-grafana@latest
58
+
```
76
59
77
-
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
60
+
3. Add the server configuration to your client configuration file. For example, for Claude Desktop:
78
61
79
-
This project uses [`uv`] to manage dependencies. Install `uv` following the instructions for your platform.
62
+
```json
63
+
{
64
+
"mcpServers": {
65
+
"grafana": {
66
+
"command": "mcp-grafana",
67
+
"args": [],
68
+
"env": {
69
+
"GRAFANA_URL": "http://localhost:3000",
70
+
"GRAFANA_API_KEY": "<your service account token>"
71
+
}
72
+
}
73
+
}
74
+
}
75
+
```
80
76
81
-
You can then create a virtual environment and install the dependencies with:
77
+
> Note: if you see `Error: spawn mcp-grafana ENOENT` in Claude Desktop, you need to specify the full path to `mcp-grafana`.
82
78
83
-
```bash
84
-
uv sync --all-groups
85
-
```
79
+
## Development
86
80
87
-
To run the server and edit the source code live, use:
81
+
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
82
+
83
+
This project is written in Go. Install Go following the instructions for your platform.
84
+
85
+
To run the server, use:
88
86
89
87
```bash
90
-
uvx --with-editable . mcp-grafana
88
+
go run ./...
91
89
```
92
90
93
91
You can also run the server using the SSE transport inside Docker. To build the image, use
TL;DR: start a Grafana instance with `docker-compose up`, run `uv run ruff check .` for lints, and `uv run pytest tests --integration` to run unit and integration tests.
108
-
109
105
To run unit tests, run:
110
106
111
107
```bash
112
-
uv run pytest tests
108
+
go run ./...
113
109
```
114
110
111
+
**TODO: add integration tests and cloud tests.**
112
+
115
113
More comprehensive integration tests will require a Grafana instance to be running locally on port 3000; you can start one with Docker Compose:
116
114
117
115
```bash
@@ -135,12 +133,11 @@ GRAFANA_URL=https://myinstance.grafana.net GRAFANA_API_KEY=my-api-key uv run pyt
135
133
136
134
### Linting
137
135
138
-
This project uses [ruff](https://github.com/charliermarsh/ruff) for linting.
136
+
**TODO: add golangci-lint and document it here.**
139
137
140
138
## License
141
139
142
140
This project is licensed under the [Apache License, Version 2.0](LICENSE).
0 commit comments