Skip to content

Commit 6325422

Browse files
authored
chore: rename vectorSearch feature flag to search (#760)
1 parent 17cdcd1 commit 6325422

File tree

22 files changed

+45
-44
lines changed

22 files changed

+45
-44
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,12 @@ You can disable telemetry using:
499499

500500
The MongoDB MCP Server may offer functionality that is still in development and may change in future releases. These features are considered "preview features" and are not enabled by default. Generally, these features are well tested, but may not offer the complete functionality we intend to provide in the final release or we'd like to gather feedback before making them generally available. To enable one or more preview features, use the `previewFeatures` configuration option.
501501

502-
- For **environment variable** configuration, use a comma-separated string: `export MDB_MCP_PREVIEW_FEATURES="vectorSearch,feature1,feature2"`.
503-
- For **command-line argument** configuration, use a space-separated string: `--previewFeatures vectorSearch feature1 feature2`.
502+
- For **environment variable** configuration, use a comma-separated string: `export MDB_MCP_PREVIEW_FEATURES="search,feature1,feature2"`.
503+
- For **command-line argument** configuration, use a space-separated string: `--previewFeatures search feature1 feature2`.
504504

505505
List of available preview features:
506506

507-
- `vectorSearch` - Enables tools or functionality related to Vector Search in MongoDB Atlas:
507+
- `search` - Enables tools or functionality related to Atlas Search and Vector Search in MongoDB Atlas:
508508
- Index management, such as creating, listing, and dropping search and vector search indexes.
509509
- Querying collections using vector search capabilities. This requires a configured embedding model that will be used to generate vector representations of the query data. Currently, only [Voyage AI](https://www.voyageai.com) embedding models are supported. Set the `voyageApiKey` configuration option with your Voyage AI API key to use this feature.
510510

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"test": "vitest --project eslint-rules --project unit-and-integration --coverage",
7171
"test:accuracy": "sh ./scripts/accuracy/runAccuracyTests.sh",
7272
"test:long-running-tests": "vitest --project long-running-tests --coverage",
73+
"test:local": "SKIP_ATLAS_TESTS=true SKIP_ATLAS_LOCAL_TESTS=true pnpm run test",
7374
"atlas:cleanup": "vitest --project atlas-cleanup"
7475
},
7576
"license": "Apache-2.0",

src/common/config/createUserConfig.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,19 @@ function registerKnownSecretsInRootKeychain(userConfig: Partial<UserConfig>): vo
170170
}
171171

