+
+
+ save({ enabled: v }, v ? "MCP 服务端已启用" : "MCP 服务端已停用,现有会话已断开")}
+ aria-labelledby="mcp-enabled-label"
+ />
+
+ {s.enabled ? "已启用" : "已停用"}
+
+
+
0 ? "success" : "neutral"}>{s.sessions.length} 个会话在线
+
+
+
, wide: true },
+ { label: "传输", value: "Streamable HTTP(POST / GET / DELETE)" },
+ { label: "鉴权", value: "Authorization: Bearer
" },
+ {
+ label: "限速",
+ value: `每个 Key 每分钟 ${s.rateLimitPerMinute} 次工具调用,最多 ${s.maxSessionsPerKey} 个会话`,
+ },
+ {
+ label: "可见工具",
+ value: `read ${s.toolsByScope.read} 个 · read + organize.execute ${s.toolsByScope.readExecute} 个 · admin ${s.toolsByScope.admin} 个`,
+ },
+ ]}
+ />
+
+
+
+
+
+ {restricted ? (
+ activeKeys.length === 0 ? (
+
还没有 API Key。在「API Key」分区新建。
+ ) : (
+
+ )
+ ) : null}
+
+ Key 的 scope 决定能看到哪些工具:read 只有只读和预览类,organize.execute 或 admin 才有执行类。
+
+
+
+
+
+ {s.sessions.length === 0 ? (
+
+ 没有在线会话。客户端连上后出现在这里,空闲 30 分钟自动断开。
+
+ ) : (
+
+ {s.sessions.map((x) => (
+ -
+
{x.idPrefix}
+ {x.apiKeyName}
+ {x.clientName ?? "未知客户端"}
+
+ {x.toolCalls} 次调用 · 最近 {formatRelative(x.lastSeenAt)}
+
+
+ ))}
+
+ )}
+
+
+
+ {s.recentCalls.length === 0 ? (
+ 还没有经 MCP 的调用。
+ ) : (
+
+ {s.recentCalls.slice(0, 8).map((c) => (
+ -
+
{c.capabilityId}
+
+
+ {formatRelative(c.at)}
+ {c.durationMs !== null ? ` · ${c.durationMs} ms` : ""}
+
+
+ ))}
+
+ )}
+
+
+ }
+ >
+
+ 适用于 Claude Code 等支持 Streamable HTTP 的客户端。密钥用环境变量 UMT_API_KEY 占位,配置里不含明文。
+
+
+
+
+ );
+}
+
+function OutcomeBadge({ outcome }: { outcome: string | null }) {
+ if (!outcome) return null;
+ const map: Record