diff --git a/backend/windmill-api/src/mcp/core.rs b/backend/windmill-api/src/mcp/core.rs index 2edf08df3a..44f35af475 100644 --- a/backend/windmill-api/src/mcp/core.rs +++ b/backend/windmill-api/src/mcp/core.rs @@ -1029,6 +1029,8 @@ struct ToolsetQuery { struct ToolsetEntry { name: String, description: String, + /// The JSON Schema of its arguments. + parameters: serde_json::Value, } /// The tools `/api/mcp` offers an `mcp:all` token at each access level, for the token @@ -1047,6 +1049,7 @@ async fn list_toolset_handler( .map(|tool| ToolsetEntry { name: tool.name.to_string(), description: tool.description.map(|d| d.to_string()).unwrap_or_default(), + parameters: serde_json::Value::Object((*tool.input_schema).clone()), }) .collect(), )) diff --git a/frontend/src/lib/components/mcp/McpAccessPicker.svelte b/frontend/src/lib/components/mcp/McpAccessPicker.svelte index e748b1051e..6e3843ebc3 100644 --- a/frontend/src/lib/components/mcp/McpAccessPicker.svelte +++ b/frontend/src/lib/components/mcp/McpAccessPicker.svelte @@ -40,6 +40,7 @@ import ToggleButtonGroup from '$lib/components/common/toggleButton-v2/ToggleButtonGroup.svelte' import ToggleButton from '$lib/components/common/toggleButton-v2/ToggleButton.svelte' import McpScopeSelector from './McpScopeSelector.svelte' + import Select from '$lib/components/select/Select.svelte' import McpToolList from './McpToolList.svelte' import { toolset } from './toolsets.svelte' import Section from '$lib/components/Section.svelte' @@ -63,6 +64,8 @@ fullLabel?: string /** Rendered between the access choice and the tool list. */ afterAccess?: Snippet + /** A select, with the chosen level's meaning under it, for a narrow dialog. */ + asSelect?: boolean } let { @@ -72,9 +75,17 @@ access = $bindable(), initialScopes = [], fullLabel = 'Build and run', - afterAccess + afterAccess, + asSelect = false }: Props = $props() + const LEVELS = $derived([ + { value: 'full', label: fullLabel }, + { value: 'read_run', label: 'Read and run' }, + { value: 'read', label: 'Read only' }, + { value: 'selected', label: 'Scripts and flows as tools' } + ]) + const initialAccess = mcpAccessOf(initialScopes) access = initialAccess const initialSelection = @@ -116,24 +127,31 @@
- The client can run these scripts and flows and nothing else: it cannot explore the workspace, - read runs, build, or run anything outside the selection. -
+ {#if !asSelect} ++ The client can run these scripts and flows and nothing else: it cannot explore the + workspace, read runs, build, or run anything outside the selection. +
+ {/if} {#key workspaceId}Loading tools…
+ {/if} +