BloopAI/vibe-kanban · error

Unknown preconfigured server '${serverKey}'

Error message

Unknown preconfigured server '${serverKey}'

What it means

addPreconfiguredToConfig looks up serverKey in mcp_config.preconfigured (the catalog of built-in server templates for this strategy). If preconfigured is not an object or does not contain serverKey, it throws this error. It protects against adding a preconfigured server that the current MCP strategy does not offer.

Source

Thrown at packages/web-core/src/shared/lib/mcpStrategies.ts:83

        throw new Error(
          `Missing required field at path: ${mcp_config.servers_path.join('.')}`
        );
      }
    }
    if (!isJsonObject(current)) {
      throw new Error('Servers configuration must be an object');
    }
    return current;
  }

  static addPreconfiguredToConfig(
    mcp_config: McpConfig,
    existingConfig: JsonValue,
    serverKey: string
  ): JsonObject {
    const preconfVal = mcp_config.preconfigured;
    if (!isJsonObject(preconfVal) || !(serverKey in preconfVal)) {
      throw new Error(`Unknown preconfigured server '${serverKey}'`);
    }

    const updatedVal: JsonValue = JSON.parse(
      JSON.stringify(existingConfig ?? {})
    );
    const updated: JsonObject = isJsonObject(updatedVal) ? updatedVal : {};
    let current: JsonObject = updated;

    for (let i = 0; i < mcp_config.servers_path.length - 1; i++) {
      const key = mcp_config.servers_path[i];
      const next = isJsonObject(current[key])
        ? (current[key] as JsonObject)
        : undefined;
      if (!next) current[key] = {};
      current = current[key] as JsonObject;
    }

    if (mcp_config.servers_path.length === 0) {

View on GitHub (pinned to 4deb7eca8f)

Solutions

  1. Re-fetch/rebuild the McpConfig so the UI's preconfigured list matches the current strategy.
  2. Check the exact key spelling against mcp_config.preconfigured before calling addPreconfiguredToConfig.
  3. If the server isn't offered preconfigured, add it as a custom server entry via the servers object instead.
  4. Update the strategy's preconfigured catalog if the server should legitimately exist.

Example fix

// before
strategy.addPreconfiguredToConfig(cfg, existing, 'postgres'); // not in catalog -> throws
// after
const keys = isJsonObject(cfg.preconfigured) ? Object.keys(cfg.preconfigured) : [];
if (keys.includes('postgres')) {
  strategy.addPreconfiguredToConfig(cfg, existing, 'postgres');
} else {
  servers.postgres = { /* custom entry */ };
}
Defensive patterns

Strategy: validation

Validate before calling

function preconfiguredExists(cfg, key) {
  return typeof cfg.preconfigured === 'object' && cfg.preconfigured !== null && !Array.isArray(cfg.preconfigured) && key in cfg.preconfigured;
}
if (!preconfiguredExists(cfg, serverKey)) console.warn(`Server '${serverKey}' not offered by this strategy`);

Type guard

function hasPreconfigured(cfg: McpConfig, key: string): boolean {
  const p: unknown = cfg.preconfigured;
  return typeof p === 'object' && p !== null && !Array.isArray(p) && key in p;
}

Try / catch

try {
  McpConfigStrategyGeneral.addPreconfiguredToConfig(cfg, existing, serverKey);
} catch (e) {
  if (e instanceof Error && e.message.startsWith('Unknown preconfigured server')) {
    console.warn(e.message, 'Available:', Object.keys(cfg.preconfigured ?? {}));
  } else throw e;
}

Prevention

When it happens

Trigger: Adding a preconfigured server whose key is not in the strategy's catalog — stale UI list after the McpConfig changed, a typo'd serverKey, or a catalog from a different strategy/client.

Common situations: UI cached an older preconfigured list after an app update; user selected a server available in one MCP client but not the configured one; serverKey built from an untrusted/unsanitized source.

Related errors


AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29). Data as JSON: /api/errors/39f4909ee12a1051. Report an issue: GitHub.