feat(webui): Tools & MCP settings page
MCP servers as editable rows per transport (stdio command and arguments, HTTP URL, SSE endpoints) with parallel tool calls; MiniMax with its key as a secret reference; web fetch with byte, duration and a danger-toned private-networks toggle, its fields disabled while it is off; tool output limits with a token estimate. Fixes sticky positioning across the app: the frame and main used overflow hidden, which made each a scroll container that never scrolls, so the Settings save bar and sidebar never stuck. Both now clip instead.
This commit is contained in:
13 files changed
+341
-18
No files matched your search
+2
-2
@@ -65,10 +65,10 @@ onMounted(() => {
|
||||
so the chat launcher has to render outside this element.
|
||||
-->
|
||||
<div
|
||||
class="flex min-h-[calc(100vh-2rem)] flex-col overflow-hidden rounded-xl border border-[var(--hairline)] bg-[var(--workspace)] shadow-[var(--shadow-workspace)] backdrop-blur-[28px] backdrop-saturate-[1.2] max-lg:min-h-screen max-lg:rounded-none max-lg:border-0 max-lg:shadow-none"
|
||||
class="flex min-h-[calc(100vh-2rem)] flex-col overflow-clip rounded-xl border border-[var(--hairline)] bg-[var(--workspace)] shadow-[var(--shadow-workspace)] backdrop-blur-[28px] backdrop-saturate-[1.2] max-lg:min-h-screen max-lg:rounded-none max-lg:border-0 max-lg:shadow-none"
|
||||
>
|
||||
<Topbar :hidden="hidden" />
|
||||
<main class="w-full flex-1 overflow-x-hidden p-8 max-lg:p-4">
|
||||
<main class="w-full flex-1 overflow-x-clip p-8 max-lg:p-4">
|
||||
<Alert v-if="authenticationRequired" variant="destructive" class="mb-4">
|
||||
<AlertTitle>Dashboard authentication required</AlertTitle>
|
||||
<AlertDescription>
|
||||
|
||||
@@ -41,6 +41,7 @@ const settings: NavSpec = {
|
||||
"/settings/channels",
|
||||
"/settings/repositories",
|
||||
"/settings/identities",
|
||||
"/settings/tools",
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ import DashboardPage from "@/dashboard/DashboardPage.vue";
|
||||
import EventsPage from "@/events/EventsPage.vue";
|
||||
import LogsPage from "@/logs/LogsPage.vue";
|
||||
import SchedulingPolicyPage from "@/settings/SchedulingPolicyPage.vue";
|
||||
import ToolsPage from "@/settings/ToolsPage.vue";
|
||||
import SystemAdvancedPage from "@/settings/SystemAdvancedPage.vue";
|
||||
import SystemIdentitiesPage from "@/settings/SystemIdentitiesPage.vue";
|
||||
import SystemAppearancePage from "@/settings/SystemAppearancePage.vue";
|
||||
@@ -204,6 +205,18 @@ const routes = [
|
||||
section: "settings",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/settings/tools",
|
||||
name: "settings-tools",
|
||||
component: ToolsPage,
|
||||
meta: {
|
||||
navPath: "/settings",
|
||||
settings: true,
|
||||
label: "Tools & MCP",
|
||||
description: "The tools agents can call, and the MCP servers that add more.",
|
||||
section: "settings",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/settings/advanced",
|
||||
name: "system-advanced",
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, useId } from "vue";
|
||||
import { Trash2 } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { SegmentedControl } from "@/components/ui/segmented-control";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import {
|
||||
TagsInput,
|
||||
TagsInputInput,
|
||||
TagsInputItem,
|
||||
TagsInputItemDelete,
|
||||
TagsInputItemText,
|
||||
} from "@/components/ui/tags-input";
|
||||
|
||||
export interface McpServer {
|
||||
name: string;
|
||||
transport: string;
|
||||
command?: string;
|
||||
args?: string[];
|
||||
work_dir?: string;
|
||||
url?: string;
|
||||
sse_endpoint?: string;
|
||||
message_endpoint?: string;
|
||||
parallel_tool_calls: boolean;
|
||||
headers_configured: boolean;
|
||||
}
|
||||
|
||||
const server = defineModel<McpServer>({ required: true });
|
||||
defineEmits<{ remove: [] }>();
|
||||
const id = useId();
|
||||
|
||||
// "" and "stdio" are the same transport to the daemon; "streamablehttp" is
|
||||
// the long spelling of "http".
|
||||
const transport = computed({
|
||||
get: () =>
|
||||
server.value.transport === "" ? "stdio" : server.value.transport === "streamablehttp" ? "http" : server.value.transport,
|
||||
set: (value: string) => (server.value.transport = value),
|
||||
});
|
||||
const transports = [
|
||||
{ value: "stdio", label: "stdio" },
|
||||
{ value: "http", label: "HTTP" },
|
||||
{ value: "sse", label: "SSE" },
|
||||
];
|
||||
const args = computed({
|
||||
get: () => server.value.args ?? [],
|
||||
set: (value: string[]) => (server.value.args = value),
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="grid gap-4 rounded-lg border border-border bg-card p-4">
|
||||
<div class="flex items-center gap-3">
|
||||
<Input
|
||||
:id="`${id}-name`"
|
||||
v-model="server.name"
|
||||
aria-label="Server name"
|
||||
placeholder="name"
|
||||
class="max-w-56 font-mono"
|
||||
/>
|
||||
<SegmentedControl v-model="transport" label="Transport" :options="transports" />
|
||||
<Button variant="ghost" size="icon" class="ml-auto" aria-label="Remove server" @click="$emit('remove')">
|
||||
<Trash2 />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<template v-if="transport === 'stdio'">
|
||||
<label class="grid gap-1 text-xs text-fg-subtle">
|
||||
Command
|
||||
<Input v-model="server.command" class="font-mono" placeholder="npx" />
|
||||
</label>
|
||||
<div class="grid gap-1 text-xs text-fg-subtle">
|
||||
<span :id="`${id}-args`">Arguments</span>
|
||||
<TagsInput v-model="args" :aria-labelledby="`${id}-args`" class="font-mono">
|
||||
<TagsInputItem v-for="arg in args" :key="arg" :value="arg">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="Add argument" />
|
||||
</TagsInput>
|
||||
</div>
|
||||
<label class="grid gap-1 text-xs text-fg-subtle">
|
||||
Working directory
|
||||
<Input v-model="server.work_dir" class="font-mono" placeholder="the daemon's working directory" />
|
||||
</label>
|
||||
</template>
|
||||
<label v-else-if="transport === 'http'" class="grid gap-1 text-xs text-fg-subtle">
|
||||
URL
|
||||
<Input v-model="server.url" class="font-mono" placeholder="https://host/mcp" />
|
||||
</label>
|
||||
<template v-else>
|
||||
<label class="grid gap-1 text-xs text-fg-subtle">
|
||||
SSE endpoint
|
||||
<Input v-model="server.sse_endpoint" class="font-mono" />
|
||||
</label>
|
||||
<label class="grid gap-1 text-xs text-fg-subtle">
|
||||
Message endpoint
|
||||
<Input v-model="server.message_endpoint" class="font-mono" />
|
||||
</label>
|
||||
</template>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-x-6 gap-y-2 text-sm">
|
||||
<label class="flex items-center gap-2">
|
||||
<Switch v-model="server.parallel_tool_calls" />
|
||||
Parallel tool calls
|
||||
</label>
|
||||
<span v-if="server.headers_configured" class="text-xs text-fg-subtle">
|
||||
Request headers come from config.toml, matched by this name
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,40 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { SecretReference } from "@/components/ui/secret-reference";
|
||||
|
||||
/** Where a secret lives. Archie resolves it; the value never reaches the UI. */
|
||||
interface SecretRef {
|
||||
engine: string;
|
||||
key: string;
|
||||
}
|
||||
|
||||
defineProps<{ resolved?: boolean; disabled?: boolean; idPrefix: string }>();
|
||||
const model = defineModel<SecretRef>({ required: true });
|
||||
const editing = ref(false);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="!editing">
|
||||
<SecretReference
|
||||
:engine="model.engine || 'unset'"
|
||||
:secret-key="model.key || 'unset'"
|
||||
:resolved="resolved"
|
||||
:disabled="disabled"
|
||||
@change="editing = true"
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="flex flex-wrap items-end gap-2">
|
||||
<label class="grid gap-1 text-xs text-fg-subtle">
|
||||
Engine
|
||||
<Input :id="`${idPrefix}-engine`" v-model="model.engine" class="w-28 font-mono" />
|
||||
</label>
|
||||
<label class="grid min-w-48 flex-1 gap-1 text-xs text-fg-subtle">
|
||||
Key
|
||||
<Input :id="`${idPrefix}-key`" v-model="model.key" class="font-mono" />
|
||||
</label>
|
||||
<Button variant="ghost" size="sm" @click="editing = false">Done</Button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -56,7 +56,7 @@ async function save() {
|
||||
<template>
|
||||
<div
|
||||
v-if="count > 0"
|
||||
class="sticky bottom-0 z-30 mt-6 flex items-center gap-3 rounded-lg border border-border bg-popover px-4 py-3 shadow-[var(--shadow-md)]"
|
||||
class="sticky bottom-4 z-30 mt-6 flex items-center gap-3 rounded-lg border border-border bg-popover px-4 py-3 shadow-[var(--shadow-md)]"
|
||||
role="region"
|
||||
aria-label="Unsaved changes"
|
||||
>
|
||||
|
||||
@@ -36,7 +36,7 @@ onBeforeUnmount(() => {
|
||||
aria-label="Settings"
|
||||
class="w-60 shrink-0 max-lg:-mx-4 max-lg:w-auto max-lg:scroll-fade-x max-lg:overflow-x-auto max-lg:[scrollbar-width:none] max-lg:border-b max-lg:px-4"
|
||||
>
|
||||
<ul class="flex flex-col gap-0.5 lg:sticky lg:top-6 max-lg:flex-row max-lg:gap-1">
|
||||
<ul class="flex flex-col gap-0.5 lg:sticky lg:top-20 max-lg:flex-row max-lg:gap-1">
|
||||
<li v-for="(item, index) in items" :key="item.path" class="contents">
|
||||
<p
|
||||
v-if="item.dividerBefore"
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { Plus } from "@lucide/vue";
|
||||
|
||||
import AuditTable from "@/base/AuditTable.vue";
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ByteSizeInput } from "@/components/ui/byte-size-input";
|
||||
import { DurationInput } from "@/components/ui/duration-input";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
InputGroup,
|
||||
InputGroupAddon,
|
||||
InputGroupInput,
|
||||
InputGroupText,
|
||||
} from "@/components/ui/input-group";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { StatusPill } from "@/components/ui/status-pill";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
|
||||
import McpServerEditor, { type McpServer } from "./McpServerEditor.vue";
|
||||
import SecretRefField from "./SecretRefField.vue";
|
||||
|
||||
const KIND = "tool-settings";
|
||||
|
||||
interface ToolSettings {
|
||||
mcp_servers: McpServer[];
|
||||
minimax: { enabled: boolean; api_key_ref: { engine: string; key: string }; credential_configured?: boolean };
|
||||
policy: { max_result_chars: number; spill_dir: string };
|
||||
web_fetch: { enabled: boolean | null; timeout: string; max_bytes: number; allow_private_networks: boolean };
|
||||
}
|
||||
|
||||
const store = useControlPlaneStore();
|
||||
const { catalog, catalogError } = storeToRefs(store);
|
||||
onMounted(store.load);
|
||||
|
||||
const resources = computed(() => resourcesForPage(catalog.value, "tools"));
|
||||
const tools = computed(() => store.drafts[KIND]?.value as ToolSettings | undefined);
|
||||
const error = computed(() => store.stateFor(KIND).error);
|
||||
|
||||
// An unset web_fetch.enabled means on.
|
||||
const webFetchOn = computed({
|
||||
get: () => tools.value?.web_fetch.enabled !== false,
|
||||
set: (on: boolean) => {
|
||||
if (tools.value) tools.value.web_fetch.enabled = on;
|
||||
},
|
||||
});
|
||||
|
||||
function addServer(transport: string) {
|
||||
tools.value?.mcp_servers.push({
|
||||
name: "",
|
||||
transport,
|
||||
parallel_tool_calls: false,
|
||||
headers_configured: false,
|
||||
});
|
||||
}
|
||||
|
||||
const eyebrow = "mb-1 text-[11px] font-medium tracking-[0.06em] text-fg-subtle uppercase";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Tools & MCP">
|
||||
<StatusPill tone="warn">Applies after restart</StatusPill>
|
||||
</PageHeader>
|
||||
<p class="-mt-4 mb-8 text-sm text-fg-muted">
|
||||
The tools agents can call, and the MCP servers that add more.
|
||||
</p>
|
||||
|
||||
<p v-if="catalogError || error" class="mb-4 text-sm text-danger" role="alert">
|
||||
{{ catalogError || error }}
|
||||
</p>
|
||||
|
||||
<template v-if="tools">
|
||||
<h2 :class="eyebrow">MCP servers</h2>
|
||||
<div class="grid gap-3 border-t border-border pt-4">
|
||||
<McpServerEditor
|
||||
v-for="(_, i) in tools.mcp_servers"
|
||||
:key="i"
|
||||
v-model="tools.mcp_servers[i]!"
|
||||
@remove="tools.mcp_servers.splice(i, 1)"
|
||||
/>
|
||||
<p v-if="!tools.mcp_servers.length" class="text-sm text-fg-muted">
|
||||
No MCP servers. Add one by the way it is reached.
|
||||
</p>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<Button variant="outline" size="sm" @click="addServer('stdio')">
|
||||
<Plus data-icon="inline-start" /> stdio command
|
||||
</Button>
|
||||
<Button variant="outline" size="sm" @click="addServer('http')">
|
||||
<Plus data-icon="inline-start" /> HTTP endpoint
|
||||
</Button>
|
||||
<Button variant="outline" size="sm" @click="addServer('sse')">
|
||||
<Plus data-icon="inline-start" /> SSE endpoint
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 :class="[eyebrow, 'mt-10']">MiniMax</h2>
|
||||
<SettingRow label="Enabled" hint="Offers the MiniMax tools to agents.">
|
||||
<Switch v-model="tools.minimax.enabled" aria-label="MiniMax enabled" />
|
||||
</SettingRow>
|
||||
<SettingRow label="API key" hint="Where Archie reads the key from.">
|
||||
<SecretRefField
|
||||
v-model="tools.minimax.api_key_ref"
|
||||
id-prefix="minimax-key"
|
||||
:resolved="tools.minimax.credential_configured"
|
||||
:disabled="!tools.minimax.enabled"
|
||||
/>
|
||||
</SettingRow>
|
||||
|
||||
<h2 :class="[eyebrow, 'mt-10']">Web fetch</h2>
|
||||
<SettingRow label="Enabled" hint="Lets agents fetch a URL.">
|
||||
<Switch v-model="webFetchOn" aria-label="Web fetch enabled" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Max download" for="wf-bytes" hint="How much of a response body is read.">
|
||||
<ByteSizeInput id="wf-bytes" v-model="tools.web_fetch.max_bytes" :disabled="!webFetchOn" />
|
||||
</SettingRow>
|
||||
<SettingRow label="Timeout" for="wf-timeout" hint="One fetch, redirects included.">
|
||||
<DurationInput id="wf-timeout" v-model="tools.web_fetch.timeout" :units="['s', 'm']" :disabled="!webFetchOn" />
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
label="Allow private networks"
|
||||
hint="On: agents can fetch loopback and LAN addresses, including this daemon's own dashboard and the Docker API."
|
||||
:tone="tools.web_fetch.allow_private_networks ? 'danger' : 'default'"
|
||||
>
|
||||
<Switch
|
||||
v-model="tools.web_fetch.allow_private_networks"
|
||||
aria-label="Allow private networks"
|
||||
:disabled="!webFetchOn"
|
||||
/>
|
||||
</SettingRow>
|
||||
|
||||
<h2 :class="[eyebrow, 'mt-10']">Tool output</h2>
|
||||
<SettingRow label="Max result length" for="tp-chars" :hint="`About ${Math.round(tools.policy.max_result_chars / 4).toLocaleString()} tokens per tool call.`">
|
||||
<InputGroup class="w-48">
|
||||
<InputGroupInput id="tp-chars" v-model.number="tools.policy.max_result_chars" type="number" min="0" class="font-mono" />
|
||||
<InputGroupAddon align="inline-end">
|
||||
<InputGroupText class="font-mono text-xs">chars</InputGroupText>
|
||||
</InputGroupAddon>
|
||||
</InputGroup>
|
||||
</SettingRow>
|
||||
<SettingRow label="Spill directory" for="tp-spill" hint="Longer results are written here and the agent gets the path. Empty truncates instead.">
|
||||
<Input id="tp-spill" v-model="tools.policy.spill_dir" class="max-w-md font-mono" />
|
||||
</SettingRow>
|
||||
</template>
|
||||
|
||||
<AuditTable class="mt-10" :resources="resources" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -164,6 +164,7 @@ export type ControlPlanePage =
|
||||
| "repositories"
|
||||
| "channels"
|
||||
| "scheduling"
|
||||
| "tools"
|
||||
| "advanced"
|
||||
| "workflows";
|
||||
|
||||
@@ -173,10 +174,10 @@ const PAGE_RESOURCES: Record<ControlPlanePage, string[]> = {
|
||||
repositories: ["repository-policies"],
|
||||
channels: ["channel-settings"],
|
||||
scheduling: ["scheduling-policy"],
|
||||
tools: ["tool-settings"],
|
||||
advanced: [
|
||||
"personas",
|
||||
"schedules",
|
||||
"tool-settings",
|
||||
"plugin-settings",
|
||||
"container-runtime-policies",
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user