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
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -468,6 +468,32 @@ You can add arbitrary HTTP headers to all Grafana API requests using the `GRAFAN
468
468
}
469
469
```
470
470
471
+
### Forwarding Headers from the Client (SSE/Streamable-HTTP Only)
472
+
473
+
When the MCP server runs behind a gateway or reverse proxy that handles SSO (e.g. an AWS ALB with OIDC), each user's session cookie must reach Grafana so it can associate the request with the authenticated user. The `GRAFANA_FORWARD_HEADERS` environment variable enables this by specifying a comma-separated allowlist of header names to copy from the **incoming** HTTP request to every outbound Grafana API request.
474
+
475
+
This only applies when using SSE (`-t sse`) or streamable-http (`-t streamable-http`) transports. It has no effect in stdio mode.
476
+
477
+
**Example: forward the session cookie**
478
+
479
+
```json
480
+
{
481
+
"env": {
482
+
"GRAFANA_URL": "https://grafana.internal",
483
+
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your token>",
484
+
"GRAFANA_FORWARD_HEADERS": "Cookie"
485
+
}
486
+
}
487
+
```
488
+
489
+
You can forward multiple headers by separating them with commas:
490
+
491
+
```
492
+
GRAFANA_FORWARD_HEADERS=Cookie,X-Session-Id
493
+
```
494
+
495
+
Forwarded headers are merged with any headers defined in `GRAFANA_EXTRA_HEADERS`. If a header name appears in both, the value from the incoming request takes precedence for that request.
496
+
471
497
2. You have several options to install `mcp-grafana`:
472
498
473
499
-**uvx (recommended)**: If you have [uv](https://docs.astral.sh/uv/getting-started/installation/) installed, no extra setup is needed — `uvx` will automatically download and run the server:
Copy file name to clipboardExpand all lines: server.json
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,13 @@
57
57
"format": "string",
58
58
"isSecret": false,
59
59
"name": "GRAFANA_EXTRA_HEADERS"
60
+
},
61
+
{
62
+
"description": "Comma-separated list of HTTP header names to forward from the incoming request to Grafana (SSE/streamable-http only). Example: Cookie,X-Session-Id",
0 commit comments