We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/get-convex/convex-backend'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
import { DeploymentInfoContext } from "@common/lib/deploymentContext";
import { useContext, useMemo } from "react";
import { useSessionStorage } from "react-use";
/**
* Some deployments (e.g. production deployments by default) require the user to
* unlock edits before they can make changes to the data.
*
* This hook is used to determine whether this authorization is necessary.
* It is often used in conjunction with `<AuthorizeEditsConfirmationDialog />`.
*/
export function useEditsAuthorization() {
const { useIsProtectedDeployment } = useContext(DeploymentInfoContext);
const isProtectedDeployment = useIsProtectedDeployment();
const [protectedEditsEnabled, setProtectedEditsEnabled] = useSessionStorage(
"protectedEditsEnabled",
false,
);
const authorizeEdits = useMemo(
() =>
isProtectedDeployment ? () => setProtectedEditsEnabled(true) : undefined,
[isProtectedDeployment, setProtectedEditsEnabled],
);
const areEditsAuthorized = !isProtectedDeployment || protectedEditsEnabled;
return { areEditsAuthorized, authorizeEdits };
}