From 8c7a6410d2cc95f3df0fbba901cdaab85b2462ad Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Thu, 6 Aug 2026 12:01:10 +0200 Subject: [PATCH] web(mcp-usage): mobile-friendly layout for admin + reporting sections Headers stack below sm, summary cards go 2-up on phones, top endpoints show tool name with route as secondary line, and the top-users table is replaced by stacked rows so requests/last-active are no longer cut off on narrow screens. Co-Authored-By: Claude Fable 5 --- .../metrics/sections/SectionMcpUsage.tsx | 101 ++++++++++-------- .../reporting/sections/SectionMcpUsage.tsx | 18 ++-- 2 files changed, 65 insertions(+), 54 deletions(-) diff --git a/src/Web/autopilot-monitor-web/app/admin/metrics/sections/SectionMcpUsage.tsx b/src/Web/autopilot-monitor-web/app/admin/metrics/sections/SectionMcpUsage.tsx index 31fe8b14..42b2a90c 100644 --- a/src/Web/autopilot-monitor-web/app/admin/metrics/sections/SectionMcpUsage.tsx +++ b/src/Web/autopilot-monitor-web/app/admin/metrics/sections/SectionMcpUsage.tsx @@ -129,12 +129,12 @@ export function SectionMcpUsage() { // self-wrap with their own min-h-screen layout; this one is a plain content block).
{/* Header */} -
+

Global MCP Usage

API usage across all MCP-enabled users

-
+
-
+
+
Today
-
{todayRequests.toLocaleString()}
+
{todayRequests.toLocaleString()}
-
+
Total ({dateRange})
-
{totalRequests.toLocaleString()}
+
{totalRequests.toLocaleString()}
-
+
Unique Users
-
{uniqueUsersTotal}
+
{uniqueUsersTotal}
-
+
Active Days
-
{sortedDaily.length}
+
{sortedDaily.length}
@@ -182,8 +182,8 @@ export function SectionMcpUsage() {

Daily Request Volume

{sortedDaily.slice(0, 30).map((day) => ( -
-
+
+
{formatDate(day.date)}
@@ -192,8 +192,9 @@ export function SectionMcpUsage() { style={{ width: `${Math.max((day.totalRequests / maxDaily) * 100, 2)}%` }} />
-
- {day.totalRequests.toLocaleString()} / {day.uniqueUsers} users +
+ {day.totalRequests.toLocaleString()} + / {day.uniqueUsers} users
))} @@ -212,49 +213,59 @@ export function SectionMcpUsage() { .slice(0, 15); return topEndpoints.length > 0 ? (
-
+

Top Endpoints

- {topEndpoints.map(([endpoint, count]) => ( -
- {endpoint} - {count.toLocaleString()} requests -
- ))} + {topEndpoints.map(([endpoint, count]) => { + // MCP tool calls are recorded as "toolname:/api/route" — show the + // tool name prominently and the route as a secondary line. + const sep = endpoint.indexOf(":"); + const tool = sep > 0 ? endpoint.slice(0, sep) : endpoint; + const route = sep > 0 ? endpoint.slice(sep + 1) : null; + return ( +
+
+
{tool}
+ {route && ( +
{route}
+ )} +
+ + {count.toLocaleString()} + requests + +
+ ); + })}
) : null; })()} - {/* Top Users Table */} + {/* Top Users */} {userAggregates.length > 0 && (
-
+

Top Users by Request Count

- - - - - - - - - - - {userAggregates.slice(0, 25).map((user) => ( - - - - - - - ))} - -
UserTenantRequestsLast Active
{user.upn || user.userId}{user.tenantId ? user.tenantId.slice(0, 8) + "..." : "—"}{user.totalRequests.toLocaleString()} +
+ {userAggregates.slice(0, 25).map((user) => ( +
+
+
{user.upn || user.userId}
+
+ {user.tenantId ? user.tenantId.slice(0, 8) : "—"} + {" · "} {user.lastActive ? new Date(user.lastActive).toLocaleDateString() : "—"} -
+
+
+
+ {user.totalRequests.toLocaleString()} +
+
+ ))} +
)} diff --git a/src/Web/autopilot-monitor-web/app/settings/reporting/sections/SectionMcpUsage.tsx b/src/Web/autopilot-monitor-web/app/settings/reporting/sections/SectionMcpUsage.tsx index ad3dd87f..51c35481 100644 --- a/src/Web/autopilot-monitor-web/app/settings/reporting/sections/SectionMcpUsage.tsx +++ b/src/Web/autopilot-monitor-web/app/settings/reporting/sections/SectionMcpUsage.tsx @@ -104,12 +104,12 @@ export function SectionMcpUsage() { return (
{/* Header */} -
+

MCP Usage

{upn &&

{upn}

}
-
+
{/* Plan Badge */} {usagePlan && ( @@ -144,18 +144,18 @@ export function SectionMcpUsage() { )} {/* Summary Cards */} -
-
+
+
Today's Requests
-
{todayRequests.toLocaleString()}
+
{todayRequests.toLocaleString()}
-
+
Total Requests ({dateRange})
-
{totalRequests.toLocaleString()}
+
{totalRequests.toLocaleString()}
-
+
Active Days
-
{dailyAggregates.length}
+
{dailyAggregates.length}