Skip to content

Context7 Platform -- Up-to-date docs for AI agents

fix(cli): --api-key alone no longer forces MCP mode in setup (#2713)

Fahreddin Özcan268f52f813b0
diff --git a/.changeset/cli-api-key-mode-prompt.md b/.changeset/cli-api-key-mode-prompt.md
new file mode 100644
index 00000000..f72ee85a
--- /dev/null
+++ b/.changeset/cli-api-key-mode-prompt.md
@@ -0,0 +1,5 @@
+---
+"ctx7": patch
+---
+
+`ctx7 setup --api-key <KEY>` (without `--cli`, `--mcp`, or `-y`) now prompts to choose between MCP server and CLI + Skills modes. Previously, passing `--api-key` short-circuited to MCP, locking users out of the CLI + Skills option even though that mode also accepts an API key. Explicit `--mcp` / `--cli` / `--stdio` / `--oauth` / `-y` still skip the prompt as before.
diff --git a/packages/cli/src/commands/setup.ts b/packages/cli/src/commands/setup.ts
index a2c27078..4039a460 100644
--- a/packages/cli/src/commands/setup.ts
+++ b/packages/cli/src/commands/setup.ts
@@ -144,7 +144,7 @@ async function resolveAuth(options: SetupOptions): Promise<AuthOptions | null> {
async function resolveMode(options: SetupOptions): Promise<SetupMode> {
if (options.cli) return "cli";
- if (options.mcp || options.yes || options.oauth || options.apiKey || options.stdio) return "mcp";
+ if (options.mcp || options.yes || options.oauth || options.stdio) return "mcp";
return select<SetupMode>({
message: "How should your agent access Context7?",