@igstack/app-catalog-frontend-core 6.15.0 → 6.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/api/infra/trpc.d.ts +36 -0
- package/dist/esm/internal.d.ts +1 -0
- package/dist/esm/internal.js +2 -0
- package/dist/esm/internal.js.map +1 -1
- package/dist/esm/lib/externalLink.d.ts +8 -0
- package/dist/esm/lib/externalLink.js +9 -0
- package/dist/esm/lib/externalLink.js.map +1 -0
- package/dist/esm/modules/appCatalog/context/AppCatalogContext.d.ts +3 -1
- package/dist/esm/modules/appCatalog/context/AppCatalogContext.js +2 -0
- package/dist/esm/modules/appCatalog/context/AppCatalogContext.js.map +1 -1
- package/dist/esm/modules/appCatalog/hooks/useUpdateApp.d.ts +36 -36
- package/dist/esm/modules/appCatalog/ui/components/SectionTabs.d.ts +2 -1
- package/dist/esm/modules/appCatalog/ui/components/SectionTabs.js +11 -1
- package/dist/esm/modules/appCatalog/ui/components/SectionTabs.js.map +1 -1
- package/dist/esm/modules/appCatalog/ui/components/SourcesList.d.ts +10 -0
- package/dist/esm/modules/appCatalog/ui/components/SourcesList.js +51 -0
- package/dist/esm/modules/appCatalog/ui/components/SourcesList.js.map +1 -0
- package/dist/esm/modules/appCatalog/ui/detail/AppDetails.js +9 -52
- package/dist/esm/modules/appCatalog/ui/detail/AppDetails.js.map +1 -1
- package/dist/esm/modules/communityTools/useCommunityTools.d.ts +6 -6
- package/dist/esm/modules/mcpCatalog/McpAccessLine.d.ts +5 -0
- package/dist/esm/modules/mcpCatalog/McpAccessLine.js +48 -0
- package/dist/esm/modules/mcpCatalog/McpAccessLine.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpCatalogPage.d.ts +11 -0
- package/dist/esm/modules/mcpCatalog/McpCatalogPage.js +289 -0
- package/dist/esm/modules/mcpCatalog/McpCatalogPage.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpInfoTiles.d.ts +5 -0
- package/dist/esm/modules/mcpCatalog/McpInfoTiles.js +88 -0
- package/dist/esm/modules/mcpCatalog/McpInfoTiles.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpSafetyLines.d.ts +5 -0
- package/dist/esm/modules/mcpCatalog/McpSafetyLines.js +82 -0
- package/dist/esm/modules/mcpCatalog/McpSafetyLines.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpSearchResult.d.ts +18 -0
- package/dist/esm/modules/mcpCatalog/McpSearchResult.js +150 -0
- package/dist/esm/modules/mcpCatalog/McpSearchResult.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpServerDetail.d.ts +8 -0
- package/dist/esm/modules/mcpCatalog/McpServerDetail.js +116 -0
- package/dist/esm/modules/mcpCatalog/McpServerDetail.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpServerRow.d.ts +10 -0
- package/dist/esm/modules/mcpCatalog/McpServerRow.js +75 -0
- package/dist/esm/modules/mcpCatalog/McpServerRow.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/McpToolsTable.d.ts +5 -0
- package/dist/esm/modules/mcpCatalog/McpToolsTable.js +24 -0
- package/dist/esm/modules/mcpCatalog/McpToolsTable.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/Triad.d.ts +13 -0
- package/dist/esm/modules/mcpCatalog/Triad.js +175 -0
- package/dist/esm/modules/mcpCatalog/Triad.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/cart/McpCart.d.ts +15 -0
- package/dist/esm/modules/mcpCatalog/cart/McpCart.js +156 -0
- package/dist/esm/modules/mcpCatalog/cart/McpCart.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/cart/useMcpCart.d.ts +11 -0
- package/dist/esm/modules/mcpCatalog/cart/useMcpCart.js +48 -0
- package/dist/esm/modules/mcpCatalog/cart/useMcpCart.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/install/InstallButton.d.ts +12 -0
- package/dist/esm/modules/mcpCatalog/install/InstallButton.js +126 -0
- package/dist/esm/modules/mcpCatalog/install/InstallButton.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/install/InstallMenu.d.ts +14 -0
- package/dist/esm/modules/mcpCatalog/install/InstallMenu.js +139 -0
- package/dist/esm/modules/mcpCatalog/install/InstallMenu.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/install/WhatHappensDialog.d.ts +10 -0
- package/dist/esm/modules/mcpCatalog/install/WhatHappensDialog.js +161 -0
- package/dist/esm/modules/mcpCatalog/install/WhatHappensDialog.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/install/installOptions.d.ts +40 -0
- package/dist/esm/modules/mcpCatalog/install/installOptions.js +204 -0
- package/dist/esm/modules/mcpCatalog/install/installOptions.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/install/useMcpPrefs.d.ts +14 -0
- package/dist/esm/modules/mcpCatalog/install/useMcpPrefs.js +39 -0
- package/dist/esm/modules/mcpCatalog/install/useMcpPrefs.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/searchMcpServers.d.ts +25 -0
- package/dist/esm/modules/mcpCatalog/searchMcpServers.js +44 -0
- package/dist/esm/modules/mcpCatalog/searchMcpServers.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/signIn.d.ts +13 -0
- package/dist/esm/modules/mcpCatalog/signIn.js +29 -0
- package/dist/esm/modules/mcpCatalog/signIn.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/useHasMcpServers.d.ts +8 -0
- package/dist/esm/modules/mcpCatalog/useHasMcpServers.js +13 -0
- package/dist/esm/modules/mcpCatalog/useHasMcpServers.js.map +1 -0
- package/dist/esm/modules/mcpCatalog/useMcpCatalogConfig.d.ts +7 -0
- package/dist/esm/modules/mcpCatalog/useMcpCatalogConfig.js +16 -0
- package/dist/esm/modules/mcpCatalog/useMcpCatalogConfig.js.map +1 -0
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/classic/schemas.js +3 -3
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/api.js +1 -1
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/checks.js +1 -1
- package/dist/esm/node_modules/.pnpm/zod@4.3.5/node_modules/zod/v4/core/schemas.js +2 -2
- package/dist/esm/routeTree.gen.d.ts +43 -17
- package/dist/esm/routeTree.gen.js +15 -3
- package/dist/esm/routeTree.gen.js.map +1 -1
- package/dist/esm/routes/_layout/community.$slug.d.ts +3 -3
- package/dist/esm/routes/_layout/community.d.ts +3 -3
- package/dist/esm/routes/_layout/mcp.$slug.d.ts +9 -0
- package/dist/esm/routes/_layout/mcp._slug.js +8 -0
- package/dist/esm/routes/_layout/mcp._slug.js.map +1 -0
- package/dist/esm/routes/_layout/mcp.d.ts +5 -1
- package/dist/esm/routes/_layout/mcp.js +45 -5
- package/dist/esm/routes/_layout/mcp.js.map +1 -1
- package/dist/esm/ui/button.d.ts +1 -1
- package/dist/esm/ui/components/header/Header.js +1 -5
- package/dist/esm/ui/components/header/Header.js.map +1 -1
- package/dist/esm/ui/empty.d.ts +1 -1
- package/dist/esm/ui/item.d.ts +1 -1
- package/dist/esm/userDb/AcDb.d.ts +10 -0
- package/dist/esm/userDb/AcDb.js +6 -0
- package/dist/esm/userDb/AcDb.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/modules/communityTools/timeAgo.test.ts +16 -0
- package/src/internal.ts +1 -0
- package/src/lib/externalLink.ts +10 -0
- package/src/modules/appCatalog/context/AppCatalogContext.tsx +5 -0
- package/src/modules/appCatalog/ui/components/SectionTabs.tsx +14 -1
- package/src/modules/appCatalog/ui/components/SourcesList.tsx +62 -0
- package/src/modules/appCatalog/ui/detail/AppDetails.tsx +6 -52
- package/src/modules/mcpCatalog/McpAccessLine.tsx +54 -0
- package/src/modules/mcpCatalog/McpCatalogPage.tsx +324 -0
- package/src/modules/mcpCatalog/McpInfoTiles.tsx +112 -0
- package/src/modules/mcpCatalog/McpSafetyLines.tsx +89 -0
- package/src/modules/mcpCatalog/McpSearchResult.tsx +173 -0
- package/src/modules/mcpCatalog/McpServerDetail.tsx +145 -0
- package/src/modules/mcpCatalog/McpServerRow.tsx +78 -0
- package/src/modules/mcpCatalog/McpToolsTable.tsx +36 -0
- package/src/modules/mcpCatalog/Triad.tsx +213 -0
- package/src/modules/mcpCatalog/cart/McpCart.tsx +171 -0
- package/src/modules/mcpCatalog/cart/useMcpCart.ts +64 -0
- package/src/modules/mcpCatalog/install/InstallButton.tsx +154 -0
- package/src/modules/mcpCatalog/install/InstallMenu.tsx +160 -0
- package/src/modules/mcpCatalog/install/WhatHappensDialog.tsx +199 -0
- package/src/modules/mcpCatalog/install/installOptions.tsx +266 -0
- package/src/modules/mcpCatalog/install/useMcpPrefs.ts +55 -0
- package/src/modules/mcpCatalog/searchMcpServers.ts +84 -0
- package/src/modules/mcpCatalog/signIn.ts +34 -0
- package/src/modules/mcpCatalog/useHasMcpServers.ts +22 -0
- package/src/modules/mcpCatalog/useMcpCatalogConfig.ts +20 -0
- package/src/routeTree.gen.ts +36 -5
- package/src/routes/_layout/mcp.$slug.tsx +10 -0
- package/src/routes/_layout/mcp.tsx +63 -3
- package/src/ui/components/header/Header.tsx +1 -7
- package/src/userDb/AcDb.ts +13 -0
- package/dist/esm/modules/appCatalog/ui/pages/McpPage.d.ts +0 -11
- package/dist/esm/modules/appCatalog/ui/pages/McpPage.js +0 -227
- package/dist/esm/modules/appCatalog/ui/pages/McpPage.js.map +0 -1
- package/dist/esm/modules/appCatalog/utils/fetchMcpTools.d.ts +0 -32
- package/dist/esm/modules/appCatalog/utils/fetchMcpTools.js +0 -79
- package/dist/esm/modules/appCatalog/utils/fetchMcpTools.js.map +0 -1
- package/src/modules/appCatalog/ui/pages/McpPage.tsx +0 -275
- package/src/modules/appCatalog/utils/fetchMcpTools.ts +0 -140
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import type { CatalogMcpServer } from '@igstack/app-catalog-backend-core'
|
|
2
|
+
import {
|
|
3
|
+
INSTALL_CONFIG_FILE,
|
|
4
|
+
whatHappensSteps,
|
|
5
|
+
} from '@igstack/app-catalog-shared-core'
|
|
6
|
+
import {
|
|
7
|
+
Braces,
|
|
8
|
+
Check,
|
|
9
|
+
Copy,
|
|
10
|
+
ExternalLink,
|
|
11
|
+
KeyRound,
|
|
12
|
+
SquareTerminal,
|
|
13
|
+
X,
|
|
14
|
+
} from 'lucide-react'
|
|
15
|
+
import { useRef } from 'react'
|
|
16
|
+
import { createPortal } from 'react-dom'
|
|
17
|
+
import { useDismissable } from '~/modules/dismiss/DismissStack'
|
|
18
|
+
import { Button } from '~/ui/button'
|
|
19
|
+
import { InstallButton } from './InstallButton'
|
|
20
|
+
import {
|
|
21
|
+
VISIBLE_INSTALL_OPTIONS,
|
|
22
|
+
copyText,
|
|
23
|
+
useCopyFlash,
|
|
24
|
+
useInstall,
|
|
25
|
+
} from './installOptions'
|
|
26
|
+
import { useMcpPrefs } from './useMcpPrefs'
|
|
27
|
+
|
|
28
|
+
const GROUP =
|
|
29
|
+
'w-full text-[11.5px] tracking-[.05em] text-muted-foreground uppercase'
|
|
30
|
+
const CHIP =
|
|
31
|
+
'inline-flex items-center gap-[5px] rounded-full border border-border bg-card px-[9px] py-0.5 font-semibold [&_svg]:size-[13px]'
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Plain steps for what installing `servers` does with the chosen AI, what it
|
|
35
|
+
* touches on your machine, and the full prompt. Picking an AI here is the
|
|
36
|
+
* same remembered choice the Install menu makes.
|
|
37
|
+
*/
|
|
38
|
+
export function WhatHappensDialog({
|
|
39
|
+
servers,
|
|
40
|
+
onClose,
|
|
41
|
+
}: {
|
|
42
|
+
servers: readonly CatalogMcpServer[]
|
|
43
|
+
onClose: () => void
|
|
44
|
+
}) {
|
|
45
|
+
const ref = useRef<HTMLDivElement>(null)
|
|
46
|
+
useDismissable(ref, onClose)
|
|
47
|
+
const { installWith, setInstallWith } = useMcpPrefs()
|
|
48
|
+
const { resolved, apps, prompt } = useInstall(servers)
|
|
49
|
+
const [flash, setFlash] = useCopyFlash()
|
|
50
|
+
|
|
51
|
+
const option = VISIBLE_INSTALL_OPTIONS.find((o) => o.id === installWith)?.id
|
|
52
|
+
const steps = whatHappensSteps(resolved, option, { apps })
|
|
53
|
+
const fullPrompt = prompt(option)
|
|
54
|
+
const tokens = resolved.filter((s) => s.auth.kind === 'token').length
|
|
55
|
+
const runsLocally = resolved.some((s) => s.transport.type === 'stdio')
|
|
56
|
+
const hosts = [
|
|
57
|
+
...new Set(
|
|
58
|
+
resolved.flatMap((s) =>
|
|
59
|
+
s.transport.type === 'http' ? [new URL(s.transport.url).host] : [],
|
|
60
|
+
),
|
|
61
|
+
),
|
|
62
|
+
]
|
|
63
|
+
const title = `What happens when you install ${
|
|
64
|
+
servers.length === 1 ? servers[0]!.displayName : `${servers.length} servers`
|
|
65
|
+
}`
|
|
66
|
+
|
|
67
|
+
return createPortal(
|
|
68
|
+
<div className="fixed inset-0 z-50 flex items-start justify-center overflow-y-auto p-4 sm:p-10">
|
|
69
|
+
<button
|
|
70
|
+
type="button"
|
|
71
|
+
aria-label="Close"
|
|
72
|
+
tabIndex={-1}
|
|
73
|
+
onClick={onClose}
|
|
74
|
+
className="fixed inset-0 -z-10 bg-black/40 backdrop-blur-[2px]"
|
|
75
|
+
/>
|
|
76
|
+
<div
|
|
77
|
+
ref={ref}
|
|
78
|
+
role="dialog"
|
|
79
|
+
aria-modal="true"
|
|
80
|
+
aria-label={title}
|
|
81
|
+
tabIndex={-1}
|
|
82
|
+
className="relative my-auto w-full max-w-[560px] rounded-[var(--radius)] border border-border bg-background px-6 py-5 text-foreground shadow-2xl outline-none"
|
|
83
|
+
>
|
|
84
|
+
<button
|
|
85
|
+
type="button"
|
|
86
|
+
aria-label="Close"
|
|
87
|
+
onClick={onClose}
|
|
88
|
+
className="absolute top-3 right-3 rounded-full p-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
|
|
89
|
+
>
|
|
90
|
+
<X className="size-4" />
|
|
91
|
+
</button>
|
|
92
|
+
<h2 className="m-0 mb-1 pr-8 font-serif text-[22px] font-semibold">
|
|
93
|
+
{title}
|
|
94
|
+
</h2>
|
|
95
|
+
<p className="m-0 text-muted-foreground">Install with:</p>
|
|
96
|
+
<div className="mt-3.5 mb-1 flex flex-wrap gap-1.5">
|
|
97
|
+
{VISIBLE_INSTALL_OPTIONS.map((o, i) => (
|
|
98
|
+
<button
|
|
99
|
+
key={o.id}
|
|
100
|
+
type="button"
|
|
101
|
+
aria-pressed={o.id === option}
|
|
102
|
+
// The popup takes the caret: the picked AI, else the first.
|
|
103
|
+
autoFocus={option ? o.id === option : i === 0}
|
|
104
|
+
onClick={() => void setInstallWith(o.id)}
|
|
105
|
+
className="inline-flex min-h-[30px] items-center gap-1.5 rounded-full border border-border bg-card py-[3px] pr-2.5 pl-1 text-[12.5px] font-bold aria-pressed:border-primary aria-pressed:bg-accent [&_svg]:size-5"
|
|
106
|
+
>
|
|
107
|
+
<o.Icon />
|
|
108
|
+
{o.label}
|
|
109
|
+
</button>
|
|
110
|
+
))}
|
|
111
|
+
</div>
|
|
112
|
+
<ol
|
|
113
|
+
data-testid="mcp-what-steps"
|
|
114
|
+
className="m-0 mt-4 grid list-none gap-0.5 p-0 [counter-reset:w]"
|
|
115
|
+
>
|
|
116
|
+
{steps.map((step) => (
|
|
117
|
+
<li
|
|
118
|
+
key={step.title}
|
|
119
|
+
className="grid grid-cols-[28px_1fr] gap-2.5 border-t border-border py-2 text-[13.5px] [counter-increment:w] first:border-t-0 before:grid before:size-6 before:place-items-center before:rounded-full before:bg-secondary before:text-xs before:font-extrabold before:text-secondary-foreground before:content-[counter(w)]"
|
|
120
|
+
>
|
|
121
|
+
<div>
|
|
122
|
+
<b className="block">{step.title}</b>
|
|
123
|
+
<span className="text-[12.5px] text-muted-foreground">
|
|
124
|
+
{step.detail}
|
|
125
|
+
</span>
|
|
126
|
+
</div>
|
|
127
|
+
</li>
|
|
128
|
+
))}
|
|
129
|
+
</ol>
|
|
130
|
+
<div className="mt-3.5 flex flex-wrap gap-1.5 rounded-[calc(var(--radius)-2px)] bg-muted px-3 py-2.5 text-[12.5px]">
|
|
131
|
+
<b className={GROUP}>Touches on your machine</b>
|
|
132
|
+
<div data-testid="mcp-what-touches" className="contents">
|
|
133
|
+
<span className={CHIP}>
|
|
134
|
+
<Braces aria-hidden="true" />
|
|
135
|
+
{option ? INSTALL_CONFIG_FILE[option] : "your AI's settings"}
|
|
136
|
+
</span>
|
|
137
|
+
{tokens > 0 && (
|
|
138
|
+
<span className={CHIP}>
|
|
139
|
+
<KeyRound aria-hidden="true" />
|
|
140
|
+
{tokens} token{tokens > 1 ? 's' : ''} you create
|
|
141
|
+
</span>
|
|
142
|
+
)}
|
|
143
|
+
{runsLocally && (
|
|
144
|
+
<span className={CHIP}>
|
|
145
|
+
<SquareTerminal aria-hidden="true" />
|
|
146
|
+
runs on your computer
|
|
147
|
+
</span>
|
|
148
|
+
)}
|
|
149
|
+
</div>
|
|
150
|
+
{hosts.length > 0 && (
|
|
151
|
+
<>
|
|
152
|
+
<b className={`${GROUP} mt-1.5`}>Talks to</b>
|
|
153
|
+
<div data-testid="mcp-what-talks-to" className="contents">
|
|
154
|
+
{hosts.map((h) => (
|
|
155
|
+
<span key={h} className={CHIP}>
|
|
156
|
+
<ExternalLink aria-hidden="true" />
|
|
157
|
+
{h}
|
|
158
|
+
</span>
|
|
159
|
+
))}
|
|
160
|
+
</div>
|
|
161
|
+
</>
|
|
162
|
+
)}
|
|
163
|
+
</div>
|
|
164
|
+
<div className="mt-4 flex flex-wrap items-center gap-2">
|
|
165
|
+
<InstallButton servers={servers} />
|
|
166
|
+
<Button
|
|
167
|
+
size="sm"
|
|
168
|
+
variant="outline"
|
|
169
|
+
onClick={() =>
|
|
170
|
+
void copyText(fullPrompt).then((ok) =>
|
|
171
|
+
setFlash(ok ? 'copied' : 'copy-failed'),
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
>
|
|
175
|
+
{flash === 'copied' ? (
|
|
176
|
+
<Check aria-hidden="true" />
|
|
177
|
+
) : (
|
|
178
|
+
<Copy aria-hidden="true" />
|
|
179
|
+
)}
|
|
180
|
+
{flash === 'copied'
|
|
181
|
+
? 'Copied'
|
|
182
|
+
: flash === 'copy-failed'
|
|
183
|
+
? 'Copy failed'
|
|
184
|
+
: 'Copy full prompt'}
|
|
185
|
+
</Button>
|
|
186
|
+
</div>
|
|
187
|
+
<details className="mt-2.5">
|
|
188
|
+
<summary className="cursor-pointer text-[13px] font-bold text-secondary-foreground">
|
|
189
|
+
Show the full prompt
|
|
190
|
+
</summary>
|
|
191
|
+
<pre className="mt-2 max-h-72 overflow-auto rounded-md bg-muted p-3 text-xs whitespace-pre-wrap">
|
|
192
|
+
{fullPrompt}
|
|
193
|
+
</pre>
|
|
194
|
+
</details>
|
|
195
|
+
</div>
|
|
196
|
+
</div>,
|
|
197
|
+
document.body,
|
|
198
|
+
)
|
|
199
|
+
}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import type { CatalogMcpServer } from '@igstack/app-catalog-backend-core'
|
|
2
|
+
import type { InstallOptionId } from '@igstack/app-catalog-shared-core'
|
|
3
|
+
import {
|
|
4
|
+
cliCommand,
|
|
5
|
+
cursorLink,
|
|
6
|
+
installPrompt,
|
|
7
|
+
jsonConfig,
|
|
8
|
+
resolveUrl,
|
|
9
|
+
vscodeLink,
|
|
10
|
+
} from '@igstack/app-catalog-shared-core'
|
|
11
|
+
import { useCallback, useEffect, useId, useMemo, useState } from 'react'
|
|
12
|
+
import { externalLink } from '~/lib/externalLink'
|
|
13
|
+
import { useAppCatalogContext } from '../../appCatalog/context/AppCatalogContext'
|
|
14
|
+
import {
|
|
15
|
+
useMcpCatalogConfig,
|
|
16
|
+
useSensitiveDataLabel,
|
|
17
|
+
} from '../useMcpCatalogConfig'
|
|
18
|
+
|
|
19
|
+
export interface InstallOption {
|
|
20
|
+
id: InstallOptionId
|
|
21
|
+
label: string
|
|
22
|
+
hint: string
|
|
23
|
+
Icon: () => React.ReactNode
|
|
24
|
+
/** Copies text rather than installing: the menu's "Text only" group. */
|
|
25
|
+
text?: boolean
|
|
26
|
+
/** In code, not on screen: its link is unverified. */
|
|
27
|
+
hidden?: boolean
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const ICON = 'size-[22px] shrink-0'
|
|
31
|
+
|
|
32
|
+
function claudeIcon(fill: string, stroke = '#fff') {
|
|
33
|
+
return function ClaudeIcon() {
|
|
34
|
+
return (
|
|
35
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" className={ICON}>
|
|
36
|
+
<rect width="24" height="24" rx="6" fill={fill} />
|
|
37
|
+
<g stroke={stroke} strokeWidth="2.2" strokeLinecap="round">
|
|
38
|
+
<path d="M12 5v14M5 12h14M7.1 7.1l9.8 9.8M16.9 7.1l-9.8 9.8" />
|
|
39
|
+
</g>
|
|
40
|
+
</svg>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function CursorIcon() {
|
|
46
|
+
return (
|
|
47
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" className={ICON}>
|
|
48
|
+
<rect width="24" height="24" rx="6" fill="#14120b" />
|
|
49
|
+
<g fill="none" stroke="#fff" strokeWidth="1.5" strokeLinejoin="round">
|
|
50
|
+
<path d="M12 4.5 18.5 8.2v7.6L12 19.5l-6.5-3.7V8.2Z" />
|
|
51
|
+
<path d="M5.5 8.2 12 12l6.5-3.8M12 12v7.5" />
|
|
52
|
+
</g>
|
|
53
|
+
</svg>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function GeminiIcon() {
|
|
58
|
+
// One gradient per icon: an id shared by two icons breaks when one unmounts.
|
|
59
|
+
const id = useId()
|
|
60
|
+
return (
|
|
61
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" className={ICON}>
|
|
62
|
+
<defs>
|
|
63
|
+
<linearGradient id={id} x1="0" y1="0" x2="1" y2="1">
|
|
64
|
+
<stop offset="0" stopColor="#4796e3" />
|
|
65
|
+
<stop offset="1" stopColor="#9168c0" />
|
|
66
|
+
</linearGradient>
|
|
67
|
+
</defs>
|
|
68
|
+
<rect width="24" height="24" rx="6" fill="#eef2fb" />
|
|
69
|
+
<path
|
|
70
|
+
d="M12 3.5c.5 4.5 4 8 8.5 8.5-4.5.5-8 4-8.5 8.5-.5-4.5-4-8-8.5-8.5 4.5-.5 8-4 8.5-8.5Z"
|
|
71
|
+
fill={`url(#${id})`}
|
|
72
|
+
/>
|
|
73
|
+
</svg>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** A lucide glyph on a muted tile; themed, so it reads in light and dark. */
|
|
78
|
+
function textIcon(d: string) {
|
|
79
|
+
return function TextIcon() {
|
|
80
|
+
return (
|
|
81
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" className={ICON}>
|
|
82
|
+
<rect width="24" height="24" rx="6" fill="var(--muted)" />
|
|
83
|
+
<g
|
|
84
|
+
transform="translate(5 5) scale(.58)"
|
|
85
|
+
fill="none"
|
|
86
|
+
stroke="var(--secondary-foreground)"
|
|
87
|
+
strokeWidth="2.4"
|
|
88
|
+
strokeLinecap="round"
|
|
89
|
+
strokeLinejoin="round"
|
|
90
|
+
>
|
|
91
|
+
<path d={d} />
|
|
92
|
+
</g>
|
|
93
|
+
</svg>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const INSTALL_OPTIONS: readonly InstallOption[] = [
|
|
99
|
+
{
|
|
100
|
+
id: 'claude-vscode',
|
|
101
|
+
label: 'Claude Code in VS Code',
|
|
102
|
+
hint: 'Opens Claude Code with the install prompt',
|
|
103
|
+
Icon: claudeIcon('#0065a9'),
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 'claude-code',
|
|
107
|
+
label: 'Claude Code in terminal',
|
|
108
|
+
hint: 'Copies a claude mcp add command',
|
|
109
|
+
Icon: claudeIcon('#1f1e1d', '#d97757'),
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: 'claude-desktop',
|
|
113
|
+
label: 'Claude Code desktop',
|
|
114
|
+
hint: 'Opens a claude:// link with the prompt',
|
|
115
|
+
Icon: claudeIcon('#d97757'),
|
|
116
|
+
hidden: true,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 'cursor',
|
|
120
|
+
label: 'Cursor',
|
|
121
|
+
hint: 'Opens Cursor’s install dialog',
|
|
122
|
+
Icon: CursorIcon,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'gemini',
|
|
126
|
+
label: 'Gemini CLI',
|
|
127
|
+
hint: 'Copies a terminal command',
|
|
128
|
+
Icon: GeminiIcon,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: 'prompt',
|
|
132
|
+
label: 'Copy prompt',
|
|
133
|
+
hint: 'Paste into any AI chat',
|
|
134
|
+
Icon: textIcon(
|
|
135
|
+
'M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z',
|
|
136
|
+
),
|
|
137
|
+
text: true,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 'json',
|
|
141
|
+
label: 'Copy JSON config',
|
|
142
|
+
hint: 'For any client’s mcpServers file',
|
|
143
|
+
Icon: textIcon(
|
|
144
|
+
'M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5a2 2 0 0 0 2 2h1M16 21h1a2 2 0 0 0 2-2v-5a2 2 0 0 1 2-2 2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1',
|
|
145
|
+
),
|
|
146
|
+
text: true,
|
|
147
|
+
},
|
|
148
|
+
]
|
|
149
|
+
|
|
150
|
+
/** The options a person can pick: everything not hidden. */
|
|
151
|
+
export const VISIBLE_INSTALL_OPTIONS = INSTALL_OPTIONS.filter((o) => !o.hidden)
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Copies text, falling back to a hidden textarea where the API is refused.
|
|
155
|
+
* Resolves false when both fail; never rejects.
|
|
156
|
+
*/
|
|
157
|
+
export async function copyText(text: string): Promise<boolean> {
|
|
158
|
+
try {
|
|
159
|
+
await navigator.clipboard.writeText(text)
|
|
160
|
+
return true
|
|
161
|
+
} catch {
|
|
162
|
+
const area = document.createElement('textarea')
|
|
163
|
+
area.value = text
|
|
164
|
+
document.body.appendChild(area)
|
|
165
|
+
try {
|
|
166
|
+
area.select()
|
|
167
|
+
return document.execCommand('copy')
|
|
168
|
+
} catch {
|
|
169
|
+
return false
|
|
170
|
+
} finally {
|
|
171
|
+
area.remove()
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export type CopyFlash = 'copied' | 'copy-failed' | null
|
|
177
|
+
|
|
178
|
+
/** A copy's outcome, shown for a moment and then cleared. */
|
|
179
|
+
export function useCopyFlash() {
|
|
180
|
+
const [flash, setFlash] = useState<CopyFlash>(null)
|
|
181
|
+
useEffect(() => {
|
|
182
|
+
if (!flash) return
|
|
183
|
+
const t = setTimeout(() => setFlash(null), 1600)
|
|
184
|
+
return () => clearTimeout(t)
|
|
185
|
+
}, [flash])
|
|
186
|
+
return [flash, setFlash] as const
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Everything an install needs for `servers`: their URLs resolved against this
|
|
191
|
+
* host, the prompt for an option, and `run`, which carries the option out and
|
|
192
|
+
* says whether it copied (the caller shows "Copied"), failed to copy, or
|
|
193
|
+
* opened another app.
|
|
194
|
+
*/
|
|
195
|
+
export function useInstall(servers: readonly CatalogMcpServer[]) {
|
|
196
|
+
const { resources } = useAppCatalogContext()
|
|
197
|
+
const sensitiveDataLabel = useSensitiveDataLabel()
|
|
198
|
+
const catalogMcpAvailable =
|
|
199
|
+
useMcpCatalogConfig()?.catalogMcpAvailable ?? false
|
|
200
|
+
|
|
201
|
+
const origin = window.location.origin
|
|
202
|
+
const resolved = useMemo(
|
|
203
|
+
() => servers.map((s) => resolveUrl(s, origin)),
|
|
204
|
+
[servers, origin],
|
|
205
|
+
)
|
|
206
|
+
const apps = useMemo(
|
|
207
|
+
() =>
|
|
208
|
+
[...new Set(servers.flatMap((s) => s.requiredAppSlugs ?? []))].flatMap(
|
|
209
|
+
(slug) => {
|
|
210
|
+
const app = resources.find((r) => r.slug === slug)
|
|
211
|
+
return app
|
|
212
|
+
? [{ slug, name: app.displayName, url: `${origin}/app/${slug}` }]
|
|
213
|
+
: []
|
|
214
|
+
},
|
|
215
|
+
),
|
|
216
|
+
[servers, resources, origin],
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
const prompt = useCallback(
|
|
220
|
+
(option?: InstallOptionId) =>
|
|
221
|
+
installPrompt(resolved, {
|
|
222
|
+
option,
|
|
223
|
+
apps,
|
|
224
|
+
catalogMcpAvailable,
|
|
225
|
+
sensitiveDataLabel,
|
|
226
|
+
}),
|
|
227
|
+
[resolved, apps, catalogMcpAvailable, sensitiveDataLabel],
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
const run = useCallback(
|
|
231
|
+
async (
|
|
232
|
+
option: InstallOptionId,
|
|
233
|
+
): Promise<'copied' | 'copy-failed' | 'opened'> => {
|
|
234
|
+
const open = (url: string) => {
|
|
235
|
+
externalLink.open(url)
|
|
236
|
+
return 'opened' as const
|
|
237
|
+
}
|
|
238
|
+
const copy = async (text: string) =>
|
|
239
|
+
(await copyText(text)) ? ('copied' as const) : ('copy-failed' as const)
|
|
240
|
+
switch (option) {
|
|
241
|
+
case 'claude-vscode':
|
|
242
|
+
return open(vscodeLink(prompt(option)))
|
|
243
|
+
case 'claude-desktop':
|
|
244
|
+
// ponytail: unverified scheme, hidden from the menu until confirmed.
|
|
245
|
+
return open(
|
|
246
|
+
`claude://claude.ai/new?q=${encodeURIComponent(prompt(option))}`,
|
|
247
|
+
)
|
|
248
|
+
case 'cursor':
|
|
249
|
+
// A Cursor link takes one server; several go in as config.
|
|
250
|
+
return resolved.length === 1
|
|
251
|
+
? open(cursorLink(resolved[0]!))
|
|
252
|
+
: copy(jsonConfig(resolved))
|
|
253
|
+
case 'claude-code':
|
|
254
|
+
case 'gemini':
|
|
255
|
+
return copy(cliCommand(option, resolved))
|
|
256
|
+
case 'prompt':
|
|
257
|
+
return copy(prompt(option))
|
|
258
|
+
case 'json':
|
|
259
|
+
return copy(jsonConfig(resolved))
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
[resolved, prompt],
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
return { resolved, apps, prompt, run, sensitiveDataLabel }
|
|
266
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { InstallOptionId } from '@igstack/app-catalog-shared-core'
|
|
2
|
+
import { useLiveQuery } from 'dexie-react-hooks'
|
|
3
|
+
import { useCallback, useMemo } from 'react'
|
|
4
|
+
import { useDb } from '~/userDb/DbContext'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The MCP tab's remembered choices, in this browser's IndexedDB: how you
|
|
8
|
+
* install, and which servers you marked installed. Live, so every button and
|
|
9
|
+
* row on screen follows a change made anywhere.
|
|
10
|
+
*/
|
|
11
|
+
export function useMcpPrefs(): {
|
|
12
|
+
/** Still reading IndexedDB: nothing is known yet, not even "no choice". */
|
|
13
|
+
loading: boolean
|
|
14
|
+
installWith?: InstallOptionId
|
|
15
|
+
setInstallWith: (id: InstallOptionId) => Promise<void>
|
|
16
|
+
installed: Set<string>
|
|
17
|
+
toggleInstalled: (slug: string) => Promise<void>
|
|
18
|
+
} {
|
|
19
|
+
const db = useDb()
|
|
20
|
+
const rows = useLiveQuery(() => db.mcpPrefs.toArray(), [db])
|
|
21
|
+
|
|
22
|
+
const installWith = rows?.find((r) => r.key === 'installWith')?.value
|
|
23
|
+
const installedList = rows?.find((r) => r.key === 'installed')?.value
|
|
24
|
+
const installed = useMemo(() => new Set(installedList), [installedList])
|
|
25
|
+
|
|
26
|
+
const setInstallWith = useCallback(
|
|
27
|
+
async (id: InstallOptionId) => {
|
|
28
|
+
await db.mcpPrefs.put({ key: 'installWith', value: id })
|
|
29
|
+
},
|
|
30
|
+
[db],
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
const toggleInstalled = useCallback(
|
|
34
|
+
(slug: string) =>
|
|
35
|
+
db.transaction('rw', db.mcpPrefs, async () => {
|
|
36
|
+
const row = await db.mcpPrefs.get('installed')
|
|
37
|
+
const list = row?.key === 'installed' ? row.value : []
|
|
38
|
+
await db.mcpPrefs.put({
|
|
39
|
+
key: 'installed',
|
|
40
|
+
value: list.includes(slug)
|
|
41
|
+
? list.filter((s) => s !== slug)
|
|
42
|
+
: [...list, slug],
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
45
|
+
[db],
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
loading: rows === undefined,
|
|
50
|
+
installWith,
|
|
51
|
+
setInstallWith,
|
|
52
|
+
installed,
|
|
53
|
+
toggleInstalled,
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { McpServer } from '@igstack/app-catalog-shared-core'
|
|
2
|
+
import { SIGN_IN } from './signIn'
|
|
3
|
+
|
|
4
|
+
type Searchable = Pick<
|
|
5
|
+
McpServer,
|
|
6
|
+
| 'displayName'
|
|
7
|
+
| 'description'
|
|
8
|
+
| 'category'
|
|
9
|
+
| 'aliases'
|
|
10
|
+
| 'status'
|
|
11
|
+
| 'tools'
|
|
12
|
+
| 'auth'
|
|
13
|
+
| 'ownerSlug'
|
|
14
|
+
>
|
|
15
|
+
|
|
16
|
+
/** Names the page knows and a bare server does not: what a person would type. */
|
|
17
|
+
export interface McpSearchLookups {
|
|
18
|
+
/** The configured title of a category key. */
|
|
19
|
+
categoryTitle?: (key: string) => string | undefined
|
|
20
|
+
/** The display name of the owning person or group. */
|
|
21
|
+
ownerName?: (slug: string) => string | undefined
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface McpSearchHit<TServer extends Searchable> {
|
|
25
|
+
server: TServer
|
|
26
|
+
score: number
|
|
27
|
+
/** Names of the server's tools that contain a search term, in tool order. */
|
|
28
|
+
hitTools: string[]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The query's terms: lower-cased, split on whitespace. */
|
|
32
|
+
export function searchTerms(q: string): string[] {
|
|
33
|
+
return q.toLowerCase().split(/\s+/).filter(Boolean)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Every server that matches every term somewhere (name, description, category
|
|
38
|
+
* key and title, owner, status, sign-in, aliases, tool names), best first. A name match
|
|
39
|
+
* weighs most (+10), then an alias (+6), the description (+3) and each tool
|
|
40
|
+
* whose name holds a term (+2); production adds 1, anything else takes 2 off.
|
|
41
|
+
*/
|
|
42
|
+
export function searchMcpServers<TServer extends Searchable>(
|
|
43
|
+
servers: readonly TServer[],
|
|
44
|
+
q: string,
|
|
45
|
+
lookups: McpSearchLookups = {},
|
|
46
|
+
): McpSearchHit<TServer>[] {
|
|
47
|
+
const terms = searchTerms(q)
|
|
48
|
+
if (terms.length === 0) return []
|
|
49
|
+
return servers
|
|
50
|
+
.flatMap((server) => {
|
|
51
|
+
const toolNames = server.tools.map((t) => t.name)
|
|
52
|
+
const aliases = (server.aliases ?? []).map((a) => a.toLowerCase())
|
|
53
|
+
const hay = [
|
|
54
|
+
server.displayName,
|
|
55
|
+
server.description,
|
|
56
|
+
server.category,
|
|
57
|
+
lookups.categoryTitle?.(server.category) ?? '',
|
|
58
|
+
server.ownerSlug ? (lookups.ownerName?.(server.ownerSlug) ?? '') : '',
|
|
59
|
+
// The status and sign-in as their badges read.
|
|
60
|
+
server.status,
|
|
61
|
+
SIGN_IN[server.auth.kind].badge,
|
|
62
|
+
...aliases,
|
|
63
|
+
...toolNames,
|
|
64
|
+
]
|
|
65
|
+
.join(' ')
|
|
66
|
+
.toLowerCase()
|
|
67
|
+
if (!terms.every((t) => hay.includes(t))) return []
|
|
68
|
+
|
|
69
|
+
const name = server.displayName.toLowerCase()
|
|
70
|
+
const description = server.description.toLowerCase()
|
|
71
|
+
let score = 0
|
|
72
|
+
for (const t of terms) {
|
|
73
|
+
if (name.includes(t)) score += 10
|
|
74
|
+
if (aliases.some((a) => a.includes(t))) score += 6
|
|
75
|
+
if (description.includes(t)) score += 3
|
|
76
|
+
}
|
|
77
|
+
const hitTools = toolNames.filter((n) =>
|
|
78
|
+
terms.some((t) => n.toLowerCase().includes(t)),
|
|
79
|
+
)
|
|
80
|
+
score += hitTools.length * 2 + (server.status === 'production' ? 1 : -2)
|
|
81
|
+
return [{ server, score, hitTools }]
|
|
82
|
+
})
|
|
83
|
+
.sort((a, b) => b.score - a.score)
|
|
84
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { McpServer } from '@igstack/app-catalog-shared-core'
|
|
2
|
+
import { KeyRound, LockOpen, ShieldCheck } from 'lucide-react'
|
|
3
|
+
|
|
4
|
+
/** How a server signs you in: its icon, short badge text and the full sentence. */
|
|
5
|
+
export const SIGN_IN: Record<
|
|
6
|
+
McpServer['auth']['kind'],
|
|
7
|
+
{ Icon: typeof KeyRound; badge: string; tip: string }
|
|
8
|
+
> = {
|
|
9
|
+
sso: {
|
|
10
|
+
Icon: ShieldCheck,
|
|
11
|
+
badge: 'SSO',
|
|
12
|
+
tip: 'Sign-in: single sign-on. A browser window opens to sign you in',
|
|
13
|
+
},
|
|
14
|
+
token: {
|
|
15
|
+
Icon: KeyRound,
|
|
16
|
+
badge: 'Personal token',
|
|
17
|
+
tip: 'Sign-in: your personal token, pasted once',
|
|
18
|
+
},
|
|
19
|
+
none: { Icon: LockOpen, badge: 'No sign-in', tip: 'No sign-in needed' },
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Beta and personal servers say so; production goes unmarked. */
|
|
23
|
+
export const STATUS_CHIP: Partial<
|
|
24
|
+
Record<McpServer['status'], { label: string; className: string }>
|
|
25
|
+
> = {
|
|
26
|
+
beta: {
|
|
27
|
+
label: 'Beta',
|
|
28
|
+
className: 'bg-amber-500/20 text-amber-800 dark:text-amber-300',
|
|
29
|
+
},
|
|
30
|
+
personal: {
|
|
31
|
+
label: 'Personal',
|
|
32
|
+
className: 'bg-sky-500/15 text-sky-800 dark:text-sky-300',
|
|
33
|
+
},
|
|
34
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { QueryClient } from '@tanstack/react-query'
|
|
2
|
+
import { useQuery } from '@tanstack/react-query'
|
|
3
|
+
import { ApiQueryMagazineAppCatalog } from '~/modules/appCatalog/api/ApiQueryMagazineAppCatalog'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Whether the catalog lists any MCP server, read with the route context's
|
|
7
|
+
* client for the route above the layout's providers. The layout's own query,
|
|
8
|
+
* so it is one request. Undefined until the catalog is in, and after a failed
|
|
9
|
+
* load, which the layout reports itself.
|
|
10
|
+
*/
|
|
11
|
+
export function useHasMcpServers(
|
|
12
|
+
queryClient: QueryClient,
|
|
13
|
+
): boolean | undefined {
|
|
14
|
+
const { data } = useQuery(
|
|
15
|
+
ApiQueryMagazineAppCatalog.getAppCatalog(),
|
|
16
|
+
queryClient,
|
|
17
|
+
)
|
|
18
|
+
// The type says required, but a returning visitor's IndexedDB copy from an
|
|
19
|
+
// older build has no `mcpServers` until the network answers.
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
21
|
+
return data && (data.mcpServers ? data.mcpServers.length > 0 : undefined)
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query'
|
|
2
|
+
import { useTRPC } from '~/api/infra/trpc'
|
|
3
|
+
|
|
4
|
+
const DEFAULT_SENSITIVE_DATA_LABEL = 'Sensitive data'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The deployment's display settings for the MCP tab: categories, intents,
|
|
8
|
+
* wording. Undefined until loaded.
|
|
9
|
+
*/
|
|
10
|
+
export function useMcpCatalogConfig() {
|
|
11
|
+
const trpc = useTRPC()
|
|
12
|
+
return useQuery(trpc.mcpCatalog.config.queryOptions()).data
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** The tag for servers that touch sensitive data, as the deployment words it. */
|
|
16
|
+
export function useSensitiveDataLabel(): string {
|
|
17
|
+
return (
|
|
18
|
+
useMcpCatalogConfig()?.sensitiveDataLabel ?? DEFAULT_SENSITIVE_DATA_LABEL
|
|
19
|
+
)
|
|
20
|
+
}
|