added mcp ui as tool

This commit is contained in:
dswbx
2025-08-15 10:12:09 +02:00
parent aafd333d12
commit deb8aacca4
19 changed files with 445 additions and 221 deletions

View File

@@ -25,6 +25,7 @@ import { NavLink } from "./AppShell";
import { autoFormatString } from "core/utils";
import { appShellStore } from "ui/store";
import { getVersion } from "core/env";
import { McpIcon } from "ui/routes/tools/mcp/components/mcp-icon";
export function HeaderNavigation() {
const [location, navigate] = useLocation();
@@ -105,9 +106,9 @@ export function HeaderNavigation() {
);
}
function SidebarToggler() {
const toggle = appShellStore((store) => store.toggleSidebar);
const open = appShellStore((store) => store.sidebarOpen);
function SidebarToggler({ name = "default" }: { name?: string }) {
const toggle = appShellStore((store) => store.toggleSidebar(name));
const open = appShellStore((store) => store.sidebars[name]?.open);
return <IconButton id="toggle-sidebar" size="lg" Icon={open ? TbX : TbMenu2} onClick={toggle} />;
}
@@ -132,7 +133,7 @@ export function Header({ hasSidebar = true }) {
<HeaderNavigation />
<div className="flex flex-grow" />
<div className="flex md:hidden flex-row items-center pr-2 gap-2">
<SidebarToggler />
<SidebarToggler name="default" />
<UserMenu />
</div>
<div className="hidden md:flex flex-row items-center px-4 gap-2">
@@ -172,6 +173,14 @@ function UserMenu() {
},
];
if (config.server.mcp.enabled) {
items.push({
label: "MCP",
onClick: () => navigate("/tools/mcp"),
icon: McpIcon,
});
}
if (config.auth.enabled) {
if (!auth.user) {
items.push({ label: "Login", onClick: handleLogin, icon: IconUser });