Skip to content

Commit cfb965b

Browse files
authored
chore: add tests for boolean behavior and rename embeddingsValidation (#759)
1 parent 2d181ca commit cfb965b

File tree

10 files changed

+229
-66
lines changed

10 files changed

+229
-66
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
351351
| `atlasTemporaryDatabaseUserLifetimeMs` | `MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS` | `14400000` | Time in milliseconds that temporary database users created when connecting to MongoDB Atlas clusters will remain active before being automatically deleted. |
352352
| `confirmationRequiredTools` | `MDB_MCP_CONFIRMATION_REQUIRED_TOOLS` | `"atlas-create-access-list,atlas-create-db-user,drop-database,drop-collection,delete-many,drop-index"` | Comma separated values of tool names that require user confirmation before execution. Requires the client to support elicitation. |
353353
| `connectionString` | `MDB_MCP_CONNECTION_STRING` | `<not set>` | MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the connect tool before interacting with MongoDB data. |
354-
| `disableEmbeddingsValidation` | `MDB_MCP_DISABLE_EMBEDDINGS_VALIDATION` | `false` | When set to true, disables validation of embeddings dimensions. |
355354
| `disabledTools` | `MDB_MCP_DISABLED_TOOLS` | `""` | Comma separated values of tool names, operation types, and/or categories of tools that will be disabled. |
355+
| `embeddingsValidation` | `MDB_MCP_EMBEDDINGS_VALIDATION` | `true` | When set to false, disables validation of embeddings dimensions. |
356356
| `exportCleanupIntervalMs` | `MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS` | `120000` | Time in milliseconds between export cleanup cycles that remove expired export files. |
357357
| `exportTimeoutMs` | `MDB_MCP_EXPORT_TIMEOUT_MS` | `300000` | Time in milliseconds after which an export is considered expired and eligible for cleanup. |
358358
| `exportsPath` | `MDB_MCP_EXPORTS_PATH` | see below\* | Folder to store exported data files. |

scripts/generateArguments.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { readFileSync, writeFileSync } from "fs";
1212
import { join, dirname } from "path";
1313
import { fileURLToPath } from "url";
1414
import { UserConfigSchema, configRegistry } from "../src/common/config/userConfig.js";
15-
import assert from "assert";
1615
import { execSync } from "child_process";
1716
import { OPTIONS } from "../src/common/config/argsParserOptions.js";
1817

@@ -69,12 +68,8 @@ function extractZodDescriptions(): Record<string, ConfigMetadata> {
6968
let description = schema.description || `Configuration option: ${key}`;
7069

7170
if ("innerType" in schema.def) {
72-
// "pipe" is used for our comma-separated arrays
71+
// "pipe" is also used for our comma-separated arrays
7372
if (schema.def.innerType.def.type === "pipe") {
74-
assert(
75-
description.startsWith("An array of"),
76-
`Field description for field "${key}" with array type does not start with 'An array of'`
77-
);
7873
description = description.replace("An array of", "Comma separated values of");
7974
}
8075
}

server.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
"isSecret": true
5353
},
5454
{
55-
"name": "MDB_MCP_DISABLE_EMBEDDINGS_VALIDATION",
56-
"description": "When set to true, disables validation of embeddings dimensions.",
55+
"name": "MDB_MCP_DISABLED_TOOLS",
56+
"description": "Comma separated values of tool names, operation types, and/or categories of tools that will be disabled.",
5757
"isRequired": false,
58-
"format": "boolean",
58+
"format": "string",
5959
"isSecret": false
6060
},
6161
{
62-
"name": "MDB_MCP_DISABLED_TOOLS",
63-
"description": "Comma separated values of tool names, operation types, and/or categories of tools that will be disabled.",
62+
"name": "MDB_MCP_EMBEDDINGS_VALIDATION",
63+
"description": "When set to false, disables validation of embeddings dimensions.",
6464
"isRequired": false,
65-
"format": "string",
65+
"format": "boolean",
6666
"isSecret": false
6767
},
6868
{
@@ -216,19 +216,19 @@
216216
"description": "MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the connect tool before interacting with MongoDB data.",
217217
"isRequired": false
218218
},
219-
{
220-
"type": "named",
221-
"name": "--disableEmbeddingsValidation",
222-
"description": "When set to true, disables validation of embeddings dimensions.",
223-
"isRequired": false,
224-
"format": "boolean"
225-
},
226219
{
227220
"type": "named",
228221
"name": "--disabledTools",
229222
"description": "Comma separated values of tool names, operation types, and/or categories of tools that will be disabled.",
230223
"isRequired": false
231224
},
225+
{
226+
"type": "named",
227+
"name": "--embeddingsValidation",
228+
"description": "When set to false, disables validation of embeddings dimensions.",
229+
"isRequired": false,
230+
"format": "boolean"
231+
},
232232
{
233233
"type": "named",
234234
"name": "--exportCleanupIntervalMs",
@@ -380,17 +380,17 @@
380380
"isSecret": true
381381
},
382382
{
383-
"name": "MDB_MCP_DISABLE_EMBEDDINGS_VALIDATION",
384-
"description": "When set to true, disables validation of embeddings dimensions.",
383+
"name": "MDB_MCP_DISABLED_TOOLS",
384+
"description": "Comma separated values of tool names, operation types, and/or categories of tools that will be disabled.",
385385
"isRequired": false,
386-
"format": "boolean",
386+
"format": "string",
387387
"isSecret": false
388388
},
389389
{
390-
"name": "MDB_MCP_DISABLED_TOOLS",
391-
"description": "Comma separated values of tool names, operation types, and/or categories of tools that will be disabled.",
390+
"name": "MDB_MCP_EMBEDDINGS_VALIDATION",
391+
"description": "When set to false, disables validation of embeddings dimensions.",
392392
"isRequired": false,
393-
"format": "string",
393+
"format": "boolean",
394394
"isSecret": false
395395
},
396396
{
@@ -544,19 +544,19 @@
544544
"description": "MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the connect tool before interacting with MongoDB data.",
545545
"isRequired": false
546546
},
547-
{
548-
"type": "named",
549-
"name": "--disableEmbeddingsValidation",
550-
"description": "When set to true, disables validation of embeddings dimensions.",
551-
"isRequired": false,
552-
"format": "boolean"
553-
},
554547
{
555548
"type": "named",
556549
"name": "--disabledTools",
557550
"description": "Comma separated values of tool names, operation types, and/or categories of tools that will be disabled.",
558551
"isRequired": false
559552
},
553+
{
554+
"type": "named",
555+
"name": "--embeddingsValidation",
556+
"description": "When set to false, disables validation of embeddings dimensions.",
557+
"isRequired": false,
558+
"format": "boolean"
559+
},
560560
{
561561
"type": "named",
562562
"name": "--exportCleanupIntervalMs",

0 commit comments

Comments
 (0)