172172
function warnIfVectorSearchNotEnabledCorrectly(config: UserConfig, warn: (message: string) => void): void {
173-
const vectorSearchEnabled = config.previewFeatures.includes("vectorSearch");
173+
const searchEnabled = config.previewFeatures.includes("search");
174174
const embeddingsProviderConfigured = !!config.voyageApiKey;
175-
if (vectorSearchEnabled && !embeddingsProviderConfigured) {
175+
if (searchEnabled && !embeddingsProviderConfigured) {
176176
warn(`\
177177
Warning: Vector search is enabled but no embeddings provider is configured.
178178
- Set an embeddings provider configuration option to enable auto-embeddings during document insertion and text-based queries with $vectorSearch.\
179179
`);
180180
}
181181

182-
if (!vectorSearchEnabled && embeddingsProviderConfigured) {
182+
if (!searchEnabled && embeddingsProviderConfigured) {
183183
warn(`\
184-
Warning: An embeddings provider is configured but the 'vectorSearch' preview feature is not enabled.
185-
- Enable vector search by adding 'vectorSearch' to the 'previewFeatures' configuration option, or remove the embeddings provider configuration if not needed.\
184+
Warning: An embeddings provider is configured but the 'search' preview feature is not enabled.
185+
- Enable vector search by adding 'search' to the 'previewFeatures' configuration option, or remove the embeddings provider configuration if not needed.\
186186
`);
187187
}
188188
}

src/common/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const previewFeatureValues = ["vectorSearch"] as const;
1+
export const previewFeatureValues = ["search"] as const;
22
export type PreviewFeature = (typeof previewFeatureValues)[number];
33

44
export const similarityValues = ["cosine", "euclidean", "dotProduct"] as const;

src/common/search/embeddingsProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class VoyageEmbeddingsProvider implements EmbeddingsProvider<VoyageModels, Voyag
4141
}
4242

4343
static isConfiguredIn({ voyageApiKey, previewFeatures }: UserConfig): boolean {
44-
return previewFeatures.includes("vectorSearch") && !!voyageApiKey;
44+
return previewFeatures.includes("search") && !!voyageApiKey;
4545
}
4646

4747
async embed<Model extends VoyageModels>(

src/tools/mongodb/create/createIndex.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ export class CreateIndexTool extends MongoDBToolBase {
7676
type: z.literal("classic"),
7777
keys: z.object({}).catchall(z.custom<IndexDirection>()).describe("The index definition"),
7878
}),
79-
...(this.isFeatureEnabled("vectorSearch") ? [this.vectorSearchIndexDefinition] : []),
79+
...(this.isFeatureEnabled("search") ? [this.vectorSearchIndexDefinition] : []),
8080
])
8181
)
8282
.describe(
83-
`The index definition. Use 'classic' for standard indexes${this.isFeatureEnabled("vectorSearch") ? " and 'vectorSearch' for vector search indexes" : ""}.`
83+
`The index definition. Use 'classic' for standard indexes${this.isFeatureEnabled("search") ? " and 'vectorSearch' for vector search indexes" : ""}.`
8484
),
8585
};
8686

src/tools/mongodb/create/insertMany.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class InsertManyTool extends MongoDBToolBase {
2525
.describe(
2626
"The array of documents to insert, matching the syntax of the document argument of db.collection.insertMany()."
2727
),
28-
...(this.isFeatureEnabled("vectorSearch")
28+
...(this.isFeatureEnabled("search")
2929
? {
3030
embeddingParameters: zSupportedEmbeddingParametersWithInput
3131
.optional()
@@ -45,7 +45,7 @@ export class InsertManyTool extends MongoDBToolBase {
4545
}: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
4646
const provider = await this.ensureConnected();
4747

48-
const embeddingParameters = this.isFeatureEnabled("vectorSearch")
48+
const embeddingParameters = this.isFeatureEnabled("search")
4949
? (providedEmbeddingParameters as z.infer<typeof zSupportedEmbeddingParametersWithInput>)
5050
: undefined;
5151

src/tools/mongodb/delete/dropIndex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class DropIndexTool extends MongoDBToolBase {
1010
protected argsShape = {
1111
...DbOperationArgs,
1212
indexName: z.string().nonempty().describe("The name of the index to be dropped."),
13-
type: this.isFeatureEnabled("vectorSearch")
13+
type: this.isFeatureEnabled("search")
1414
? z
1515
.enum(["classic", "search"])
1616
.describe(

src/tools/mongodb/metadata/collectionIndexes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class CollectionIndexesTool extends MongoDBToolBase {
3131
}));
3232

3333
const searchIndexDefinitions: SearchIndexStatus[] = [];
34-
if (this.isFeatureEnabled("vectorSearch") && (await this.session.isSearchSupported())) {
34+
if (this.isFeatureEnabled("search") && (await this.session.isSearchSupported())) {
3535
const searchIndexes = await provider.getSearchIndexes(database, collection);
3636
searchIndexDefinitions.push(...this.extractSearchIndexDetails(searchIndexes));
3737
}

src/tools/mongodb/metadata/explain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class ExplainTool extends MongoDBToolBase {
2020
z.discriminatedUnion("name", [
2121
z.object({
2222
name: z.literal("aggregate"),
23-
arguments: z.object(getAggregateArgs(this.isFeatureEnabled("vectorSearch"))),
23+
arguments: z.object(getAggregateArgs(this.isFeatureEnabled("search"))),
2424
}),
2525
z.object({
2626
name: z.literal("find"),

0 commit comments

Comments
 (0)