different-ai/openwork · warning

extensions.add_mcp_url_required

extensions.add_mcp_url_required

Error message

extensions.add_mcp_url_required

What it means

createLibraryItem requires an instructions value when kind is 'mcp' — for MCP entries the 'instructions' field carries the server URL. If it is empty, the localized message t('extensions.add_mcp_url_required') is thrown.

Source

Thrown at apps/app/src/react-app/domains/settings/state/extensions-store.ts:2250

      options.setError(addOpencodeCacheHint(message));
    } finally {
      options.setBusy(false);
    }
  }

  async function createLibraryItem(
    kind: LibraryAuthorableKind,
    input: CreateLibraryItemInput,
  ): Promise<string> {
    const description = input.description.trim();
    const instructions = input.instructions.trim();
    const drafts = input.components?.filter((component) => component.name.trim() && component.content.trim()) ?? [];
    if (!input.name.trim()) {
      throw new Error(t("extensions.add_name_required"));
    }
    if (kind === "mcp") {
      if (!instructions) {
        throw new Error(t("extensions.add_mcp_url_required"));
      }
    } else if (kind !== "plugin") {
      if (!description) {
        throw new Error(t("extensions.add_description_required"));
      }
      if (!instructions) {
        throw new Error(t("extensions.add_instructions_required"));
      }
    }
    if (kind === "plugin" && drafts.length === 0) {
      throw new Error(t("extensions.add_plugin_component_required"));
    }

    const settings = readDenSettings();
    const token = settings.authToken?.trim() ?? "";
    const orgId = settings.activeOrgId?.trim() ?? "";
    if (!token || !orgId) {
      throw new Error(t("extensions.add_sign_in_required"));

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Provide the MCP server URL in input.instructions before calling.
  2. Validate the URL field in the form (non-empty, ideally parseable as URL) and disable submit until valid.
  3. If kind should not be 'mcp', pass the correct kind so a different validation path applies.

Example fix

// before
await createLibraryItem('mcp', { name: 'my-mcp', instructions: '' });
// after
const url = form.mcpUrl.trim();
if (!url) { showFieldError('mcpUrl', t('extensions.add_mcp_url_required')); return; }
await createLibraryItem('mcp', { name: 'my-mcp', instructions: url });
Defensive patterns

Strategy: validation

Validate before calling

if (kind === 'mcp') {
  const url = input.instructions.trim();
  if (!url) { showFieldError('mcpUrl', t('extensions.add_mcp_url_required')); return; }
  try { new URL(url); } catch { showFieldError('mcpUrl', 'invalid URL'); return; }
}

Try / catch

try {
  await createLibraryItem('mcp', input);
} catch (e) {
  if (e instanceof Error && e.message === t('extensions.add_mcp_url_required')) {
    showFieldError('mcpUrl', e.message);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling createLibraryItem('mcp', input) with input.instructions empty or whitespace-only; the MCP URL field of the add form was left blank.

Common situations: User picks the MCP tab in the add dialog and submits without pasting a server URL; automation builds MCP inputs from config where the url key is missing; pasting only whitespace from a broken clipboard.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/c64cf94dc1ac74a5. Report an issue: GitHub.