upstash/context7 · warning

No Context7 setup detected. Pass one of

Error message

No Context7 setup detected. Pass one of: ${ALL_AGENT_NAMES.map((name) => `--${name}`).join(", ")}.

What it means

remove.ts resolveAgents() logs 'No Context7 setup detected...' when detectConfiguredAgents() finds zero installed Context7 integrations for the given scope and no explicit --<agent> flags were provided. It returns an empty array so the remove command exits without deleting anything.

Solutions

  1. Pass an explicit agent flag, e.g. `--cursor`, `--claude`, matching ALL_AGENT_NAMES, to force removal
  2. Check you used the right --scope (project vs global) where the setup actually lives
  3. Verify the agent's config file actually contains a Context7 entry (e.g. mcpServers.context7)
  4. If setup was never run, there is nothing to remove — the warning is expected

Example fix

// before
// $ context7 remove            # nothing detected
// after
// $ context7 remove --cursor   # explicit agent flag
Defensive patterns

Strategy: validation

Validate before calling

const hasCtx7 = (cfg) => Boolean(cfg?.mcpServers?.context7 ?? cfg?.context7);
if (!hasCtx7(readAgentConfig(scope))) {
  console.warn("No Context7 entry found; pass an explicit --<agent> flag or skip remove.");
}

Type guard

function hasContext7Config(cfg) {
  return typeof cfg === "object" && cfg !== null &&
    ("context7" in cfg.mcpServers || "context7" in cfg);
}

Prevention

When it happens

Trigger: Running a remove command with no agent flags (explicit.length === 0) while detectConfiguredAgents(scope) returns an empty list — i.e. no Context7 MCP/rule config files found for any supported agent, and --yes was not used.

Common situations: Trying to uninstall Context7 from a machine where it was never installed (or installed under a different user/scope); wrong --scope (project vs global) so detection misses the config; configs were already removed by a prior run.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


AI-assisted analysis of upstash/context7@4416fb855b (2026-09-16). Data as JSON: /api/errors/97ac1cb2e6f67de4. Report an issue: GitHub.

Appendix: source

Thrown at packages/cli/src/commands/remove.ts:144

        loop: false,
        theme: CHECKBOX_THEME,
      },
      { getName: (mode: UninstallMode) => MODE_LABELS[mode] }
    );
  } catch {
    return null;
  }
}

async function resolveAgents(options: UninstallOptions, scope: Scope): Promise<SetupAgent[]> {
  const explicit = getSelectedAgents(options);
  if (explicit.length > 0) return explicit;

  const detected = await detectConfiguredAgents(scope);
  if (detected.length > 0 && options.yes) return detected;

  if (detected.length === 0) {
    log.warn(
      `No Context7 setup detected. Pass one of: ${ALL_AGENT_NAMES.map((name) => `--${name}`).join(", ")}.`
    );
    return [];
  }

  log.blank();
  const selected = await promptAgents(detected);
  if (!selected) {
    log.warn("Remove cancelled");
    return [];
  }

  return selected;
}

function resolveFlagModes(options: UninstallOptions): UninstallMode[] {
  if (options.all) return ["mcp", "cli"];

View on GitHub (pinned to 4416fb855b)