Skip to content

Commit c7874e3

Browse files
committed
merge main
2 parents 36f61cd + 42261a2 commit c7874e3

15 files changed

Lines changed: 389 additions & 186 deletions

File tree

.github/workflows/code-health.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,22 @@ jobs:
149149
- name: Install dependencies
150150
run: pnpm install --frozen-lockfile
151151
- name: Download test results
152-
uses: actions/download-artifact@v7
152+
uses: actions/download-artifact@v8
153153
with:
154154
name: test-results
155155
path: coverage/mongodb
156156
- name: Download atlas test results
157-
uses: actions/download-artifact@v7
157+
uses: actions/download-artifact@v8
158158
with:
159159
name: atlas-test-results
160160
path: coverage/atlas
161161
- name: Download atlas local test results
162-
uses: actions/download-artifact@v7
162+
uses: actions/download-artifact@v8
163163
with:
164164
name: atlas-local-test-results
165165
path: coverage/atlas-local
166166
- name: Download browser test results
167-
uses: actions/download-artifact@v7
167+
uses: actions/download-artifact@v8
168168
with:
169169
name: browser-test-results
170170
path: coverage/browser

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ NOTE: atlas tools are only available when you set credentials on [configuration]
329329
#### MongoDB Atlas Local Tools
330330

331331
- `atlas-local-connect-deployment` - Connect to a MongoDB Atlas Local deployment
332-
- `atlas-local-create-deployment` - Create a MongoDB Atlas local deployment
332+
- `atlas-local-create-deployment` - Create a MongoDB Atlas local deployment. Default image is preview. When the user does not specify an image tag, inform them that preview is used by default and provide this link for more information: https://hub.docker.com/r/mongodb/mongodb-atlas-local
333333
- `atlas-local-delete-deployment` - Delete a MongoDB Atlas local deployment
334334
- `atlas-local-list-deployments` - List MongoDB Atlas local deployments
335335

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.7.0",
4+
"version": "1.8.0",
55
"type": "module",
66
"packageManager": "pnpm@10.23.0",
77
"mcpName": "io.github.mongodb-js/mongodb-mcp-server",
@@ -183,7 +183,7 @@
183183
"node": "^20.19.0 || ^22.12.0 || >= 23.0.0"
184184
},
185185
"optionalDependencies": {
186-
"@mongodb-js/atlas-local": "^1.1.0",
186+
"@mongodb-js/atlas-local": "^1.3.0",
187187
"kerberos": "^7.0.0"
188188
},
189189
"pnpm": {

pnpm-lock.yaml

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

server.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"url": "https://github.com/mongodb-js/mongodb-mcp-server",
77
"source": "github"
88
},
9-
"version": "1.7.0",
9+
"version": "1.8.0",
1010
"packages": [
1111
{
1212
"registryType": "npm",
1313
"identifier": "mongodb-mcp-server",
14-
"version": "1.7.0",
14+
"version": "1.8.0",
1515
"transport": {
1616
"type": "stdio"
1717
},
@@ -494,7 +494,7 @@
494494
},
495495
{
496496
"registryType": "oci",
497-
"identifier": "docker.io/mongodb/mongodb-mcp-server:1.7.0",
497+
"identifier": "docker.io/mongodb/mongodb-mcp-server:1.8.0",
498498
"transport": {
499499
"type": "stdio"
500500
},

src/common/atlas/apiClient.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ export class ApiClient {
5858
}) as unknown as typeof fetch;
5959
this.options = {
6060
...options,
61-
userAgent:
62-
options.userAgent ??
63-
`AtlasMCP/${packageInfo.version} (${process.platform}; ${process.arch}; ${process.env.HOSTNAME || "unknown"})`,
61+
userAgent: options.userAgent ?? `AtlasMCP/${packageInfo.version} (${process.platform}; ${process.arch})`,
6462
};
6563

6664
this.authProvider =

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.7.0",
3+
version: "1.8.0",
44
mcpServerName: "MongoDB MCP Server",
55
};

src/tools/atlasLocal/create/createDeployment.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@ import z from "zod";
77

