History

Hide unknown MCP edit tool count

Rhys Sullivan committed 6 months ago

Commit 266acc91 parent 46ca2541 file · +11 −5Browse files

Unified · Split

packages/plugins/mcp/src/react/McpRemoteSourceFields.tsx+11−5
@@ -39,6 +39,14 @@ export function McpRemoteSourceFields(props: { · 38 unmodified lines
3939 readonly namespaceReadOnly?: boolean;
4040 readonly urlDisabled?: boolean;
4141 }) {
42+ const previewDescription = props.preview
43+ ? props.preview.connected
44+ ? props.preview.toolCount === null
45+ ? null
46+ : `${props.preview.toolCount} tool${props.preview.toolCount !== 1 ? "s" : ""} available`
47+ : "OAuth required to discover tools"
48+ : null;
49+
4250 if (props.preview) {
4351 return (
4452 <CardStack>
@@ -51,11 +59,9 @@ export function McpRemoteSourceFields(props: { · 6 unmodified lines
5159 <CardStackEntryTitle>
5260 {props.preview.serverName ?? props.preview.name}
5361 </CardStackEntryTitle>
54− <CardStackEntryDescription>
55− {props.preview.connected
56− ? `${props.preview.toolCount} tool${props.preview.toolCount !== 1 ? "s" : ""} available`
57− : "OAuth required to discover tools"}
58− </CardStackEntryDescription>
62+ {previewDescription ? (
63+ <CardStackEntryDescription>{previewDescription}</CardStackEntryDescription>
64+ ) : null}
5965 </CardStackEntryContent>
6066 <CardStackEntryActions>
6167 {props.preview.connected ? (