diff --git a/server/internal/mcp/tools_health.go b/server/internal/mcp/tools_health.go index b509bc7..11abe63 100644 --- a/server/internal/mcp/tools_health.go +++ b/server/internal/mcp/tools_health.go @@ -187,6 +187,12 @@ func init() { } } + // Metric incidents name a server, so a server-scoped token sees only + // the ones on servers it can see, matching the REST endpoint. + visible, restricted, err := services.VisibleServerIDs(c.InstanceID, c.TokenScope) + if err != nil { + return nil, fmt.Errorf("could not resolve visible servers: %w", err) + } out := []incidentSummary{} for _, mid := range monitorIDs { if len(out) >= int(limit) { @@ -196,6 +202,7 @@ func init() { if err != nil { return nil, fmt.Errorf("could not list incidents: %w", err) } + incidents = services.FilterByVisibleServer(incidents, func(i models.Incident) string { return i.ServerID }, visible, restricted) name := mid if monitorNames != nil { if n, ok := monitorNames[mid]; ok {