mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 20:05:06 +03:00
* feat: MCP URL builder - Creates an MCP URL builder component that allows a user to choose options via a UI, then automatically builds the URL and config needed for various MCP clients - Adds this component to studio Config modal and docs MCP page * fix(mcp url builder): mcp-remote options mcp-remote handles OAuth, so no need to pass personal access token * fix(docs): mcp We are pushing the remote MCP server rather than the local one, so removing references to the local server from documentation. * fix(mcp url builder): ui messages - Clarify read-only mode - Storage is not enabled in the defautl configuration * fix: mcp url builder - Refactor unnecessary hook into a utility function - Fix background color in dark mode * feat: update remote MCP base URL * docs: update MCP getting started - Restores relevant content from prod - Adds callout about authentication - Adds next steps to remote MCP installation section * Update apps/docs/content/guides/getting-started/mcp.mdx Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: click selected project to unselect This follows the unselect pattern from shadcn combobox example https://ui.shadcn.com/docs/components/combobox * Update apps/docs/content/guides/getting-started/mcp.mdx Co-authored-by: Greg Richardson <greg.nmr@gmail.com> * Update apps/docs/content/guides/getting-started/mcp.mdx Co-authored-by: Greg Richardson <greg.nmr@gmail.com> * Update apps/docs/content/guides/getting-started/mcp.mdx Co-authored-by: Greg Richardson <greg.nmr@gmail.com> * fix: light mode connection icons * chore: format `mcp.mdx` * fix: VS Code URL handler "name" Based on docs the field is "name" instead of "id": - https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_commandline-configuration - https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_url-handler * refactor: `NEXT_PUBLIC_MCP_URL` environment variable * feat: move client selector below options * feat: "Add to" buttons left aligned about config file * feat: actionable login hint * refactor: remote claude desktop client option --------- Co-authored-by: Matt Rossman <22670878+mattrossman@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Greg Richardson <greg.nmr@gmail.com> Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
114 lines
3.3 KiB
TypeScript
114 lines
3.3 KiB
TypeScript
import { Box, Check, ChevronDown } from 'lucide-react'
|
|
import { useState } from 'react'
|
|
|
|
import {
|
|
Button,
|
|
CommandEmpty_Shadcn_,
|
|
CommandGroup_Shadcn_,
|
|
CommandInput_Shadcn_,
|
|
CommandItem_Shadcn_,
|
|
CommandList_Shadcn_,
|
|
Command_Shadcn_,
|
|
PopoverContent_Shadcn_,
|
|
PopoverTrigger_Shadcn_,
|
|
Popover_Shadcn_,
|
|
cn,
|
|
} from 'ui'
|
|
import { ConnectionType } from './Connect.constants'
|
|
import { ConnectionIcon } from './ConnectionIcon'
|
|
|
|
interface ConnectDropdownProps {
|
|
state: string
|
|
updateState: (state: string) => void
|
|
label: string
|
|
items: ConnectionType[]
|
|
iconFolder?: string
|
|
supportsDarkMode?: boolean
|
|
}
|
|
|
|
export const ConnectDropdown = ({
|
|
state,
|
|
updateState,
|
|
label,
|
|
|
|
items,
|
|
iconFolder,
|
|
supportsDarkMode,
|
|
}: ConnectDropdownProps) => {
|
|
const [open, setOpen] = useState(false)
|
|
|
|
function onSelectLib(key: string) {
|
|
updateState(key)
|
|
setOpen(false)
|
|
}
|
|
|
|
const selectedItem = items.find((item) => item.key === state)
|
|
|
|
return (
|
|
<Popover_Shadcn_ open={open} onOpenChange={setOpen} modal={false}>
|
|
<div className="flex ">
|
|
<span className="flex items-center text-foreground-lighter px-3 rounded-lg rounded-r-none text-xs border border-button border-r-0">
|
|
{label}
|
|
</span>
|
|
<PopoverTrigger_Shadcn_ asChild>
|
|
<Button
|
|
size="small"
|
|
type="default"
|
|
className="gap-0 rounded-l-none"
|
|
iconRight={<ChevronDown strokeWidth={1.5} />}
|
|
>
|
|
<div className="flex items-center gap-2">
|
|
{selectedItem?.icon ? (
|
|
<ConnectionIcon
|
|
icon={selectedItem.icon}
|
|
iconFolder={iconFolder}
|
|
supportsDarkMode={supportsDarkMode}
|
|
/>
|
|
) : (
|
|
<Box size={12} />
|
|
)}
|
|
{selectedItem?.label}
|
|
</div>
|
|
</Button>
|
|
</PopoverTrigger_Shadcn_>
|
|
</div>
|
|
<PopoverContent_Shadcn_ className="p-0 max-w-48" side="bottom" align="start">
|
|
<Command_Shadcn_>
|
|
<CommandInput_Shadcn_ placeholder="Search..." />
|
|
<CommandList_Shadcn_>
|
|
<CommandEmpty_Shadcn_>No results found.</CommandEmpty_Shadcn_>
|
|
<CommandGroup_Shadcn_>
|
|
{items.map((item) => (
|
|
<CommandItem_Shadcn_
|
|
key={item.key}
|
|
value={item.key}
|
|
onSelect={() => {
|
|
onSelectLib(item.key)
|
|
setOpen(false)
|
|
}}
|
|
className="flex gap-2 items-center"
|
|
>
|
|
{item.icon ? (
|
|
<ConnectionIcon
|
|
icon={item.icon}
|
|
iconFolder={iconFolder}
|
|
supportsDarkMode={supportsDarkMode}
|
|
/>
|
|
) : (
|
|
<Box size={12} />
|
|
)}
|
|
{item.label}
|
|
<Check
|
|
size={15}
|
|
className={cn('ml-auto ', item.key === state ? 'opacity-100' : 'opacity-0')}
|
|
/>
|
|
</CommandItem_Shadcn_>
|
|
))}
|
|
</CommandGroup_Shadcn_>
|
|
</CommandList_Shadcn_>
|
|
</Command_Shadcn_>
|
|
</PopoverContent_Shadcn_>
|
|
</Popover_Shadcn_>
|
|
)
|
|
}
|