Skip to content

Commit 1059ff4

Browse files
authored
feat(code): add MCP servers entry to main sidebar under Skills (#2010)
1 parent 022b708 commit 1059ff4

24 files changed

Lines changed: 89 additions & 48 deletions

apps/code/src/renderer/components/MainLayout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { CommandMenu } from "@features/command/components/CommandMenu";
1010
import { CommandCenterView } from "@features/command-center/components/CommandCenterView";
1111
import { InboxView } from "@features/inbox/components/InboxView";
1212
import { useInboxDeepLink } from "@features/inbox/hooks/useInboxDeepLink";
13+
import { McpServersView } from "@features/mcp-servers/components/McpServersView";
1314
import { FolderSettingsView } from "@features/settings/components/FolderSettingsView";
1415
import { SettingsDialog } from "@features/settings/components/SettingsDialog";
1516
import { useSettingsDialogStore } from "@features/settings/stores/settingsDialogStore";
@@ -129,6 +130,8 @@ export function MainLayout() {
129130
{view.type === "command-center" && <CommandCenterView />}
130131

131132
{view.type === "skills" && <SkillsView />}
133+
134+
{view.type === "mcp-servers" && <McpServersView />}
132135
</Box>
133136
</Flex>
134137

apps/code/src/renderer/features/settings/components/sections/McpServersSettings.tsx renamed to apps/code/src/renderer/features/mcp-servers/components/McpServersView.tsx

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import { useMcpServers } from "@features/settings/hooks/useMcpServers";
1+
import { useMcpServers } from "@features/mcp-servers/hooks/useMcpServers";
2+
import { useSetHeaderContent } from "@hooks/useSetHeaderContent";
3+
import { Plugs } from "@phosphor-icons/react";
24
import {
35
AlertDialog,
46
Box,
@@ -14,18 +16,18 @@ import type {
1416
} from "@renderer/api/posthogClient";
1517
import { useQueryClient } from "@tanstack/react-query";
1618
import { useCallback, useEffect, useMemo, useState } from "react";
17-
import { AddCustomServerForm } from "./mcp/AddCustomServerForm";
18-
import { MarketplaceView } from "./mcp/MarketplaceView";
19-
import { McpInstalledRail } from "./mcp/McpInstalledRail";
20-
import { ServerDetailView } from "./mcp/ServerDetailView";
19+
import { AddCustomServerForm } from "./parts/AddCustomServerForm";
20+
import { MarketplaceView } from "./parts/MarketplaceView";
21+
import { McpInstalledRail } from "./parts/McpInstalledRail";
22+
import { ServerDetailView } from "./parts/ServerDetailView";
2123

2224
type SceneView =
2325
| { kind: "marketplace" }
2426
| { kind: "detail-installation"; installationId: string }
2527
| { kind: "detail-template"; templateId: string }
2628
| { kind: "add-custom" };
2729

28-
export function McpServersSettings() {
30+
export function McpServersView() {
2931
const queryClient = useQueryClient();
3032
const [view, setView] = useState<SceneView>({ kind: "marketplace" });
3133
const [query, setQuery] = useState("");
@@ -43,6 +45,22 @@ export function McpServersSettings() {
4345
null,
4446
);
4547

48+
const headerContent = useMemo(
49+
() => (
50+
<Flex align="center" gap="2" className="w-full min-w-0">
51+
<Plugs size={12} className="shrink-0 text-gray-10" />
52+
<Text
53+
className="truncate whitespace-nowrap font-medium text-[13px]"
54+
title="MCP servers"
55+
>
56+
MCP servers
57+
</Text>
58+
</Flex>
59+
),
60+
[],
61+
);
62+
useSetHeaderContent(headerContent);
63+
4664
const {
4765
installations,
4866
installationsLoading,
@@ -254,7 +272,7 @@ export function McpServersSettings() {
254272
})();
255273

256274
return (
257-
<Flex className="min-h-0 w-full flex-1 overflow-hidden">
275+
<Flex height="100%" className="min-h-0 overflow-hidden">
258276
<McpInstalledRail
259277
installations={installationList}
260278
templates={serverList}
@@ -266,12 +284,7 @@ export function McpServersSettings() {
266284
/>
267285
<Box className="min-h-0 min-w-0 flex-1">
268286
<ScrollArea className="h-full w-full">
269-
<Box
270-
p="6"
271-
mx="auto"
272-
style={{ zIndex: 1 }}
273-
className="relative max-w-[960px]"
274-
>
287+
<Box p="6" mx="auto" className="relative z-[1] max-w-[960px]">
275288
{mainContent}
276289
</Box>
277290
</ScrollArea>

apps/code/src/renderer/features/settings/components/sections/mcp/AddCustomServerForm.tsx renamed to apps/code/src/renderer/features/mcp-servers/components/parts/AddCustomServerForm.tsx

File renamed without changes.

apps/code/src/renderer/features/settings/components/sections/mcp/MarketplaceView.tsx renamed to apps/code/src/renderer/features/mcp-servers/components/parts/MarketplaceView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
filterServersByCategory,
33
filterServersByQuery,
4-
} from "@features/settings/hooks/mcpFilters";
4+
} from "@features/mcp-servers/hooks/mcpFilters";
55
import { MagnifyingGlass, Plus, X } from "@phosphor-icons/react";
66
import {
77
Button,

apps/code/src/renderer/features/settings/components/sections/mcp/McpInstalledRail.tsx renamed to apps/code/src/renderer/features/mcp-servers/components/parts/McpInstalledRail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { filterInstallationsByQuery } from "@features/settings/hooks/mcpFilters";
1+
import { filterInstallationsByQuery } from "@features/mcp-servers/hooks/mcpFilters";
22
import { MagnifyingGlass, Plus, X } from "@phosphor-icons/react";
33
import {
44
Flex,

apps/code/src/renderer/features/settings/components/sections/mcp/ServerCard.tsx renamed to apps/code/src/renderer/features/mcp-servers/components/parts/ServerCard.tsx

File renamed without changes.

apps/code/src/renderer/features/settings/components/sections/mcp/ServerDetailView.tsx renamed to apps/code/src/renderer/features/mcp-servers/components/parts/ServerDetailView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useMcpInstallationTools } from "@features/settings/hooks/useMcpInstallationTools";
1+
import { useMcpInstallationTools } from "@features/mcp-servers/hooks/useMcpInstallationTools";
22
import {
33
ArrowClockwise,
44
ArrowLeft,

apps/code/src/renderer/features/settings/components/sections/mcp/ToolPolicyToggle.tsx renamed to apps/code/src/renderer/features/mcp-servers/components/parts/ToolPolicyToggle.tsx

File renamed without changes.

apps/code/src/renderer/features/settings/components/sections/mcp/ToolRow.tsx renamed to apps/code/src/renderer/features/mcp-servers/components/parts/ToolRow.tsx

File renamed without changes.

apps/code/src/renderer/features/settings/components/sections/mcp/icons.tsx renamed to apps/code/src/renderer/features/mcp-servers/components/parts/icons.tsx

File renamed without changes.

0 commit comments

Comments
 (0)