Files
supabase/apps/studio/components/interfaces/Connect/ConnectionIcon.tsx
T
3057faa4e2 feat: MCP URL builder (#36867)
* 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>
2025-10-01 10:45:34 -04:00

40 lines
1.1 KiB
TypeScript

import { useTheme } from 'next-themes'
import Image from 'next/image'
import { BASE_PATH } from 'lib/constants'
interface ConnectionIconProps {
icon: string
iconFolder?: string
supportsDarkMode?: boolean
}
export const ConnectionIcon = ({ icon, iconFolder, supportsDarkMode }: ConnectionIconProps) => {
const { resolvedTheme } = useTheme()
const imageFolder =
iconFolder || (['ionic-angular'].includes(icon) ? 'icons/frameworks' : 'libraries')
const imageExtension = imageFolder === 'icons/frameworks' ? '' : '-icon'
const shouldUseDarkMode =
supportsDarkMode ||
['expo', 'nextjs', 'prisma', 'drizzle', 'astro', 'remix'].includes(icon.toLowerCase())
const iconImgSrc = icon.startsWith('http')
? icon
: `${BASE_PATH}/img/${imageFolder}/${icon.toLowerCase()}${
shouldUseDarkMode && resolvedTheme?.includes('dark') ? '-dark' : ''
}${imageExtension}.svg`
return (
<Image
className="transition-all group-hover:scale-110"
src={iconImgSrc}
alt={`${icon} logo`}
width={14}
height={14}
/>
)
}