From d12490477f9db19fc4aabbd12b2d0e149061f54f Mon Sep 17 00:00:00 2001 From: Greg Methvin Date: Tue, 18 Nov 2025 15:25:58 -0800 Subject: [PATCH] Improve manual config instructions --- src/install.ts | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/install.ts b/src/install.ts index 7aa23a3..6fc6b88 100644 --- a/src/install.ts +++ b/src/install.ts @@ -156,6 +156,22 @@ export function pickPersistablePermissionEnv(env: Record): { }; } +/** + * Remove permission flags from env (they're loaded from key manager) + * Returns only non-persisted env vars like debug flags + */ +export function omitPersistablePermissionEnv( + env: Record +): Record { + const { + ITERABLE_USER_PII: _pii, + ITERABLE_ENABLE_WRITES: _writes, + ITERABLE_ENABLE_SENDS: _sends, + ...rest + } = env; + return rest; +} + /** * Enforce that Sends require Writes. If Sends is enabled but Writes is disabled, * disable Sends and optionally emit a warning. @@ -833,7 +849,7 @@ export const setupMcpServer = async (): Promise => { const iterableMcpConfig = buildMcpConfig({ ...(args.includes("--local") && { isLocal: true }), - env: mcpEnv, + env: omitPersistablePermissionEnv(mcpEnv), autoUpdate: useAutoUpdate, }); @@ -970,12 +986,21 @@ export const setupMcpServer = async (): Promise => { showSection("Manual Configuration", icons.rocket); console.log(); + const { type, command, args, env } = iterableMcpConfig; + showInfo("Your API key has been stored."); showInfo("Add the MCP server to your AI tool with these settings:"); console.log(); - console.log(chalk.white.bold(" Type:") + " stdio"); - console.log(chalk.white.bold(" Command:") + " npx"); - console.log(chalk.white.bold(" Args:") + " -y @iterable/mcp"); + console.log(chalk.white.bold(" Type:") + ` ${type}`); + console.log(chalk.white.bold(" Command:") + ` ${command}`); + console.log(chalk.white.bold(" Args:") + ` ${args.join(" ")}`); + const envEntries = Object.entries(env); + if (envEntries.length > 0) { + console.log(chalk.white.bold(" Env:")); + envEntries.forEach(([k, v]) => { + console.log(chalk.gray(` ${k}=${v}`)); + }); + } console.log(); showInfo(