🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
✨ feat(connector): list vendor official remote MCP servers in the Apps catalog (#23686)
Arvin Xub804117fad18
diff --git a/packages/const/src/index.ts b/packages/const/src/index.tsindex b0be93d57e8..8e81acfccd9 100644--- a/packages/const/src/index.ts+++ b/packages/const/src/index.ts@@ -22,6 +22,7 @@ export * from './llmGenerationTracing';export * from './lobehubSkill';export * from './message';export * from './meta';+export * from './officialMcp';export * from './plugin';export * from './protocol';export * from './recommendedSkill';diff --git a/packages/const/src/officialMcp.ts b/packages/const/src/officialMcp.tsnew file mode 100644index 00000000000..dee4c0d7cbc--- /dev/null+++ b/packages/const/src/officialMcp.ts@@ -0,0 +1,408 @@+/**+ * Vendor-hosted remote MCP servers that speak the standard MCP authorization flow.+ *+ * Each entry is plain data: connecting one creates a regular HTTP connector against+ * `url`, and OAuth entries go through discovery + DCR/CIMD on the server, so no+ * vendor-specific code is needed. URLs come from each vendor's own documentation.+ * Identifiers already owned by the LobeHub or Composio catalogs are left out.+ */+export interface OfficialMcpServerType {+ /** `oauth`: standard MCP authorization (discovery + DCR/CIMD). `none`: public server. */+ auth: 'none' | 'oauth';+ author: string;+ category: 'chat' | 'developer' | 'documents' | 'productivity' | 'projects';+ description: string;+ icon: string;+ identifier: string;+ label: string;+ url: string;+}++const favicon = (domain: string) => `https://icons.duckduckgo.com/ip3/${domain}.ico`;++export const OFFICIAL_MCP_SERVERS: OfficialMcpServerType[] = [+ {+ auth: 'oauth',+ author: 'Sentry',+ category: 'developer',+ description: 'Look up issues, errors and releases in your Sentry projects',+ icon: favicon('sentry.io'),+ identifier: 'sentry',+ label: 'Sentry',+ url: 'https://mcp.sentry.dev/mcp',+ },+ {+ auth: 'oauth',+ author: 'Cloudflare',+ category: 'developer',+ description: 'Manage Workers, KV, R2 and D1 in your Cloudflare account',+ icon: favicon('cloudflare.com'),+ identifier: 'cloudflare',+ label: 'Cloudflare',+ url: 'https://bindings.mcp.cloudflare.com/mcp',+ },+ {+ auth: 'oauth',+ author: 'Stripe',+ category: 'developer',+ description: 'Work with customers, payments, invoices and subscriptions in Stripe',+ icon: favicon('stripe.com'),+ identifier: 'stripe',+ label: 'Stripe',+ url: 'https://mcp.stripe.com',+ },+ {+ auth: 'oauth',+ author: 'GitLab',+ category: 'developer',+ description: 'Search projects, issues and merge requests on GitLab',+ icon: favicon('gitlab.com'),+ identifier: 'gitlab',+ label: 'GitLab',+ url: 'https://gitlab.com/api/v4/mcp',+ },+ {+ auth: 'oauth',+ author: 'Neon',+ category: 'developer',+ description: 'Manage Neon Postgres projects, branches and queries',+ icon: favicon('neon.tech'),+ identifier: 'neon',+ label: 'Neon',+ url: 'https://mcp.neon.tech/mcp',+ },+ {+ auth: 'oauth',+ author: 'Netlify',+ category: 'developer',+ description: 'Create, deploy and manage Netlify sites',+ icon: favicon('netlify.com'),+ identifier: 'netlify',+ label: 'Netlify',+ url: 'https://netlify-mcp.netlify.app/mcp',+ },+ {+ auth: 'oauth',+ author: 'Railway',+ category: 'developer',+ description: 'Deploy and manage services and environments on Railway',+ icon: favicon('railway.com'),+ identifier: 'railway',+ label: 'Railway',+ url: 'https://mcp.railway.com',+ },+ {+ auth: 'oauth',+ author: 'Datadog',+ category: 'developer',+ description: 'Query logs, metrics, monitors and incidents in Datadog',+ icon: favicon('datadoghq.com'),+ identifier: 'datadog',+ label: 'Datadog',+ url: 'https://mcp.datadoghq.com/api/unstable/mcp-server/mcp',+ },+ {+ auth: 'oauth',+ author: 'Grafana Labs',+ category: 'developer',+ description: 'Search dashboards, query data sources and inspect alerts in Grafana Cloud',+ icon: favicon('grafana.com'),+ identifier: 'grafana',+ label: 'Grafana',+ url: 'https://mcp.grafana.com/mcp',+ },+ {+ auth: 'oauth',+ author: 'Postman',+ category: 'developer',+ description: 'Work with Postman workspaces, collections and APIs',+ icon: favicon('postman.com'),+ identifier: 'postman',+ label: 'Postman',+ url: 'https://mcp.postman.com/mcp',+ },+ {+ auth: 'oauth',+ author: 'Prisma',+ category: 'developer',+ description: 'Manage Prisma Postgres databases and migrations',+ icon: favicon('prisma.io'),+ identifier: 'prisma',+ label: 'Prisma',+ url: 'https://mcp.prisma.io/mcp',+ },+ {+ auth: 'oauth',+ author: 'ClickHouse',+ category: 'developer',+ description: 'Explore and query ClickHouse Cloud services',+ icon: favicon('clickhouse.com'),+ identifier: 'clickhouse',+ label: 'ClickHouse',+ url: 'https://mcp.clickhouse.cloud/mcp',+ },+ {+ auth: 'oauth',+ author: 'incident.io',+ category: 'developer',+ description: 'Review and manage incidents, alerts and on-call in incident.io',+ icon: favicon('incident.io'),+ identifier: 'incident-io',+ label: 'incident.io',+ url: 'https://mcp.incident.io/mcp',+ },+ {+ auth: 'oauth',+ author: 'Atlassian',+ category: 'projects',+ description:+ 'Search and update Jira issues and Confluence pages with the official Atlassian server',+ icon: favicon('atlassian.com'),+ identifier: 'atlassian',+ label: 'Atlassian',+ url: 'https://mcp.atlassian.com/v1/mcp',+ },+ {+ auth: 'oauth',+ author: 'monday.com',+ category: 'projects',+ description: 'Manage boards, items and updates in monday.com',+ icon: favicon('monday.com'),+ identifier: 'monday',+ label: 'monday.com',+ url: 'https://mcp.monday.com/mcp',+ },+ {+ auth: 'oauth',+ author: 'Doist',+ category: 'productivity',+ description: 'Add, organize and complete tasks in Todoist',+ icon: favicon('todoist.com'),+ identifier: 'todoist',+ label: 'Todoist',+ url: 'https://ai.todoist.net/mcp',+ },+ {+ auth: 'oauth',+ author: 'Miro',+ category: 'projects',+ description: 'Read and create content on Miro boards',+ icon: favicon('miro.com'),+ identifier: 'miro',+ label: 'Miro',+ url: 'https://mcp.miro.com/',+ },+ {+ auth: 'oauth',+ author: 'Canva',+ category: 'productivity',+ description: 'Search, create and edit designs in Canva',+ icon: favicon('canva.com'),+ identifier: 'canva',+ label: 'Canva',+ url: 'https://mcp.canva.com/mcp',+ },+ {+ auth: 'oauth',+ author: 'Calendly',+ category: 'productivity',+ description: 'Check availability and manage scheduled events in Calendly',+ icon: favicon('calendly.com'),+ identifier: 'calendly',+ label: 'Calendly',+ url: 'https://mcp.calendly.com',+ },+ {+ auth: 'oauth',+ author: 'Intercom',+ category: 'chat',+ description: 'Search conversations, contacts and help articles in Intercom',+ icon: favicon('intercom.com'),+ identifier: 'intercom',+ label: 'Intercom',+ url: 'https://mcp.intercom.com/mcp',+ },+ {+ auth: 'oauth',+ author: 'Webflow',+ category: 'documents',+ description: 'Manage Webflow sites, pages and CMS collections',+ icon: favicon('webflow.com'),+ identifier: 'webflow',+ label: 'Webflow',+ url: 'https://mcp.webflow.com/mcp',+ },+ {+ auth: 'oauth',+ author: 'Automattic',+ category: 'documents',+ description: 'Read and publish posts on your WordPress.com sites',+ icon: favicon('wordpress.com'),+ identifier: 'wordpress',+ label: 'WordPress.com',+ url: 'https://public-api.wordpress.com/wpcom/v2/mcp/v1',+ },+ {+ auth: 'oauth',+ author: 'Coda',+ category: 'documents',+ description: 'Read and update Coda docs and tables',+ icon: favicon('coda.io'),+ identifier: 'coda',+ label: 'Coda',+ url: 'https://coda.io/apis/mcp',+ },+ {+ auth: 'oauth',+ author: 'GitBook',+ category: 'documents',+ description: 'Search and read your GitBook documentation spaces',+ icon: favicon('gitbook.com'),+ identifier: 'gitbook',+ label: 'GitBook',+ url: 'https://mcp.gitbook.com/mcp',+ },+ {+ auth: 'oauth',+ author: 'Granola',+ category: 'productivity',+ description: 'Search your Granola meeting notes and transcripts',+ icon: favicon('granola.ai'),+ identifier: 'granola',+ label: 'Granola',+ url: 'https://mcp.granola.ai/mcp',+ },+ {+ auth: 'oauth',+ author: 'Fireflies.ai',+ category: 'productivity',+ description: 'Search meeting transcripts and summaries in Fireflies',+ icon: favicon('fireflies.ai'),+ identifier: 'fireflies',+ label: 'Fireflies',+ url: 'https://api.fireflies.ai/mcp',+ },+ {+ auth: 'oauth',+ author: 'Amplitude',+ category: 'developer',+ description: 'Query charts, events and user analytics in Amplitude',+ icon: favicon('amplitude.com'),+ identifier: 'amplitude',+ label: 'Amplitude',+ url: 'https://mcp.amplitude.com/mcp',+ },+ {+ auth: 'oauth',+ author: 'Mixpanel',+ category: 'developer',+ description: 'Query events, funnels and retention in Mixpanel',+ icon: favicon('mixpanel.com'),+ identifier: 'mixpanel',+ label: 'Mixpanel',+ url: 'https://mcp.mixpanel.com/mcp',+ },+ {+ auth: 'oauth',+ author: 'Hex',+ category: 'developer',+ description: 'Search and run Hex projects and data analyses',+ icon: favicon('hex.tech'),+ identifier: 'hex',+ label: 'Hex',+ url: 'https://app.hex.tech/mcp',+ },+ {+ auth: 'oauth',+ author: 'Ahrefs',+ category: 'productivity',+ description: 'Pull SEO metrics, backlinks and keyword data from Ahrefs',+ icon: favicon('ahrefs.com'),+ identifier: 'ahrefs',+ label: 'Ahrefs',+ url: 'https://api.ahrefs.com/mcp/mcp',+ },+ {+ auth: 'oauth',+ author: 'Semrush',+ category: 'productivity',+ description: 'Pull keyword, domain and traffic data from Semrush',+ icon: favicon('semrush.com'),+ identifier: 'semrush',+ label: 'Semrush',+ url: 'https://mcp.semrush.com/v1/mcp',+ },+ {+ auth: 'oauth',+ author: 'PayPal',+ category: 'developer',+ description: 'Manage invoices, orders and transactions in PayPal',+ icon: favicon('paypal.com'),+ identifier: 'paypal',+ label: 'PayPal',+ url: 'https://mcp.paypal.com/mcp',+ },+ {+ auth: 'oauth',+ author: 'Zapier',+ category: 'productivity',+ description: 'Run actions across thousands of apps through your Zapier account',+ icon: favicon('zapier.com'),+ identifier: 'zapier',+ label: 'Zapier',+ url: 'https://mcp.zapier.com/api/mcp/mcp',+ },+ {+ auth: 'oauth',+ author: 'Make',+ category: 'productivity',+ description: 'Run your Make scenarios as tools',+ icon: favicon('make.com'),+ identifier: 'make',+ label: 'Make',+ url: 'https://mcp.make.com',+ },+ {+ auth: 'none',+ author: 'Upstash',+ category: 'developer',+ description: 'Fetch up-to-date library documentation and code examples',+ icon: favicon('context7.com'),+ identifier: 'context7',+ label: 'Context7',+ url: 'https://mcp.context7.com/mcp',+ },+ {+ auth: 'none',+ author: 'Cognition',+ category: 'developer',+ description: 'Ask questions about public GitHub repositories',+ icon: favicon('deepwiki.com'),+ identifier: 'deepwiki',+ label: 'DeepWiki',+ url: 'https://mcp.deepwiki.com/mcp',+ },+ {+ auth: 'none',+ author: 'Exa',+ category: 'productivity',+ description: 'Search the web and fetch page content with Exa',+ icon: favicon('exa.ai'),+ identifier: 'exa',+ label: 'Exa',+ url: 'https://mcp.exa.ai/mcp',+ },+ {+ auth: 'none',+ author: 'Cloudflare',+ category: 'developer',+ description: 'Search the Cloudflare developer documentation',+ icon: favicon('developers.cloudflare.com'),+ identifier: 'cloudflare-docs',+ label: 'Cloudflare Docs',+ url: 'https://docs.mcp.cloudflare.com/mcp',+ },+];++export const getOfficialMcpServerById = (identifier: string) =>+ OFFICIAL_MCP_SERVERS.find((server) => server.identifier === identifier);diff --git a/src/features/Marketplace/Apps/AppCatalog.tsx b/src/features/Marketplace/Apps/AppCatalog.tsxindex 178314d6484..5007147e16e 100644--- a/src/features/Marketplace/Apps/AppCatalog.tsx+++ b/src/features/Marketplace/Apps/AppCatalog.tsx@@ -26,6 +26,7 @@ import { catalogStyles } from '../Catalog/styles';import { useCatalogDetailNavigate } from '../Catalog/useCatalogDetailNavigate';import { AppIcon } from './AppIcon';import { appCategories, getAppHome, getInlineConnectTool, hasAppConnection } from './catalog';+import OfficialMcpItem from './OfficialMcpItem';import { useMarketplaceApps } from './useMarketplaceApps';export default function AppCatalog() {@@ -64,7 +65,7 @@ export default function AppCatalog() {defaultValue:(tool?.type === 'lobehub'? tool.provider.description- : tool?.serverType.description) ?? '',+ : (tool?.serverType.description ?? app.officialMcp?.description)) ?? '',});return { ...app, summary };})@@ -148,6 +149,8 @@ export default function AppCatalog() {summary: app.summary,title: app.name,};+ if (app.officialMcp)+ return <OfficialMcpItem catalogRow={row} key={app.id} server={app.officialMcp} />;const tool = getInlineConnectTool(app, lobehubEnabled);if (tool) {const ready = tool.type === 'composio' ? composioReady : lobehubReady;diff --git a/src/features/Marketplace/Apps/AppIcon.tsx b/src/features/Marketplace/Apps/AppIcon.tsxindex a33b6cf87aa..2f2bf17c3f2 100644--- a/src/features/Marketplace/Apps/AppIcon.tsx+++ b/src/features/Marketplace/Apps/AppIcon.tsx@@ -9,6 +9,7 @@ import type { MarketplaceApp } from './catalog';export const AppIcon = ({ app, size = 24 }: { app: MarketplaceApp; size?: number }) => {const isDark = useIsDark();if (app.channel) return <PlatformBrandIcon platform={app.channel.id} size={size} />;+ if (app.officialMcp) return <Avatar alt={app.name} avatar={app.officialMcp.icon} size={size} />;const BrandIcon =app.tool?.type === 'lobehub' ? app.tool.provider.icon : app.tool?.serverType.icon;if (!BrandIcon) return null;diff --git a/src/features/Marketplace/Apps/OfficialMcpItem.tsx b/src/features/Marketplace/Apps/OfficialMcpItem.tsxnew file mode 100644index 00000000000..72c73f10001--- /dev/null+++ b/src/features/Marketplace/Apps/OfficialMcpItem.tsx@@ -0,0 +1,91 @@+'use client';++import type { OfficialMcpServerType } from '@lobechat/const';+import { toast } from '@lobehub/ui';+import { memo, useState } from 'react';+import { useTranslation } from 'react-i18next';++import { RowAddAction, RowMoreMenu } from '@/features/Settings/skill/features/RowActions';+import SkillListRow, {+ type CatalogConnectRow,+ ConnectedStatus,+} from '@/features/Settings/skill/features/SkillListRow';+import { usePermission } from '@/hooks/usePermission';+import { useToolStore } from '@/store/tool';+import { connectorSelectors } from '@/store/tool/slices/connector/selectors';+import { ConnectorOAuthError, openConnectorOAuthPopup } from '@/utils/connectorOAuth';++import { useCatalogDetailNavigate } from '../Catalog/useCatalogDetailNavigate';+import { buildInstalledDetailPath } from '../paths';+import { connectOfficialMcp } from './connectOfficialMcp';++interface OfficialMcpItemProps {+ catalogRow: CatalogConnectRow;+ server: OfficialMcpServerType;+}++/** A catalog row for a vendor's official MCP server: connect in place, then manage it as a connector. */+const OfficialMcpItem = memo<OfficialMcpItemProps>(({ catalogRow, server }) => {+ const { t } = useTranslation('discover');+ const { t: ts } = useTranslation('setting');+ const navigate = useCatalogDetailNavigate();+ const { allowed: canCreate, reason } = usePermission('create_content');+ const [connecting, setConnecting] = useState(false);+ const useFetchConnectors = useToolStore((s) => s.useFetchConnectors);+ useFetchConnectors(true);+ const ready = useToolStore((s) => s.isConnectorsInit);+ const connector = useToolStore(connectorSelectors.sharedConnectorByIdentifier(server.identifier));+ const connected = connector?.status === 'connected';+ const label = t('catalog.rowAction', {+ action: connected ? t('apps.manage') : t('apps.connect'),+ name: server.label,+ });+ const openDetail = () =>+ navigate(buildInstalledDetailPath('mcp', server.identifier, 'mcp-connector'));++ const handleConnect = async () => {+ if (!ready || !canCreate || connecting) return;+ // Opened before any await so the browser keeps it+ const popup = server.auth === 'oauth' ? openConnectorOAuthPopup() : undefined;+ setConnecting(true);+ try {+ if (popup === null) throw new ConnectorOAuthError('blocked');+ await connectOfficialMcp(server, popup, useToolStore.getState);+ } catch (error) {+ if (!(error instanceof ConnectorOAuthError && error.reason === 'dismissed'))+ toast.error(+ ts('tools.connectorFeedback.connectFailed', { reason: (error as Error).message }),+ );+ } finally {+ popup?.close();+ setConnecting(false);+ }+ };++ return (+ <SkillListRow+ {...catalogRow}+ extra={+ connected ? (+ <>+ <ConnectedStatus label={ts('tools.composio.connected')} />+ <RowMoreMenu label={label} onOpenDetail={openDetail} />+ </>+ ) : (+ <RowAddAction+ disabled={!ready || !canCreate}+ disabledReason={reason}+ label={label}+ loading={connecting}+ onClick={() => void handleConnect()}+ />+ )+ }+ onClick={connected ? openDetail : () => void handleConnect()}+ />+ );+});++OfficialMcpItem.displayName = 'OfficialMcpItem';++export default OfficialMcpItem;diff --git a/src/features/Marketplace/Apps/catalog.test.ts b/src/features/Marketplace/Apps/catalog.test.tsindex 19e298cd8d3..87261654972 100644--- a/src/features/Marketplace/Apps/catalog.test.ts+++ b/src/features/Marketplace/Apps/catalog.test.ts@@ -1,4 +1,4 @@-import { getConnectorCatalog } from '@lobechat/const';+import { getConnectorCatalog, OFFICIAL_MCP_SERVERS } from '@lobechat/const';import { describe, expect, it } from 'vitest';import type { MessengerPlatformItem } from '@/store/messenger/projection';@@ -90,4 +90,34 @@ describe('marketplace apps', () => {expect(toolsOnly.find((app) => app.id === 'whatsapp')?.category).toBe('chat');expect(toolsOnly.every((app) => !app.channel)).toBe(true);});++ it('lists official MCP servers without replacing a LobeHub or Composio app', () => {+ const notion = { ...OFFICIAL_MCP_SERVERS[0], identifier: 'notion', label: 'Notion MCP' };+ const apps = buildMarketplaceApps({+ ...inputs,+ isOfficialMcpConnected: (id) => id === 'sentry',+ officialMcpServers: [...OFFICIAL_MCP_SERVERS, notion],+ });+ const notionApps = apps.filter((app) => app.id === 'notion');+ expect(notionApps).toHaveLength(1);+ expect(notionApps[0].tool).toBeDefined();+ expect(notionApps[0].officialMcp).toBeUndefined();+ const sentry = apps.find((app) => app.id === 'sentry')!;+ expect(sentry).toMatchObject({ category: 'developer', toolConnected: true });+ expect(sentry.tool).toBeUndefined();+ expect(hasAppConnection(sentry)).toBe(true);+ expect(getInlineConnectTool(sentry, true)).toBeUndefined();+ });++ it('keeps official MCP identifiers unique and clear of the existing catalogs', () => {+ const ids = OFFICIAL_MCP_SERVERS.map((server) => server.identifier);+ const taken = new Set(+ getConnectorCatalog({ composio: true, lobehub: true }).map((item) =>+ item.type === 'lobehub' ? item.provider.id : item.serverType.identifier,+ ),+ );+ expect(new Set(ids).size).toBe(ids.length);+ expect(ids.filter((id) => taken.has(id))).toEqual([]);+ for (const server of OFFICIAL_MCP_SERVERS) expect(new URL(server.url).protocol).toBe('https:');+ });});diff --git a/src/features/Marketplace/Apps/catalog.ts b/src/features/Marketplace/Apps/catalog.tsindex 46c6d1419c2..8accf9cdbd3 100644--- a/src/features/Marketplace/Apps/catalog.ts+++ b/src/features/Marketplace/Apps/catalog.ts@@ -1,4 +1,4 @@-import type { ConnectorCatalogItem } from '@lobechat/const';+import type { ConnectorCatalogItem, OfficialMcpServerType } from '@lobechat/const';import type { MessengerPlatformItem } from '@/store/messenger/projection';@@ -21,6 +21,8 @@ export interface MarketplaceApp {id: string;integrationConnected: boolean;name: string;+ /** A vendor's official remote MCP server, connected as a regular connector. */+ officialMcp?: OfficialMcpServerType;tool?: ConnectorCatalogItem;toolConnected: boolean;}@@ -67,13 +69,17 @@ export const buildMarketplaceApps = ({integrationConnected,installedChannels,linkedChannels,+ officialMcpServers = [],+ isOfficialMcpConnected = () => false,tools,}: {channels: readonly MessengerPlatformItem[];isToolConnected: (tool: ConnectorCatalogItem) => boolean;integrationConnected: (id: string) => boolean;installedChannels: ReadonlySet<string>;+ isOfficialMcpConnected?: (identifier: string) => boolean;linkedChannels: ReadonlySet<string>;+ officialMcpServers?: readonly OfficialMcpServerType[];tools: readonly ConnectorCatalogItem[];}): MarketplaceApp[] => {const apps = new Map<string, MarketplaceApp>();@@ -92,6 +98,21 @@ export const buildMarketplaceApps = ({});}+ // Official servers never replace a LobeHub or Composio entry of the same app+ for (const server of officialMcpServers) {+ if (apps.has(server.identifier)) continue;+ apps.set(server.identifier, {+ category: server.category,+ channelLinked: false,+ channelPending: false,+ id: server.identifier,+ integrationConnected: false,+ name: server.label,+ officialMcp: server,+ toolConnected: isOfficialMcpConnected(server.identifier),+ });+ }+for (const channel of channels) {const app = apps.get(channel.id);const linked = linkedChannels.has(channel.id);diff --git a/src/features/Marketplace/Apps/connectOfficialMcp.test.ts b/src/features/Marketplace/Apps/connectOfficialMcp.test.tsnew file mode 100644index 00000000000..52d319d8f81--- /dev/null+++ b/src/features/Marketplace/Apps/connectOfficialMcp.test.ts@@ -0,0 +1,69 @@+import type { OfficialMcpServerType } from '@lobechat/const';+import { beforeEach, describe, expect, it, vi } from 'vitest';++import type { ToolStore } from '@/store/tool/store';++import { connectOfficialMcp } from './connectOfficialMcp';++const executeOAuthCreate = vi.hoisted(() => vi.fn());+vi.mock('@/utils/connectorOAuthCreate', () => ({ executeOAuthCreate }));+vi.mock('@/utils/connectorOAuth', () => ({ waitForConnectorOAuth: vi.fn() }));++const server: OfficialMcpServerType = {+ auth: 'oauth',+ author: 'Sentry',+ category: 'developer',+ description: 'Look up issues',+ icon: 'https://example.com/sentry.ico',+ identifier: 'sentry',+ label: 'Sentry',+ url: 'https://mcp.sentry.dev/mcp',+};++const createStore = () => {+ const store = {+ connectors: [],+ createConnector: vi.fn(async () => ({ id: 'c1', isNew: true })),+ deleteConnector: vi.fn(async () => {}),+ fetchConnectors: vi.fn(async () => {}),+ startConnectorOAuth: vi.fn(async () => 'https://auth'),+ syncConnectorTools: vi.fn(async () => {}),+ };+ return { get: () => store as unknown as ToolStore, store };+};++describe('connectOfficialMcp', () => {+ beforeEach(() => executeOAuthCreate.mockReset());++ it('creates an HTTP connector and lets the server resolve the OAuth client', async () => {+ const { get } = createStore();+ await connectOfficialMcp(server, null, get);+ expect(executeOAuthCreate).toHaveBeenCalledWith(+ expect.objectContaining({+ identifier: 'sentry',+ mcpConnectionType: 'http',+ mcpServerUrl: 'https://mcp.sentry.dev/mcp',+ oidcConfig: { scheme: 'dcr' },+ sourceType: 'custom',+ }),+ null,+ expect.any(Object),+ );+ });++ it('lists a public server’s tools without OAuth', async () => {+ const { get, store } = createStore();+ await connectOfficialMcp({ ...server, auth: 'none' }, undefined, get);+ expect(executeOAuthCreate).not.toHaveBeenCalled();+ expect(store.syncConnectorTools).toHaveBeenCalledWith('c1');+ });++ it('rolls back a new public connector whose tools cannot be listed', async () => {+ const { get, store } = createStore();+ store.syncConnectorTools.mockRejectedValueOnce(new Error('unreachable'));+ await expect(connectOfficialMcp({ ...server, auth: 'none' }, undefined, get)).rejects.toThrow(+ 'unreachable',+ );+ expect(store.deleteConnector).toHaveBeenCalledWith('c1');+ });+});diff --git a/src/features/Marketplace/Apps/connectOfficialMcp.ts b/src/features/Marketplace/Apps/connectOfficialMcp.tsnew file mode 100644index 00000000000..07374f7a208--- /dev/null+++ b/src/features/Marketplace/Apps/connectOfficialMcp.ts@@ -0,0 +1,53 @@+import type { OfficialMcpServerType } from '@lobechat/const';++import { connectorSelectors } from '@/store/tool/slices/connector/selectors';+import type { ToolStore } from '@/store/tool/store';+import { waitForConnectorOAuth } from '@/utils/connectorOAuth';+import { executeOAuthCreate } from '@/utils/connectorOAuthCreate';++/**+ * Connect a vendor's official remote MCP server as a regular HTTP connector.+ *+ * OAuth servers create the row and run the standard MCP authorization (the+ * server resolves the client through CIMD or DCR); public servers create the+ * row and list its tools. Either way a row this attempt created is rolled back+ * when the server cannot be reached or authorized.+ */+export const connectOfficialMcp = async (+ server: OfficialMcpServerType,+ popup: Window | null | undefined,+ get: () => ToolStore,+): Promise<void> => {+ const { createConnector, deleteConnector, fetchConnectors, startConnectorOAuth } = get();+ const base = {+ identifier: server.identifier,+ mcpConnectionType: 'http' as const,+ mcpServerUrl: server.url,+ metadata: { avatar: server.icon, description: server.description },+ name: server.label,+ sourceType: 'custom' as const,+ };++ if (server.auth === 'oauth') {+ await executeOAuthCreate({ ...base, oidcConfig: { scheme: 'dcr' as const } }, popup, {+ createConnector,+ deleteConnector,+ isConnectorConnected: async (id) => {+ await fetchConnectors();+ return connectorSelectors.connectorById(id)(get())?.status === 'connected';+ },+ startConnectorOAuth,+ waitForConnectorOAuth,+ });+ await fetchConnectors();+ return;+ }++ const { id, isNew } = await createConnector(base);+ try {+ await get().syncConnectorTools(id);+ } catch (error) {+ if (isNew) await deleteConnector(id);+ throw error;+ }+};diff --git a/src/features/Marketplace/Apps/useMarketplaceApps.ts b/src/features/Marketplace/Apps/useMarketplaceApps.tsindex a474f83ccc0..d617a98efbc 100644--- a/src/features/Marketplace/Apps/useMarketplaceApps.ts+++ b/src/features/Marketplace/Apps/useMarketplaceApps.ts@@ -1,3 +1,4 @@+import { OFFICIAL_MCP_SERVERS } from '@lobechat/const';import isEqual from 'fast-deep-equal';import { CONNECTOR_PAGE_IDS } from '@/features/Integrations/connectorPage';@@ -9,6 +10,7 @@ import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfiimport { useToolStore } from '@/store/tool';import { composioStoreSelectors, lobehubSkillStoreSelectors } from '@/store/tool/selectors';import { ComposioServerStatus } from '@/store/tool/slices/composioStore';+import { connectorSelectors } from '@/store/tool/slices/connector/selectors';import { LobehubSkillStatus } from '@/store/tool/slices/lobehubSkillStore/types';import { buildMarketplaceApps } from './catalog';@@ -45,6 +47,12 @@ export const useMarketplaceApps = () => {.filter((s) => s.status === LobehubSkillStatus.CONNECTED).map((s) => s.identifier),);+ const connectors = useToolStore(connectorSelectors.connectorList, isEqual);+ const connectedOfficialIds = new Set(+ connectors+ .filter((c) => c.status === 'connected' && c.visibility !== 'private')+ .map((c) => c.identifier),+ );const tools = buildIntegrationItems({pageOnlyProviderIds: CONNECTOR_PAGE_IDS,connectorAvailability: { composio, lobehub },@@ -61,7 +69,9 @@ export const useMarketplaceApps = () => {(id === 'github' && Boolean(github?.length)) ||(id === 'linear' && Boolean(linear.data?.length)),installedChannels: new Set(installations?.map((s) => s.platform)),+ isOfficialMcpConnected: (id) => connectedOfficialIds.has(id),linkedChannels: new Set(links?.map((s) => s.platform)),+ officialMcpServers: OFFICIAL_MCP_SERVERS,tools,});const syncs = [