diff --git a/web/frontend/src/components/config/config-page.tsx b/web/frontend/src/components/config/config-page.tsx index e5c1f736c..469ec34d8 100644 --- a/web/frontend/src/components/config/config-page.tsx +++ b/web/frontend/src/components/config/config-page.tsx @@ -338,6 +338,20 @@ export function ConfigPage() { throw new Error(`MCP server ${server.name} requires a URL.`) } + try { + const parsedURL = new URL(server.url) + if ( + parsedURL.protocol !== "http:" && + parsedURL.protocol !== "https:" + ) { + throw new Error("invalid protocol") + } + } catch { + throw new Error( + `MCP server ${server.name} requires a valid HTTP(S) URL.`, + ) + } + return [ server.name, { diff --git a/web/frontend/src/components/config/config-sections.tsx b/web/frontend/src/components/config/config-sections.tsx index 2d3237105..022eb8fdc 100644 --- a/web/frontend/src/components/config/config-sections.tsx +++ b/web/frontend/src/components/config/config-sections.tsx @@ -399,6 +399,42 @@ export function MCPSection({ onServerFieldChange(server.id, "enabled", checked) } /> + + {server.type !== "stdio" ? ( @@ -442,6 +478,19 @@ export function MCPSection({ ) } /> + + onServerFieldChange( + server.id, + "envFile", + e.target.value, + ) + } + />