Skip to content

Commit ed4a600

Browse files
authored
forward X-Grafana-OrgID for proxies mcps (#407)
1 parent 5ff432c commit ed4a600

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

proxied_client.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ func NewProxiedClient(ctx context.Context, datasourceUID, datasourceName, dataso
3636
headers["Authorization"] = "Basic " + base64.StdEncoding.EncodeToString([]byte(auth))
3737
}
3838

39-
// Create HTTP transport with authentication headers
39+
// Add org ID header if configured
40+
if config.OrgID != 0 {
41+
headers["X-Grafana-Org-Id"] = fmt.Sprintf("%d", config.OrgID)
42+
}
43+
44+
// Create HTTP transport with authentication and org ID headers
4045
slog.DebugContext(ctx, "connecting to MCP server", "datasource", datasourceUID, "url", mcpEndpoint)
4146
httpTransport, err := transport.NewStreamableHTTP(
4247
mcpEndpoint,

0 commit comments

Comments
 (0)