88
export class CreateDeploymentTool extends AtlasLocalToolBase {
99
static toolName = "atlas-local-create-deployment";
10-
public description = "Create a MongoDB Atlas local deployment";
10+
public description =
11+
"Create a MongoDB Atlas local deployment. Default image is preview. When the user does not specify an image tag, inform them that preview is used by default and provide this link for more information: https://hub.docker.com/r/mongodb/mongodb-atlas-local";
1112
static operationType: OperationType = "create";
1213
public argsShape = {
1314
deploymentName: CommonArgs.string().describe("Name of the deployment to create").optional(),
1415
loadSampleData: z.boolean().describe("Load sample data into the deployment").optional().default(false),
16+
imageTag: z
17+
.string()
18+
.describe("Atlas Local image tag: 'preview', 'latest', or a semver (e.g. '8.0.0'). Default: 'preview'.")
19+
.optional()
20+
.default("preview"),
1521
};
1622

1723
protected async executeWithAtlasLocalClient(
18-
{ deploymentName, loadSampleData }: ToolArgs<typeof this.argsShape>,
24+
{ deploymentName, loadSampleData, imageTag }: ToolArgs<typeof this.argsShape>,
1925
{ client }: { client: Client }
2026
): Promise<CallToolResult> {
2127
const deploymentOptions: CreateDeploymentOptions = {
@@ -25,6 +31,8 @@ export class CreateDeploymentTool extends AtlasLocalToolBase {
2531
source: "MCPServer",
2632
},
2733
loadSampleData,
34+
imageTag,
35+
...(this.config.voyageApiKey ? { voyageApiKey: this.config.voyageApiKey } : {}),
2836
doNotTrack: !this.telemetry.isTelemetryEnabled(),
2937
};
3038
// Create the deployment
@@ -34,7 +42,7 @@ export class CreateDeploymentTool extends AtlasLocalToolBase {
3442
content: [
3543
{
3644
type: "text",
37-
text: `Deployment with container ID "${deployment.containerId}" and name "${deployment.name}" created.`,
45+
text: `Deployment with container ID "${deployment.containerId}" and name "${deployment.name}" created (imageTag: ${imageTag}).`,
3846
},
3947
],
4048
_meta: {

src/tools/mongodb/read/find.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ Note to LLM: If the entire query result is required, use the "export" tool inste
8787
provider.countDocuments(database, collection, filter, {
8888
// We should be counting documents that the original
8989
// query would have yielded which is why we don't
90-
// use `limitOnFindCursor` calculated above, only
91-
// the limit provided to the tool.
92-
limit,
90+
// use `limitOnFindCursor` calculated above, and
91+
// we don't use the limit provided to the tool either.
9392
maxTimeMS: QUERY_COUNT_MAX_TIME_MS_CAP,
9493
signal,
9594
}),

src/transports/streamableHttp.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,18 @@ export class StreamableHttpRunner<
135135
}): Promise<void> {
136136
this.mcpServer = new MCPHttpServer<TUserConfig, TContext>({
137137
userConfig: this.userConfig,
138-
createServerForRequest: ({ request }): Promise<Server<TUserConfig, TContext>> =>
139-
this.createServerForRequest({ request, serverOptions, sessionOptions }),
138+
serverOptions,
139+
sessionOptions,
140+
createServerForRequest: ({
141+
request,
142+
serverOptions: requestServerOptions,
143+
sessionOptions: requestSessionOptions,
144+
}): Promise<Server<TUserConfig, TContext>> =>
145+
this.createServerForRequest({
146+
request,
147+
serverOptions: requestServerOptions,
148+
sessionOptions: requestSessionOptions,
149+
}),
140150
logger: this.logger,
141151
});
142152
await this.mcpServer.start();
@@ -270,17 +280,13 @@ abstract class ExpressBasedHttpServer {
270280
class MCPHttpServer<TUserConfig extends UserConfig = UserConfig, TContext = unknown> extends ExpressBasedHttpServer {
271281
private sessionStore!: SessionStore<StreamableHTTPServerTransport>;
272282
private serverOptions?: CustomizableServerOptions<TUserConfig, TContext>;
273-
private sessionOptions?: CustomizableSessionOptions;
283+
private sessionOptions?: CustomizableSessionOptions<TUserConfig>;
274284
private userConfig: UserConfig;
275285

276-
private createServerForRequest: ({
277-
request,
278-
serverOptions,
279-
sessionOptions,
280-
}: {
286+
private createServerForRequest: (createParams: {
281287
request: RequestContext;
282288
serverOptions?: CustomizableServerOptions<TUserConfig, TContext>;
283-
sessionOptions?: CustomizableSessionOptions;
289+
sessionOptions?: CustomizableSessionOptions<TUserConfig>;
284290
}) => Promise<Server<TUserConfig, TContext>>;
285291

286292
constructor({
@@ -291,7 +297,11 @@ class MCPHttpServer<TUserConfig extends UserConfig = UserConfig, TContext = unkn
291297
logger,
292298
}: {
293299
userConfig: TUserConfig;
294-
createServerForRequest: ({ request }: { request: RequestContext }) => Promise<Server<TUserConfig, TContext>>;
300+
createServerForRequest: (createParams: {
301+
request: RequestContext;
302+
serverOptions?: CustomizableServerOptions<TUserConfig, TContext>;
303+
sessionOptions?: CustomizableSessionOptions<TUserConfig>;
304+
}) => Promise<Server<TUserConfig, TContext>>;
295305
logger: LoggerBase;
296306
serverOptions?: CustomizableServerOptions<TUserConfig, TContext>;
297307
sessionOptions?: CustomizableSessionOptions<TUserConfig>;

0 commit comments

Comments
 (0)