From 7efb1b36ea820912e8743c53bb15510d07c8f671 Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Tue, 16 Sep 2025 15:48:01 +0200 Subject: [PATCH 1/4] chore: add missing config properties for verification The idea is to have all the MCP config in the OPTIONS object so that the verification method can look up the config being provided and if its valid or not. --- src/common/config.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/config.ts b/src/common/config.ts index f905c4f4e..1eb4c60c0 100644 --- a/src/common/config.ts +++ b/src/common/config.ts @@ -49,6 +49,9 @@ const OPTIONS = { "tlsDisabledProtocols", "username", "atlasTemporaryDatabaseUserLifetimeMs", + "exportsPath", + "exportTimeoutMs", + "exportCleanupIntervalMs", ], boolean: [ "apiDeprecationErrors", @@ -72,7 +75,7 @@ const OPTIONS = { "tlsFIPSMode", "version", ], - array: ["disabledTools", "loggers"], + array: ["disabledTools", "loggers", "confirmationRequiredTools"], alias: { h: "help", p: "password", @@ -91,12 +94,14 @@ const OPTIONS = { "greedy-arrays": true, "short-option-groups": false, }, + object: ["httpHeaders"], } as Readonly; interface Options { string: string[]; boolean: string[]; array: string[]; + object: string[]; alias: Record; configuration: Record; } @@ -104,6 +109,7 @@ interface Options { export const ALL_CONFIG_KEYS = new Set( (OPTIONS.string as readonly string[]) .concat(OPTIONS.array) + .concat(OPTIONS.object) .concat(OPTIONS.boolean) .concat(Object.keys(OPTIONS.alias)) ); From 0c794f6140f3f1cb037d3dfddc6d2fa26452774b Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Tue, 16 Sep 2025 15:54:58 +0200 Subject: [PATCH 2/4] chore: minor changes to warning text --- src/common/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/config.ts b/src/common/config.ts index 1eb4c60c0..23f78f5f1 100644 --- a/src/common/config.ts +++ b/src/common/config.ts @@ -364,7 +364,7 @@ export function warnAboutDeprecatedOrUnknownCliArgs( if (knownArgs.connectionString) { usedDeprecatedArgument = true; warn( - "The --connectionString argument is deprecated. Prefer using the first positional argument for the connection string or the MDB_MCP_CONNECTION_STRING environment variable." + "The --connectionString argument is deprecated. Prefer using the MDB_MCP_CONNECTION_STRING environment variable or the first positional argument for the connection string." ); } From 2e319e4e3efc8a8bbfadd698c0980c9fea25f29b Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Tue, 16 Sep 2025 15:59:00 +0200 Subject: [PATCH 3/4] chore: fix tests --- tests/unit/common/config.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/common/config.test.ts b/tests/unit/common/config.test.ts index 9e0a739f1..78a0382ef 100644 --- a/tests/unit/common/config.test.ts +++ b/tests/unit/common/config.test.ts @@ -656,7 +656,7 @@ describe("CLI arguments", () => { { cliArg: "connectionString", warning: - "The --connectionString argument is deprecated. Prefer using the first positional argument for the connection string or the MDB_MCP_CONNECTION_STRING environment variable.", + "The --connectionString argument is deprecated. Prefer using the MDB_MCP_CONNECTION_STRING environment variable or the first positional argument for the connection string.", }, ] as TestCase[]; From 95894fab59b9ac366fe1f82590ab629e0e777487 Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Tue, 16 Sep 2025 16:03:18 +0200 Subject: [PATCH 4/4] chore: remove httpHeaders from expected config --- src/common/config.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/common/config.ts b/src/common/config.ts index 23f78f5f1..d335fbb43 100644 --- a/src/common/config.ts +++ b/src/common/config.ts @@ -94,14 +94,12 @@ const OPTIONS = { "greedy-arrays": true, "short-option-groups": false, }, - object: ["httpHeaders"], } as Readonly; interface Options { string: string[]; boolean: string[]; array: string[]; - object: string[]; alias: Record; configuration: Record; } @@ -109,7 +107,6 @@ interface Options { export const ALL_CONFIG_KEYS = new Set( (OPTIONS.string as readonly string[]) .concat(OPTIONS.array) - .concat(OPTIONS.object) .concat(OPTIONS.boolean) .concat(Object.keys(OPTIONS.alias)) );