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
+36-30Lines changed: 36 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -352,43 +352,43 @@ When an organization ID is provided, the MCP server will set the `X-Grafana-Org-
352
352
353
353
-**Docker image**: Use the pre-built Docker image from Docker Hub.
354
354
355
-
**Important**: The Docker image's entrypoint is configured to run the MCP server in SSE mode by default, but most users will want to use STDIO mode for direct integration with AI assistants like Claude Desktop:
355
+
The Docker image defaults to **stdio mode**, which is ideal for direct integration with AI assistants like Claude Desktop via the MCP Registry.
356
356
357
-
1.**STDIO Mode**: For stdio mode you must explicitly override the default with `-t stdio` and include the `-i` flag to keep stdin open:
357
+
1.**STDIO Mode** (default): Include the `-i` flag to keep stdin open:
358
358
359
359
```bash
360
-
docker pull mcp/grafana
360
+
docker pull grafana/mcp-grafana
361
361
# For local Grafana:
362
-
docker run --rm -i -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token>mcp/grafana -t stdio
362
+
docker run --rm -i -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token> grafana/mcp-grafana
363
363
# For Grafana Cloud:
364
-
docker run --rm -i -e GRAFANA_URL=https://myinstance.grafana.net -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token>mcp/grafana -t stdio
364
+
docker run --rm -i -e GRAFANA_URL=https://myinstance.grafana.net -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token> grafana/mcp-grafana
365
365
```
366
366
367
-
2. **SSE Mode**: In this mode, the server runs as an HTTP server that clients connect to. You must expose port 8000 using the `-p` flag:
367
+
2. **SSE Mode**: Run as an HTTP server. You must specify `-t sse`, bind to `0.0.0.0`, and expose port 8000:
368
368
369
369
```bash
370
-
docker pull mcp/grafana
371
-
docker run --rm -p 8000:8000 -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token>mcp/grafana
370
+
docker pull grafana/mcp-grafana
371
+
docker run --rm -p 8000:8000 -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token>grafana/mcp-grafana -t sse --address 0.0.0.0:8000
372
372
```
373
373
374
-
3. **Streamable HTTP Mode**: In this mode, the server operates as an independent process that can handle multiple client connections. You must expose port 8000 using the `-p` flag: For this mode you must explicitly override the default with `-t streamable-http`
374
+
3. **Streamable HTTP Mode**: For multiple client connections. Specify `-t streamable-http`, bind to `0.0.0.0`, and expose port 8000:
375
375
376
376
```bash
377
-
docker pull mcp/grafana
378
-
docker run --rm -p 8000:8000 -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token>mcp/grafana -t streamable-http
377
+
docker pull grafana/mcp-grafana
378
+
docker run --rm -p 8000:8000 -e GRAFANA_URL=http://localhost:3000 -e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token>grafana/mcp-grafana -t streamable-http --address 0.0.0.0:8000
379
379
```
380
380
381
381
For HTTPS streamable HTTP mode with server TLS certificates:
382
382
383
383
```bash
384
-
docker pull mcp/grafana
384
+
docker pull grafana/mcp-grafana
385
385
docker run --rm -p 8443:8443 \
386
386
-v /path/to/certs:/certs:ro \
387
387
-e GRAFANA_URL=http://localhost:3000 \
388
388
-e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token> \
389
-
mcp/grafana \
389
+
grafana/mcp-grafana \
390
390
-t streamable-http \
391
-
-addr :8443 \
391
+
--address 0.0.0.0:8443 \
392
392
--server.tls-cert-file /certs/server.crt \
393
393
--server.tls-key-file /certs/server.key
394
394
```
@@ -402,6 +402,22 @@ When an organization ID is provided, the MCP server will set the `X-Grafana-Org-
402
402
GOBIN="$HOME/go/bin" go install github.com/grafana/mcp-grafana/cmd/mcp-grafana@latest
403
403
```
404
404
405
+
- **Build container image with ko**: For local development or custom container builds, you can use [ko](https://ko.build/) to build a container image directly from source:
406
+
407
+
```bash
408
+
# Install ko (if not already installed)
409
+
go install github.com/google/ko@latest
410
+
411
+
# Build and load into local Docker daemon
412
+
KO_DOCKER_REPO=ko.local ko build ./cmd/mcp-grafana --bare
413
+
414
+
# Build for a specific registry
415
+
KO_DOCKER_REPO=ghcr.io/myorg/mcp-grafana ko build ./cmd/mcp-grafana --bare -t latest
416
+
417
+
# Build multi-platform image
418
+
KO_DOCKER_REPO=docker.io/myorg/mcp-grafana ko build ./cmd/mcp-grafana --platform linux/amd64,linux/arm64 --bare -t v1.0.0
419
+
```
420
+
405
421
- **Deploy to Kubernetes using Helm**: use the [Helm chart from the Grafana helm-charts repository](https://github.com/grafana/helm-charts/tree/main/charts/grafana-mcp)
406
422
407
423
```bash
@@ -450,9 +466,7 @@ When an organization ID is provided, the MCP server will set the `X-Grafana-Org-
450
466
"GRAFANA_URL",
451
467
"-e",
452
468
"GRAFANA_SERVICE_ACCOUNT_TOKEN",
453
-
"mcp/grafana",
454
-
"-t",
455
-
"stdio"
469
+
"grafana/mcp-grafana"
456
470
],
457
471
"env": {
458
472
"GRAFANA_URL": "http://localhost:3000", // Or "https://myinstance.grafana.net"for Grafana Cloud
@@ -468,11 +482,9 @@ When an organization ID is provided, the MCP server will set the `X-Grafana-Org-
468
482
}
469
483
```
470
484
471
-
> Note: The `-t stdio` argument is essential here because it overrides the default SSE mode in the Docker image.
472
-
473
485
**Using VSCode with remote MCP server**
474
486
475
-
If you're using VSCode and running the MCP server in SSE mode (which is the default when using the Docker image without overriding the transport), make sure your `.vscode/settings.json` includes the following:
487
+
If you're running the MCP server in SSE mode, make sure your `.vscode/settings.json` includes the following:
476
488
477
489
```json
478
490
"mcp": {
@@ -536,9 +548,7 @@ To use debug mode with the Claude Desktop configuration, update your config as f
536
548
"GRAFANA_URL",
537
549
"-e",
538
550
"GRAFANA_SERVICE_ACCOUNT_TOKEN",
539
-
"mcp/grafana",
540
-
"-t",
541
-
"stdio",
551
+
"grafana/mcp-grafana",
542
552
"-debug"
543
553
],
544
554
"env": {
@@ -550,8 +560,6 @@ To use debug mode with the Claude Desktop configuration, update your config as f
550
560
}
551
561
```
552
562
553
-
> Note: As with the standard configuration, the `-t stdio` argument is required to override the default SSE mode in the Docker image.
554
-
555
563
### TLS Configuration
556
564
557
565
If your Grafana instance is behind mTLS or requires custom TLS certificates, you can configure the MCP server to use custom certificates. The server supports the following TLS configuration options:
@@ -602,9 +610,7 @@ If your Grafana instance is behind mTLS or requires custom TLS certificates, you
602
610
"GRAFANA_URL",
603
611
"-e",
604
612
"GRAFANA_SERVICE_ACCOUNT_TOKEN",
605
-
"mcp/grafana",
606
-
"-t",
607
-
"stdio",
613
+
"grafana/mcp-grafana",
608
614
"--tls-cert-file",
609
615
"/certs/client.crt",
610
616
"--tls-key-file",
@@ -714,9 +720,9 @@ docker run --rm -p 8443:8443 \
714
720
-v /path/to/certs:/certs:ro \
715
721
-e GRAFANA_URL=http://localhost:3000 \
716
722
-e GRAFANA_SERVICE_ACCOUNT_TOKEN=<your service account token> \
0 commit comments