Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat: addressed ui/ux feedback
Sheen Capadngan8dceca4413b5
diff --git a/frontend/src/helpers/project.ts b/frontend/src/helpers/project.tsindex ec2c2dbfdf..ea813af949 100644--- a/frontend/src/helpers/project.ts+++ b/frontend/src/helpers/project.ts@@ -107,7 +107,7 @@ export const getProjectLottieIcon = (type: ProjectType) => {[ProjectType.SSH]: "terminal",[ProjectType.SecretScanning]: "secret-scan",[ProjectType.PAM]: "groups",- [ProjectType.AI]: "user"+ [ProjectType.AI]: "moving-block"};return titleConvert[type];};diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointDetailsSection.tsx b/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointDetailsSection.tsxindex e8faea10d7..e724ea8cf6 100644--- a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointDetailsSection.tsx+++ b/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointDetailsSection.tsx@@ -1,9 +1,18 @@+import { useEffect, useState } from "react";import { faEdit, faInfoCircle } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { format } from "date-fns";import { createNotification } from "@app/components/notifications";-import { GenericFieldLabel, IconButton, Switch, Tooltip } from "@app/components/v2";+import {+ GenericFieldLabel,+ IconButton,+ Input,+ Select,+ SelectItem,+ Switch,+ Tooltip+} from "@app/components/v2";import { TAiMcpEndpointWithServerIds, useUpdateAiMcpEndpoint } from "@app/hooks/api";type Props = {@@ -11,6 +20,14 @@ type Props = {onEdit: VoidFunction;};+type RateLimitSettings = {+ enabled: boolean;+ limit: number;+ timeUnit: "minute" | "hour" | "day";+};++const RATE_LIMIT_STORAGE_KEY_PREFIX = "mcp_endpoint_rate_limit_";+const getStatusLabel = (status: string | null) => {const labels: Record<string, string> = {active: "Active",@@ -29,6 +46,34 @@ const getStatusColor = (status: string | null) => {export const MCPEndpointDetailsSection = ({ endpoint, onEdit }: Props) => {const updateEndpoint = useUpdateAiMcpEndpoint();+ const [rateLimitSettings, setRateLimitSettings] = useState<RateLimitSettings>({+ enabled: false,+ limit: 100,+ timeUnit: "hour"+ });+ const [hasLoadedRateLimit, setHasLoadedRateLimit] = useState(false);++ const rateLimitStorageKey = `${RATE_LIMIT_STORAGE_KEY_PREFIX}${endpoint.id}`;++ // Load rate limit settings from localStorage on mount+ useEffect(() => {+ const stored = localStorage.getItem(rateLimitStorageKey);+ if (stored) {+ try {+ setRateLimitSettings(JSON.parse(stored));+ } catch (e) {+ console.error("Failed to parse stored rate limit settings", e);+ }+ }+ setHasLoadedRateLimit(true);+ }, [rateLimitStorageKey]);++ // Save rate limit settings to localStorage whenever they change+ useEffect(() => {+ if (hasLoadedRateLimit) {+ localStorage.setItem(rateLimitStorageKey, JSON.stringify(rateLimitSettings));+ }+ }, [rateLimitSettings, rateLimitStorageKey, hasLoadedRateLimit]);const handlePiiFilteringToggle = async (checked: boolean) => {try {@@ -49,6 +94,28 @@ export const MCPEndpointDetailsSection = ({ endpoint, onEdit }: Props) => {}};+ const handleRateLimitToggle = (checked: boolean) => {+ setRateLimitSettings((prev) => ({ ...prev, enabled: checked }));+ createNotification({+ text: `Rate limiting ${checked ? "enabled" : "disabled"}`,+ type: "success"+ });+ };++ const handleRateLimitChange = (limit: string) => {+ const numLimit = parseInt(limit, 10);+ if (!Number.isNaN(numLimit) && numLimit > 0) {+ setRateLimitSettings((prev) => ({ ...prev, limit: numLimit }));+ }+ };++ const handleTimeUnitChange = (timeUnit: string) => {+ setRateLimitSettings((prev) => ({+ ...prev,+ timeUnit: timeUnit as "minute" | "hour" | "day"+ }));+ };+return (<div className="flex w-full flex-col gap-3 rounded-lg border border-mineshaft-600 bg-mineshaft-900 px-4 py-3"><div className="flex items-center justify-between border-b border-mineshaft-400 pb-2">@@ -101,6 +168,39 @@ export const MCPEndpointDetailsSection = ({ endpoint, onEdit }: Props) => {/></div></div>++ <div className="pt-1">+ <div className="flex items-start justify-between">+ <div className="flex flex-col gap-0.5">+ <div className="flex items-center gap-2">+ <span className="text-sm font-medium text-mineshaft-200">Rate Limiting</span>+ </div>+ <span className="text-xs text-bunker-400">Limit tool invocations per user</span>+ </div>+ <Switch+ id={`rate-limiting-${endpoint.id}`}+ isChecked={rateLimitSettings.enabled}+ onCheckedChange={handleRateLimitToggle}+ />+ </div>++ {rateLimitSettings.enabled && (+ <div className="mt-3 grid grid-cols-2 gap-3">+ <Input+ type="number"+ value={rateLimitSettings.limit.toString()}+ onChange={(e) => handleRateLimitChange(e.target.value)}+ min={1}+ placeholder="100"+ />+ <Select value={rateLimitSettings.timeUnit} onValueChange={handleTimeUnitChange}>+ <SelectItem value="minute">per minute</SelectItem>+ <SelectItem value="hour">per hour</SelectItem>+ <SelectItem value="day">per day</SelectItem>+ </Select>+ </div>+ )}+ </div></div></div>);diff --git a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointUsageStatisticsSection.tsx b/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointUsageStatisticsSection.tsxindex dca12f28dd..0111f3bee0 100644--- a/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointUsageStatisticsSection.tsx+++ b/frontend/src/pages/ai/MCPEndpointDetailPage/components/MCPEndpointUsageStatisticsSection.tsx@@ -23,14 +23,14 @@ type StatCardProps = {const StatCard = ({ icon, label, value, subtitle, trend }: StatCardProps) => {return (- <div className="flex flex-col gap-2">+ <div className="flex flex-col gap-1.5"><div className="flex items-center gap-2 text-bunker-300"><FontAwesomeIcon icon={icon} className="text-sm" /><span className="text-xs tracking-wide uppercase">{label}</span></div><div className="flex flex-col">- <div className="text-3xl font-semibold text-mineshaft-100">{value}</div>- {subtitle && <div className="text-sm text-bunker-300">{subtitle}</div>}+ <div className="text-2xl font-semibold text-mineshaft-100">{value}</div>+ {subtitle && <div className="text-xs text-bunker-300">{subtitle}</div>}{trend && (<div className={`text-xs ${trend.value >= 0 ? "text-emerald-500" : "text-red-500"}`}>{trend.value >= 0 ? "+" : ""}@@ -132,7 +132,7 @@ export const MCPEndpointUsageStatisticsSection = ({<div className="border-b border-mineshaft-400 pb-2"><h3 className="text-lg font-medium text-mineshaft-100">Usage Statistics</h3></div>- <div className="grid grid-cols-3 gap-4 py-1">+ <div className="grid grid-cols-3 gap-4"><StatCardicon={faChartLine}label="Total Requests"diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AuthenticationStep.tsx b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AuthenticationStep.tsxindex 93cb8b911c..496566da1d 100644--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AuthenticationStep.tsx+++ b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/AuthenticationStep.tsx@@ -280,6 +280,8 @@ export const AuthenticationStep = ({ onOAuthSuccess }: Props) => {className="w-full"placeholder="Select authentication type..."isDisabled={isOAuthPending}+ position="popper"+ dropdownContainerClassName="max-w-none">{AUTH_METHOD_OPTIONS.map((option) => (<SelectItem key={option.value} value={option.value}>@@ -346,7 +348,7 @@ export const AuthenticationStep = ({ onOAuthSuccess }: Props) => {{authMethod === MCPServerAuthMethod.OAUTH && (<div className="mt-2 space-y-4">{/* Optional client credentials for servers without DCR support (like GitHub) */}- <div className="space-y-3 rounded-md border border-mineshaft-600 bg-mineshaft-700/50 p-4">+ <div className="space-y-4 rounded-md border border-mineshaft-600 bg-mineshaft-700/50 p-4"><p className="text-xs text-bunker-300">Optional: For MCP servers that don't support Dynamic Client Registration, enteryour OAuth app credentials below.@@ -361,7 +363,7 @@ export const AuthenticationStep = ({ onOAuthSuccess }: Props) => {label="Client ID"isError={Boolean(error)}errorText={error?.message}- className="mb-0"+ className="mb-2"><Input{...field}diff --git a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/BasicInfoStep.tsx b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/BasicInfoStep.tsxindex 7a8df9bbd3..4e681da937 100644--- a/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/BasicInfoStep.tsx+++ b/frontend/src/pages/ai/MCPPage/components/MCPServersTab/AddMCPServerModal/BasicInfoStep.tsx@@ -8,12 +8,14 @@ const CREDENTIAL_MODE_OPTIONS = [{value: MCPServerCredentialMode.SHARED,label: "Shared Credentials",- description: "All users will authenticate as the same shared account"+ description:+ "Your credentials will be used by all connecting users - everyone will authenticate as you"},{value: MCPServerCredentialMode.PERSONAL,label: "Personal Credentials",- description: "Each user will authenticate with their own credentials"+ description:+ "Each connecting user must provide and authenticate with their own individual credentials"}];@@ -91,7 +93,8 @@ export const BasicInfoStep = () => {value={value}onValueChange={onChange}className="w-full"- placeholder="Select credential mode..."+ position="popper"+ dropdownContainerClassName="max-w-none">{CREDENTIAL_MODE_OPTIONS.map((option) => (<SelectItem key={option.value} value={option.value}>diff --git a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerAvailableToolsSection.tsx b/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerAvailableToolsSection.tsxindex 0c10cf2548..3c449a7f48 100644--- a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerAvailableToolsSection.tsx+++ b/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerAvailableToolsSection.tsx@@ -48,53 +48,55 @@ export const MCPServerAvailableToolsSection = ({ serverId }: Props) => {Sync Tools</Button></div>- <TableContainer>- <Table>- <THead>- <Tr>- <Th className="w-1/3">Tool Name</Th>- <Th>Description</Th>- </Tr>- </THead>- <TBody>- {isPending && (+ <div className="p-4">+ <TableContainer>+ <Table>+ <THead><Tr>- <Td colSpan={2} className="text-center text-mineshaft-400">- Loading tools...- </Td>+ <Th className="w-1/3">Tool Name</Th>+ <Th>Description</Th></Tr>- )}- {!isPending && tools.length === 0 && (- <Tr>- <Td colSpan={2}>- <EmptyState title="No tools available" className="py-8" />- </Td>- </Tr>- )}- {tools.map((tool) => (- <Tr key={tool.id} className="hover:bg-mineshaft-700">- <Td>- <code className="rounded bg-mineshaft-700 px-2 py-1 font-mono text-sm text-mineshaft-200">- {tool.name}- </code>- </Td>- <Td className="max-w-md text-mineshaft-300">- {tool.description ? (- <Tooltip- content={tool.description}- className="max-h-96 max-w-lg overflow-y-auto"- >- <span className="line-clamp-2 cursor-help">{tool.description}</span>- </Tooltip>- ) : (- "-"- )}- </Td>- </Tr>- ))}- </TBody>- </Table>- </TableContainer>+ </THead>+ <TBody>+ {isPending && (+ <Tr>+ <Td colSpan={2} className="text-center text-mineshaft-400">+ Loading tools...+ </Td>+ </Tr>+ )}+ {!isPending && tools.length === 0 && (+ <Tr>+ <Td colSpan={2}>+ <EmptyState title="No tools available" className="py-8" />+ </Td>+ </Tr>+ )}+ {tools.map((tool) => (+ <Tr key={tool.id} className="hover:bg-mineshaft-700">+ <Td>+ <code className="rounded bg-mineshaft-700 px-2 py-1 font-mono text-sm text-mineshaft-200">+ {tool.name}+ </code>+ </Td>+ <Td className="max-w-md text-mineshaft-300">+ {tool.description ? (+ <Tooltip+ content={tool.description}+ className="max-h-96 max-w-lg overflow-y-auto"+ >+ <span className="line-clamp-2 cursor-help">{tool.description}</span>+ </Tooltip>+ ) : (+ "-"+ )}+ </Td>+ </Tr>+ ))}+ </TBody>+ </Table>+ </TableContainer>+ </div></div>);};diff --git a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerCredentialsSection.tsx b/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerCredentialsSection.tsxindex 60154b6769..7920abd7b2 100644--- a/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerCredentialsSection.tsx+++ b/frontend/src/pages/ai/MCPServerDetailPage/components/MCPServerCredentialsSection.tsx@@ -1,4 +1,4 @@-import { GenericFieldLabel } from "@app/components/v2";+import { Button, GenericFieldLabel } from "@app/components/v2";import { AiMcpServerCredentialMode, TAiMcpServer } from "@app/hooks/api";type Props = {@@ -14,10 +14,18 @@ const getCredentialModeLabel = (mode: AiMcpServerCredentialMode) => {};export const MCPServerCredentialsSection = ({ server }: Props) => {+ const handleManageCredentials = () => {+ // TODO: Implement credential management modal+ // Will handle re-authentication and credential removal+ };+return (<div className="flex w-full flex-col gap-3 rounded-lg border border-mineshaft-600 bg-mineshaft-900 px-4 py-3"><div className="flex items-center justify-between border-b border-mineshaft-400 pb-2"><h3 className="text-lg font-medium text-mineshaft-100">Credentials</h3>+ <Button variant="outline_bg" size="xs" onClick={handleManageCredentials}>+ Manage+ </Button></div><div className="space-y-3"><GenericFieldLabel label="Credential Mode">diff --git a/frontend/src/pages/organization/McpEndpointFinalizePage/McpEndpointFinalizePage.tsx b/frontend/src/pages/organization/McpEndpointFinalizePage/McpEndpointFinalizePage.tsxindex ecd2842e4f..4b719fca42 100644--- a/frontend/src/pages/organization/McpEndpointFinalizePage/McpEndpointFinalizePage.tsx+++ b/frontend/src/pages/organization/McpEndpointFinalizePage/McpEndpointFinalizePage.tsx@@ -412,43 +412,48 @@ export const McpEndpointFinalizePage = () => {</div>)}- <form onSubmit={handleSubmit(onSubmit)}>- <Controller- control={control}- name="expireIn"- render={({ field, fieldState: { error } }) => (- <FormControl- label="Access Duration"- isError={Boolean(error)}- errorText={error?.message}- helperText="How long the access token should be valid (e.g., 1h, 7d, 30d)"- >- <Input {...field} placeholder="30d" />- </FormControl>- )}- />-- <div className="mt-6 flex gap-3">- <Button- type="submit"- className="flex-1"- isLoading={isSubmitting || isPending}- isDisabled={isSubmitting || isPending || !endpoint || !allServersAuthenticated}- >- Authorize- </Button>- <Link to="/">- <Button variant="outline_bg" colorSchema="secondary">- Cancel- </Button>- </Link>- </div>- </form>-- <p className="mt-6 text-center text-xs text-bunker-400">- By authorizing, you grant the external application access to interact with the tools- available through this MCP endpoint.- </p>+ {/* Only show authorization form after all servers are authenticated */}+ {allServersAuthenticated && (+ <>+ <form onSubmit={handleSubmit(onSubmit)}>+ <Controller+ control={control}+ name="expireIn"+ render={({ field, fieldState: { error } }) => (+ <FormControl+ label="Access Duration"+ isError={Boolean(error)}+ errorText={error?.message}+ helperText="How long the access token should be valid (e.g., 1h, 7d, 30d)"+ >+ <Input {...field} placeholder="30d" />+ </FormControl>+ )}+ />++ <div className="mt-6 flex gap-3">+ <Button+ type="submit"+ className="flex-1"+ isLoading={isSubmitting || isPending}+ isDisabled={isSubmitting || isPending || !endpoint}+ >+ Authorize+ </Button>+ <Link to="/">+ <Button variant="outline_bg" colorSchema="secondary">+ Cancel+ </Button>+ </Link>+ </div>+ </form>++ <p className="mt-6 text-center text-xs text-bunker-400">+ By authorizing, you grant the external application access to interact with the tools+ available through this MCP endpoint.+ </p>+ </>+ )}</div></div>);