Skip to main content
Glama

@arizeai/phoenix-mcp

Official
by Arize-ai
AuthGuard.tsx1.17 kB
import { PropsWithChildren, ReactNode } from "react"; import { useViewer, useViewerCanManageRetentionPolicy, } from "@phoenix/contexts"; type AuthGuardProps = { fallback?: ReactNode; }; export function IsAuthenticated(props: PropsWithChildren<AuthGuardProps>) { const { fallback = null, children } = props; const { viewer } = useViewer(); if (!viewer) { return <>{fallback}</>; } return children; } export function IsAdmin(props: PropsWithChildren<AuthGuardProps>) { const { fallback = null, children } = props; const { viewer } = useViewer(); // If the viewer is not an admin, show the fallback if (!viewer || viewer.role.name !== "ADMIN") { return <>{fallback}</>; } return children; } /** * Users can access retention policy settings if: * - Authentication is disabled * - Authentication is enabled and the user is an admin */ export function CanManageRetentionPolicy( props: PropsWithChildren<AuthGuardProps> ) { const { fallback = null, children } = props; const canManageRetentionPolicy = useViewerCanManageRetentionPolicy(); if (!canManageRetentionPolicy) { return <>{fallback}</>; } return children; }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Arize-ai/phoenix'

If you have feedback or need assistance with the MCP directory API, please join our Discord server