Skip to content

Commit 4040d7e

Browse files
committed
Merge remote-tracking branch 'origin' into chore/mcp-235
2 parents 32cd550 + 46bf661 commit 4040d7e

File tree

12 files changed

+110
-69
lines changed

12 files changed

+110
-69
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
ignore:
8+
# We are ignoring major updates on yargs-parser because yargs-parser@22
9+
# does not play nicely when bundled using webpack. Our VSCode extension
10+
# bundles MCP server with the extension code and yargs-parser from MCP
11+
# server ends up on the final bundle which leads to issues such as -
12+
# https://github.com/mongodb-js/vscode/issues/1149.
13+
#
14+
# This was reported to yargs-parser as well -
15+
# https://github.com/yargs/yargs-parser/issues/517 and we already tried
16+
# their suggestion about disabling the meta resolution in webpack,
17+
# alongside others (dependency overrides, disabling the bundling of
18+
# yargs-parser), and none of the solutions yield a working extension. So
19+
# until we figure out a fix for this we need to keep mongodb-mcp-server
20+
# working with v21 of yargs-parser.
21+
- dependency-name: "yargs-parser"
22+
update-types: ["version-update:semver-major"]
723
- package-ecosystem: "github-actions"
824
directory: "/"
925
schedule:

.github/workflows/jira-issue.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
5555
- name: Add comment
5656
if: steps.create.outputs.issue-key
57-
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
57+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
5858
with:
5959
issue-number: ${{ github.event.issue.number }}
6060
body: |
@@ -104,7 +104,7 @@ jobs:
104104
transition-id: 61
105105
- name: Add closure comment
106106
if: steps.close_jira_ticket.outcome == 'success'
107-
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
107+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
108108
with:
109109
issue-number: ${{ github.event.issue.number }}
110110
body: |

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
360360
| `exportTimeoutMs` | `MDB_MCP_EXPORT_TIMEOUT_MS` | 300000 | Time in milliseconds after which an export is considered expired and eligible for cleanup. |
361361
| `exportCleanupIntervalMs` | `MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS` | 120000 | Time in milliseconds between export cleanup cycles that remove expired export files. |
362362
| `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. |
363+
| `voyageApiKey` | `MDB_VOYAGE_API_KEY` | <not set> | API key for communicating with Voyage AI. Used for generating embeddings for Vector search. |
363364

364365
#### Logger Options
365366

package-lock.json

Lines changed: 13 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mongodb-mcp-server",
33
"description": "MongoDB Model Context Protocol Server",
4-
"version": "1.0.2",
4+
"version": "1.0.3-prerelease.1",
55
"type": "module",
66
"exports": {
77
".": {
@@ -116,7 +116,7 @@
116116
"oauth4webapi": "^3.8.0",
117117
"openapi-fetch": "^0.14.0",
118118
"ts-levenshtein": "^1.0.7",
119-
"yargs-parser": "^22.0.0",
119+
"yargs-parser": "21.1.1",
120120
"zod": "^3.25.76"
121121
},
122122
"engines": {

src/common/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const OPTIONS = {
5353
"exportsPath",
5454
"exportTimeoutMs",
5555
"exportCleanupIntervalMs",
56+
"voyageApiKey",
5657
],
5758
boolean: [
5859
"apiDeprecationErrors",
@@ -181,6 +182,7 @@ export interface UserConfig extends CliOptions {
181182
maxDocumentsPerQuery: number;
182183
maxBytesPerQuery: number;
183184
atlasTemporaryDatabaseUserLifetimeMs: number;
185+
voyageApiKey: string;
184186
}
185187

186188
export const defaultUserConfig: UserConfig = {
@@ -210,6 +212,7 @@ export const defaultUserConfig: UserConfig = {
210212
maxDocumentsPerQuery: 100, // By default, we only fetch a maximum 100 documents per query / aggregation
211213
maxBytesPerQuery: 16 * 1024 * 1024, // By default, we only return ~16 mb of data per query / aggregation
212214
atlasTemporaryDatabaseUserLifetimeMs: 4 * 60 * 60 * 1000, // 4 hours
215+
voyageApiKey: "",
213216
};
214217

215218
export const config = setupUserConfig({

src/common/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file was generated by scripts/updatePackageVersion.ts - Do not edit it manually.
22
export const packageInfo = {
3-
version: "1.0.2",
3+
version: "1.0.3-prerelease.1",
44
mcpServerName: "MongoDB MCP Server",
55
};

src/server.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
UnsubscribeRequestSchema,
1919
} from "@modelcontextprotocol/sdk/types.js";
2020
import assert from "assert";
21-
import type { ToolBase } from "./tools/tool.js";
21+
import type { ToolBase, ToolConstructorParams } from "./tools/tool.js";
2222
import { validateConnectionString } from "./helpers/connectionOptions.js";
2323
import { packageInfo } from "./common/packageInfo.js";
2424
import { type ConnectionErrorHandler } from "./common/connectionErrorHandler.js";
@@ -31,6 +31,7 @@ export interface ServerOptions {
3131
telemetry: Telemetry;
3232
elicitation: Elicitation;
3333
connectionErrorHandler: ConnectionErrorHandler;
34+
toolConstructors?: (new (params: ToolConstructorParams) => ToolBase)[];
3435
}
3536

3637
export class Server {
@@ -39,6 +40,7 @@ export class Server {
3940
private readonly telemetry: Telemetry;
4041
public readonly userConfig: UserConfig;
4142
public readonly elicitation: Elicitation;
43+
private readonly toolConstructors: (new (params: ToolConstructorParams) => ToolBase)[];
4244
public readonly tools: ToolBase[] = [];
4345
public readonly connectionErrorHandler: ConnectionErrorHandler;
4446

@@ -51,14 +53,23 @@ export class Server {
5153
private readonly startTime: number;
5254
private readonly subscriptions = new Set<string>();
5355

54-
constructor({ session, mcpServer, userConfig, telemetry, connectionErrorHandler, elicitation }: ServerOptions) {
56+
constructor({
57+
session,
58+
mcpServer,
59+
userConfig,
60+
telemetry,
61+
connectionErrorHandler,
62+
elicitation,
63+
toolConstructors,
64+
}: ServerOptions) {
5565
this.startTime = Date.now();
5666
this.session = session;
5767
this.telemetry = telemetry;
5868
this.mcpServer = mcpServer;
5969
this.userConfig = userConfig;
6070
this.elicitation = elicitation;
6171
this.connectionErrorHandler = connectionErrorHandler;
72+
this.toolConstructors = toolConstructors ?? [...AtlasTools, ...MongoDbTools];
6273
}
6374

6475
async connect(transport: Transport): Promise<void> {
@@ -206,7 +217,7 @@ export class Server {
206217
}
207218

208219
private registerTools(): void {
209-
for (const toolConstructor of [...AtlasTools, ...MongoDbTools]) {
220+
for (const toolConstructor of this.toolConstructors) {
210221
const tool = new toolConstructor({
211222
session: this.session,
212223
config: this.userConfig,

src/tools/mongodb/metadata/collectionStorageSize.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export class CollectionStorageSizeTool extends MongoDBToolBase {
4242
type: "text",
4343
},
4444
],
45+
isError: true,
4546
};
4647
}
4748

src/tools/mongodb/read/collectionIndexes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class CollectionIndexesTool extends MongoDBToolBase {
3737
type: "text",
3838
},
3939
],
40+
isError: true,
4041
};
4142
}
4243

0 commit comments

Comments
 (0)