mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-07-30 11:24:08 +00:00
fix(web): allow custom MCP connections
This commit is contained in:
parent
fa7588c43e
commit
aba94f04cc
1 changed files with 12 additions and 23 deletions
|
|
@ -20,7 +20,6 @@ import {
|
|||
import { toast } from "sonner"
|
||||
import { dmSans125ClassName } from "@/lib/fonts"
|
||||
import { useHasCompanyBrain } from "@/hooks/use-company-brain"
|
||||
import { useAuth } from "@lib/auth-context"
|
||||
import { brainConnectorIcon, SlackMark } from "../brain-connector-icons"
|
||||
import { PillButton } from "../integrations/install-steps"
|
||||
|
||||
|
|
@ -310,7 +309,6 @@ function RowSkeleton() {
|
|||
|
||||
export default function CompanyBrainConnections() {
|
||||
const isCompanyBrain = useHasCompanyBrain()
|
||||
const { user } = useAuth()
|
||||
const [catalog, setCatalog] = useState<CatalogEntry[] | null>(null)
|
||||
const [catalogLoaded, setCatalogLoaded] = useState(false)
|
||||
const [rows, setRows] = useState<ConnRow[]>([])
|
||||
|
|
@ -368,9 +366,6 @@ export default function CompanyBrainConnections() {
|
|||
(shared ? r.userId === null : r.userId !== null),
|
||||
)
|
||||
|
||||
const isStaff =
|
||||
user?.email?.toLowerCase().endsWith("@supermemory.com") ?? false
|
||||
|
||||
const connect = async (entry: CatalogEntry, shared: boolean) => {
|
||||
const key = `${entry.slug}:${shared ? "org" : "user"}`
|
||||
setBusy(key)
|
||||
|
|
@ -462,10 +457,6 @@ export default function CompanyBrainConnections() {
|
|||
redirectUrl: window.location.href,
|
||||
}),
|
||||
})
|
||||
if (res.status === 403) {
|
||||
toast.error("Custom MCP URLs are staff-only.")
|
||||
return
|
||||
}
|
||||
const data = (await res.json().catch(() => ({}))) as {
|
||||
authUrl?: string
|
||||
ok?: boolean
|
||||
|
|
@ -609,20 +600,18 @@ export default function CompanyBrainConnections() {
|
|||
}
|
||||
/>
|
||||
))}
|
||||
{isStaff ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setCustomOpen(true)}
|
||||
className={cn(
|
||||
dmSans125ClassName(),
|
||||
"flex min-h-[104px] cursor-pointer items-center justify-center gap-2 rounded-xl border border-[#2A313C] border-dashed",
|
||||
"text-[13px] font-medium text-[#737B87] transition-colors hover:border-[#3A4150] hover:text-[#FAFAFA]",
|
||||
)}
|
||||
>
|
||||
<Plus className="size-4" />
|
||||
Add custom MCP
|
||||
</button>
|
||||
) : null}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setCustomOpen(true)}
|
||||
className={cn(
|
||||
dmSans125ClassName(),
|
||||
"flex min-h-[104px] cursor-pointer items-center justify-center gap-2 rounded-xl border border-[#2A313C] border-dashed",
|
||||
"text-[13px] font-medium text-[#737B87] transition-colors hover:border-[#3A4150] hover:text-[#FAFAFA]",
|
||||
)}
|
||||
>
|
||||
<Plus className="size-4" />
|
||||
Add custom MCP
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue