From 53b7476da4c1c5d4d352554439be27a7bb6c20b0 Mon Sep 17 00:00:00 2001 From: mzkmnk Date: Mon, 3 Nov 2025 20:33:50 +0900 Subject: [PATCH] fix: make command/url conditionally required based on MCP server type - Use if-then schema to conditionally require fields based on transport type - stdio type requires 'command' field - http type requires 'url' field - Fixes #3346 --- schemas/agent-v1.json | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/schemas/agent-v1.json b/schemas/agent-v1.json index a494a65cd..e94782759 100644 --- a/schemas/agent-v1.json +++ b/schemas/agent-v1.json @@ -146,9 +146,20 @@ "default": false } }, - "required": [ - "command" - ] + "if": { + "properties": { + "type": { + "const": "http" + } + }, + "required": ["type"] + }, + "then": { + "required": ["url"] + }, + "else": { + "required": ["command"] + } }, "default": {} },