sipeed/picoclaw · warning
MCP discovery requires at least one search method (BM25 or r
Error message
MCP discovery requires at least one search method (BM25 or regex).
What it means
Validation error thrown in handleSave (web/frontend/src/components/config/config-page.tsx:329) when MCP is enabled, MCP discovery is enabled, but neither BM25 nor regex discovery is selected. Discovery needs at least one search backend to find MCP servers, so the combination is rejected client-side before the config PATCH is built.
Source
Thrown at web/frontend/src/components/config/config-page.tsx:329
if (configDirty) {
const workspace = form.workspace.trim()
const dmScope = form.dmScope.trim()
if (!workspace) {
throw new Error("Workspace path is required.")
}
if (!dmScope) {
throw new Error("Session scope is required.")
}
if (
form.mcpEnabled &&
form.mcpDiscoveryEnabled &&
!form.mcpDiscoveryUseBM25 &&
!form.mcpDiscoveryUseRegex
) {
throw new Error(
"MCP discovery requires at least one search method (BM25 or regex).",
)
}
const maxTokens = parseIntField(form.maxTokens, "Max tokens", {
min: 1,
})
const contextWindow = form.contextWindow.trim()
? parseIntField(form.contextWindow, "Context window", { min: 1 })
: undefined
const maxToolIterations = parseIntField(
form.maxToolIterations,
"Max tool iterations",
{ min: 1 },
)
const toolFeedbackMaxArgsLength = parseIntField(
form.toolFeedbackMaxArgsLength,
"Tool feedback max args length",View on GitHub (pinned to 49183d7e8d)
Solutions
- Re-check at least one of 'BM25' or 'regex' in the MCP discovery options
- If you do not want discovery at all, uncheck 'MCP discovery enabled' instead of unchecking both methods
- If you do not want MCP at all, uncheck 'MCP enabled' and both sub-toggles become irrelevant
Defensive patterns
Strategy: validation
Validate before calling
if (
form.mcpEnabled &&
form.mcpDiscoveryEnabled &&
!form.mcpDiscoveryUseBM25 &&
!form.mcpDiscoveryUseRegex
) {
setFieldError("MCP discovery requires at least one search method (BM25 or regex).")
return
} Try / catch
try {
await handleSave()
} catch (err) {
if (err instanceof Error) setError(err.message)
} Prevention
- Use a checkbox group that prevents unchecking the last selected method
- Auto-uncheck 'discovery enabled' when both methods are off, making the state unreachable
- Show a hint under the discovery section listing which methods are active
When it happens
Trigger: Checking both 'MCP enabled' and 'MCP discovery enabled' while unchecking 'Use BM25' and 'Use regex' in the MCP discovery section, then saving.
Common situations: User disables regex to avoid heavy scanning, then also unchecks BM25 not realizing it was the last method; toggling options after loading a config where both were already off; misreading BM25 as optional telemetry.
Related errors
- ${label} must be a JSON object.
- ${label}.${key} must be a string.
- MCP server names must be unique. Duplicates: ${duplicateName
- MCP server ${server.name} requires a URL.
- MCP server ${server.name} requires a valid HTTP(S) URL.
AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15).
Data as JSON: /api/errors/1095054653bbdb2d.
Report an issue: GitHub.