From 4edffeb84b5d691884dc3c274dfd8aa4e9441295 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Tue, 14 Jul 2026 21:00:27 +0200 Subject: [PATCH] fix(mcp): align script auto_kind filter with scripts list API (#10098) The MCP `get_items` script filter used `auto_kind IS NULL`, which excluded every script with a non-null `auto_kind` (pipeline, test, WAC, ...). These are valid runnable scripts and should surface as MCP tools. Switch to the deny-list `(auto_kind IS NULL OR auto_kind <> 'lib')`, matching the scripts list API (windmill-api-scripts). Only library scripts (no main function) are excluded; pipeline/test/WAC and any future auto_kind values are included. Fixes WIN-2190 Co-authored-by: Claude Opus 4.8 (1M context) --- backend/windmill-api/src/mcp/utils.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/windmill-api/src/mcp/utils.rs b/backend/windmill-api/src/mcp/utils.rs index ba4ea391d5..de0ad9d4da 100644 --- a/backend/windmill-api/src/mcp/utils.rs +++ b/backend/windmill-api/src/mcp/utils.rs @@ -149,7 +149,10 @@ pub async fn get_items sqlx::FromRow<'a, sqlx::postgres::PgRow> + Sen .and_where("o.archived = false"); if item_type == "script" { - sqlb.and_where("o.auto_kind IS NULL"); + // only exclude library scripts (no main function); pipeline, test, WAC, + // and any future `auto_kind` values remain callable. Mirrors the scripts + // list API deny-list. + sqlb.and_where("(o.auto_kind IS NULL OR o.auto_kind <> 'lib')"); } if let Some(prefix) = path_prefix {