Skip to content

Commit 67a2209

Browse files
authored
webui: Add MCP CORS Proxy detection logic & UI (ggml-org#20167)
* refactor: MCP store cleanup * feat: Add MCP proxy availability detection * fix: Sidebar icon * chore: update webui build output * chore: Formatting * chore: update webui build output * chore: Update package lock * chore: update webui build output * chore: update webui build output * chore: update webui build output
1 parent d65c4f2 commit 67a2209

File tree

6 files changed

+58
-189
lines changed

6 files changed

+58
-189
lines changed

tools/server/public/index.html.gz

291 Bytes
Binary file not shown.

tools/server/webui/package-lock.json

Lines changed: 3 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/server/webui/src/lib/components/app/mcp/McpServerForm.svelte

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { parseHeadersToArray, serializeHeaders } from '$lib/utils';
77
import { UrlProtocol } from '$lib/enums';
88
import { MCP_SERVER_URL_PLACEHOLDER } from '$lib/constants';
9+
import { mcpStore } from '$lib/stores/mcp.svelte';
910
1011
interface Props {
1112
url: string;
@@ -62,14 +63,33 @@
6263
{/if}
6364

6465
{#if !isWebSocket && onUseProxyChange}
65-
<label class="mt-3 flex cursor-pointer items-center gap-2">
66+
<label
67+
class="mt-3 flex items-start gap-2"
68+
class:cursor-pointer={mcpStore.isProxyAvailable}
69+
class:opacity-80={!mcpStore.isProxyAvailable}
70+
>
6671
<Switch
72+
class="mt-1"
6773
id="use-proxy-{id}"
6874
checked={useProxy}
75+
disabled={!mcpStore.isProxyAvailable}
6976
onCheckedChange={(checked) => onUseProxyChange?.(checked)}
7077
/>
7178

72-
<span class="text-xs text-muted-foreground">Use llama-server proxy</span>
79+
<span>
80+
<span class="text-xs text-muted-foreground">Use llama-server proxy</span>
81+
82+
<br />
83+
84+
{#if !mcpStore.isProxyAvailable}
85+
<span class="inline-flex gap-0.75 text-xs text-muted-foreground/60"
86+
>(Run <pre>llama-server</pre>
87+
with
88+
<pre>--webui-mcp-proxy</pre>
89+
flag)</span
90+
>
91+
{/if}
92+
</span>
7393
</label>
7494
{/if}
7595
</div>

0 commit comments

Comments
 (0)