@mongodb-js/mcp-tools-atlas-local 3.0.0-prerelease.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/atlasLocalClient.d.ts +11 -0
  2. package/dist/atlasLocalClient.d.ts.map +1 -0
  3. package/dist/atlasLocalClient.js +46 -0
  4. package/dist/atlasLocalClient.js.map +1 -0
  5. package/dist/atlasLocalTool.d.ts +37 -0
  6. package/dist/atlasLocalTool.d.ts.map +1 -0
  7. package/dist/atlasLocalTool.js +105 -0
  8. package/dist/atlasLocalTool.js.map +1 -0
  9. package/dist/connectionString.d.ts +17 -0
  10. package/dist/connectionString.d.ts.map +1 -0
  11. package/dist/connectionString.js +36 -0
  12. package/dist/connectionString.js.map +1 -0
  13. package/dist/index.d.ts +8 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +11 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/tools/connect/connectDeployment.d.ts +31 -0
  18. package/dist/tools/connect/connectDeployment.d.ts.map +1 -0
  19. package/dist/tools/connect/connectDeployment.js +80 -0
  20. package/dist/tools/connect/connectDeployment.js.map +1 -0
  21. package/dist/tools/create/createDeployment.d.ts +34 -0
  22. package/dist/tools/create/createDeployment.d.ts.map +1 -0
  23. package/dist/tools/create/createDeployment.js +89 -0
  24. package/dist/tools/create/createDeployment.js.map +1 -0
  25. package/dist/tools/delete/deleteDeployment.d.ts +22 -0
  26. package/dist/tools/delete/deleteDeployment.d.ts.map +1 -0
  27. package/dist/tools/delete/deleteDeployment.js +38 -0
  28. package/dist/tools/delete/deleteDeployment.js.map +1 -0
  29. package/dist/tools/read/listDeployments.d.ts +25 -0
  30. package/dist/tools/read/listDeployments.d.ts.map +1 -0
  31. package/dist/tools/read/listDeployments.js +56 -0
  32. package/dist/tools/read/listDeployments.js.map +1 -0
  33. package/dist/tools/tools.d.ts +5 -0
  34. package/dist/tools/tools.d.ts.map +1 -0
  35. package/dist/tools/tools.js +5 -0
  36. package/dist/tools/tools.js.map +1 -0
  37. package/package.json +37 -0
@@ -0,0 +1,11 @@
1
+ import type { Client } from "@mongodb-js/atlas-local";
2
+ import { type LoggerBase } from "@mongodb-js/mcp-core";
3
+ export type AtlasLocalClientFactoryFn = ({ logger, loader, }: {
4
+ logger: LoggerBase;
5
+ loader?: LibraryLoader;
6
+ }) => Promise<Client | undefined>;
7
+ export interface LibraryLoader {
8
+ loadAtlasLocalClient: (logger: LoggerBase) => Promise<typeof Client | undefined>;
9
+ }
10
+ export declare const createAtlasLocalClient: AtlasLocalClientFactoryFn;
11
+ //# sourceMappingURL=atlasLocalClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlasLocalClient.d.ts","sourceRoot":"","sources":["../src/atlasLocalClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,MAAM,yBAAyB,GAAG,CAAC,EACrC,MAAM,EACN,MAAM,GACT,EAAE;IACC,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,aAAa,CAAC;CAC1B,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAElC,MAAM,WAAW,aAAa;IAC1B,oBAAoB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,OAAO,MAAM,GAAG,SAAS,CAAC,CAAC;CACpF;AAmCD,eAAO,MAAM,sBAAsB,EAAE,yBAkBpC,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { LogId } from "@mongodb-js/mcp-core";
2
+ class DefaultLibraryLoader {
3
+ constructor() {
4
+ this.isAtlasLocalSupported = true;
5
+ }
6
+ async loadAtlasLocalClient(logger) {
7
+ // If we've tried and failed to load the Atlas Local client before, don't try again
8
+ if (!this.isAtlasLocalSupported) {
9
+ return undefined;
10
+ }
11
+ try {
12
+ // Try to dynamically import the Atlas Local client library - this will fail
13
+ // on unsupported platforms (e.g., Windows on ARM)
14
+ const { Client: AtlasLocalClient } = await import("@mongodb-js/atlas-local");
15
+ return AtlasLocalClient;
16
+ }
17
+ catch {
18
+ this.isAtlasLocalSupported = false;
19
+ logger.warning({
20
+ id: LogId.atlasLocalUnsupportedPlatform,
21
+ message: "Atlas Local is not supported on this platform. Atlas Local tools are disabled. All other tools continue to work normally.",
22
+ context: "Atlas Local Initialization",
23
+ });
24
+ return undefined;
25
+ }
26
+ }
27
+ }
28
+ DefaultLibraryLoader.instance = new DefaultLibraryLoader();
29
+ export const createAtlasLocalClient = async ({ logger, loader }) => {
30
+ const libraryLoader = loader ?? DefaultLibraryLoader.instance;
31
+ const client = await libraryLoader.loadAtlasLocalClient(logger);
32
+ try {
33
+ // Connect to Atlas Local client
34
+ // This will fail if docker is not running
35
+ return client?.connect();
36
+ }
37
+ catch {
38
+ logger.warning({
39
+ id: LogId.atlasLocalDockerNotRunning,
40
+ message: "Cannot connect to Docker. Atlas Local tools are disabled. All other tools continue to work normally.",
41
+ context: "Atlas Local Initialization",
42
+ });
43
+ return undefined;
44
+ }
45
+ };
46
+ //# sourceMappingURL=atlasLocalClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlasLocalClient.js","sourceRoot":"","sources":["../src/atlasLocalClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAmB,MAAM,sBAAsB,CAAC;AAc9D,MAAM,oBAAoB;IAKtB;QAFQ,0BAAqB,GAAY,IAAI,CAAC;IAEvB,CAAC;IAEjB,KAAK,CAAC,oBAAoB,CAAC,MAAkB;QAChD,mFAAmF;QACnF,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC9B,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,IAAI,CAAC;YACD,4EAA4E;YAC5E,kDAAkD;YAClD,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;YAC7E,OAAO,gBAAgB,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC;YACL,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;YAEnC,MAAM,CAAC,OAAO,CAAC;gBACX,EAAE,EAAE,KAAK,CAAC,6BAA6B;gBACvC,OAAO,EACH,2HAA2H;gBAC/H,OAAO,EAAE,4BAA4B;aACxC,CAAC,CAAC;YAEH,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;;AA7BsB,6BAAQ,GAAG,IAAI,oBAAoB,EAAE,AAA7B,CAA8B;AAgCjE,MAAM,CAAC,MAAM,sBAAsB,GAA8B,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;IAC1F,MAAM,aAAa,GAAG,MAAM,IAAI,oBAAoB,CAAC,QAAQ,CAAC;IAC9D,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAEhE,IAAI,CAAC;QACD,gCAAgC;QAChC,0CAA0C;QAC1C,OAAO,MAAM,EAAE,OAAO,EAAE,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACL,MAAM,CAAC,OAAO,CAAC;YACX,EAAE,EAAE,KAAK,CAAC,0BAA0B;YACpC,OAAO,EACH,sGAAsG;YAC1G,OAAO,EAAE,4BAA4B;SACxC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACrB,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { CallToolResult, ISession, IToolConfig, ConnectionMetadata } from "@mongodb-js/mcp-types";
2
+ import type { ToolArgs } from "@mongodb-js/mcp-core";
3
+ import type { ToolExecutionContext } from "@mongodb-js/mcp-types";
4
+ import { ToolBase } from "@mongodb-js/mcp-core";
5
+ import type { Client } from "@mongodb-js/atlas-local";
6
+ import type { ToolCategory } from "@mongodb-js/mcp-types";
7
+ import type { ConnectionRegistry } from "@mongodb-js/mcp-tools-mongodb";
8
+ export interface IAtlasLocalConfig extends IToolConfig {
9
+ voyageApiKey?: string;
10
+ }
11
+ export interface IAtlasLocalSession extends ISession {
12
+ config: IAtlasLocalConfig;
13
+ readonly atlasLocalClient?: Client;
14
+ readonly connectionRegistry: ConnectionRegistry;
15
+ connectToMongoDB(settings: {
16
+ connectionString: string;
17
+ }): Promise<void>;
18
+ }
19
+ export declare const AtlasLocalToolMetadataDeploymentIdKey = "deploymentId";
20
+ export declare abstract class AtlasLocalToolBase extends ToolBase<IAtlasLocalSession> {
21
+ static category: ToolCategory;
22
+ protected readonly session: IAtlasLocalSession;
23
+ protected verifyAllowed(): boolean;
24
+ protected execute(args: ToolArgs<typeof this.argsShape>, _context: ToolExecutionContext): Promise<CallToolResult>;
25
+ private lookupDeploymentId;
26
+ protected lookupTelemetryMetadata(client: Client, containerId: string): Promise<{
27
+ [key: string]: unknown;
28
+ }>;
29
+ protected abstract executeWithAtlasLocalClient(args: ToolArgs<typeof this.argsShape>, context: {
30
+ client: Client;
31
+ }): Promise<CallToolResult>;
32
+ protected handleError(error: unknown, args: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> | CallToolResult;
33
+ protected resolveTelemetryMetadata(_args: ToolArgs<typeof this.argsShape>, { result }: {
34
+ result: CallToolResult;
35
+ }): ConnectionMetadata | Promise<ConnectionMetadata>;
36
+ }
37
+ //# sourceMappingURL=atlasLocalTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlasLocalTool.d.ts","sourceRoot":"","sources":["../src/atlasLocalTool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACvG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE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AAE,GAC5B,OAAO,CAAC,cAAc,CAAC;IAE1B,SAAS,CAAC,WAAW,CACjB,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,GACtC,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc;IAwC3C,SAAS,CAAC,wBAAwB,CAC9B,KAAK,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,EACtC,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,cAAc,CAAA;KAAE,GACvC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAatD"}
@@ -0,0 +1,105 @@
1
+ import { ToolBase } from "@mongodb-js/mcp-core";
2
+ import { LogId } from "@mongodb-js/mcp-core";
3
+ export const AtlasLocalToolMetadataDeploymentIdKey = "deploymentId";
4
+ export class AtlasLocalToolBase extends ToolBase {
5
+ verifyAllowed() {
6
+ return this.session.atlasLocalClient !== undefined && super.verifyAllowed();
7
+ }
8
+ async execute(args,
9
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
+ _context) {
11
+ const client = this.session.atlasLocalClient;
12
+ // If the client is not found, throw an error
13
+ // This should never happen:
14
+ // - atlas-local tools are only added after the client is set
15
+ // this means that if we were unable to get the client, the tool will not be registered
16
+ // - in case the tool was registered by accident
17
+ // verifyAllowed would still return false preventing the tool from being registered,
18
+ // preventing the tool from being executed
19
+ if (!client) {
20
+ return {
21
+ content: [
22
+ {
23
+ type: "text",
24
+ text: `Something went wrong on our end, this tool should have been disabled but it was not.
25
+ please log a ticket here: https://github.com/mongodb-js/mongodb-mcp-server/issues/new?template=bug_report.yml`,
26
+ },
27
+ ],
28
+ isError: true,
29
+ };
30
+ }
31
+ return this.executeWithAtlasLocalClient(args, { client });
32
+ }
33
+ async lookupDeploymentId(client, containerId) {
34
+ try {
35
+ // Lookup and return the deployment id for telemetry metadata.
36
+ return await client.getDeploymentId(containerId);
37
+ }
38
+ catch (error) {
39
+ this.session.logger.debug({
40
+ id: LogId.telemetryMetadataError,
41
+ context: "tool",
42
+ message: `Error looking up deployment ID: ${String(error)}`,
43
+ });
44
+ return undefined;
45
+ }
46
+ }
47
+ async lookupTelemetryMetadata(client, containerId) {
48
+ if (!this.telemetry.isTelemetryEnabled()) {
49
+ return {};
50
+ }
51
+ const deploymentId = await this.lookupDeploymentId(client, containerId);
52
+ if (deploymentId === undefined) {
53
+ return {};
54
+ }
55
+ return {
56
+ [AtlasLocalToolMetadataDeploymentIdKey]: deploymentId,
57
+ };
58
+ }
59
+ handleError(error, args) {
60
+ // Error Handling for expected Atlas Local errors go here
61
+ const errorMessage = error instanceof Error ? error.message : String(error);
62
+ // Check if Docker daemon is not running
63
+ if (errorMessage.includes("Cannot connect to the Docker daemon") ||
64
+ errorMessage.includes("Is the docker daemon running") ||
65
+ errorMessage.includes("connect ENOENT") ||
66
+ errorMessage.includes("ECONNREFUSED")) {
67
+ return {
68
+ content: [
69
+ {
70
+ type: "text",
71
+ text: "Docker is not running. Please start Docker and try again. Atlas Local tools require Docker to be running.",
72
+ },
73
+ ],
74
+ isError: true,
75
+ };
76
+ }
77
+ if (errorMessage.includes("No such container")) {
78
+ const deploymentName = "deploymentName" in args ? args.deploymentName : "the specified deployment";
79
+ return {
80
+ content: [
81
+ {
82
+ type: "text",
83
+ text: `The Atlas Local deployment "${deploymentName}" was not found. Please check the deployment name or use "atlas-local-list-deployments" to see available deployments.`,
84
+ },
85
+ ],
86
+ isError: true,
87
+ };
88
+ }
89
+ // For other types of errors, use the default error handling from the base class
90
+ return super.handleError(error, args);
91
+ }
92
+ resolveTelemetryMetadata(_args, { result }) {
93
+ const toolMetadata = {};
94
+ // Atlas Local tools set the deployment ID in the result metadata for telemetry
95
+ // If the deployment ID is set, we use it for telemetry
96
+ const resultDeploymentId = result._meta?.[AtlasLocalToolMetadataDeploymentIdKey];
97
+ if (resultDeploymentId !== undefined && typeof resultDeploymentId === "string") {
98
+ toolMetadata.atlas_local_deployment_id = resultDeploymentId;
99
+ toolMetadata.connection_host_type = "atlas_local";
100
+ }
101
+ return toolMetadata;
102
+ }
103
+ }
104
+ AtlasLocalToolBase.category = "atlas-local";
105
+ //# sourceMappingURL=atlasLocalTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlasLocalTool.js","sourceRoot":"","sources":["../src/atlasLocalTool.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAgB7C,MAAM,CAAC,MAAM,qCAAqC,GAAG,cAAc,CAAC;AAEpE,MAAM,OAAgB,kBAAmB,SAAQ,QAA4B;IAK/D,aAAa;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,KAAK,SAAS,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;IAChF,CAAC;IAES,KAAK,CAAC,OAAO,CACnB,IAAqC;IACrC,6DAA6D;IAC7D,QAA8B;QAE9B,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAE7C,6CAA6C;QAC7C,4BAA4B;QAC5B,6DAA6D;QAC7D,yFAAyF;QACzF,gDAAgD;QAChD,sFAAsF;QACtF,4CAA4C;QAC5C,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;8GACgF;qBACzF;iBACJ;gBACD,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;QAED,OAAO,IAAI,CAAC,2BAA2B,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAC,MAAc,EAAE,WAAmB;QAChE,IAAI,CAAC;YACD,8DAA8D;YAC9D,OAAO,MAAM,MAAM,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;QACrD,CAAC;QA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mBAAmB,CAAC,EAAE,CAAC;YAC7C,MAAM,cAAc,GAChB,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAE,IAAI,CAAC,cAAyB,CAAC,CAAC,CAAC,0BAA0B,CAAC;YAC5F,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,+BAA+B,cAAc,uHAAuH;qBAC7K;iBACJ;gBACD,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;QAED,gFAAgF;QAChF,OAAO,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;IAES,wBAAwB,CAC9B,KAAsC,EACtC,EAAE,MAAM,EAA8B;QAEtC,MAAM,YAAY,GAAuB,EAAE,CAAC;QAE5C,+EAA+E;QAC/E,uDAAuD;QACvD,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,qCAAqC,CAAC,CAAC;QACjF,IAAI,kBAAkB,KAAK,SAAS,IAAI,OAAO,kBAAkB,KAAK,QAAQ,EAAE,CAAC;YAC7E,YAAY,CAAC,yBAAyB,GAAG,kBAAkB,CAAC;YAC5D,YAAY,CAAC,oBAAoB,GAAG,aAAa,CAAC;QACtD,CAAC;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;;AAnIM,2BAAQ,GAAiB,aAAa,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { Client } from "@mongodb-js/atlas-local";
2
+ /** Keep well under the MCP client's default ~60s request timeout. */
3
+ export declare const DEFAULT_MAX_ATTEMPTS = 60;
4
+ export declare const DEFAULT_INTERVAL_MS = 500;
5
+ export declare class AtlasLocalDeploymentNotReadyError extends Error {
6
+ readonly deploymentName: string;
7
+ constructor(deploymentName: string);
8
+ }
9
+ /**
10
+ * atlas-local-create-deployment can return before Docker publishes port bindings.
11
+ * Retry briefly so connect usually works without exceeding MCP request timeouts.
12
+ */
13
+ export declare function waitForConnectionString(client: Client, deploymentName: string, { maxAttempts, intervalMs, }?: {
14
+ maxAttempts?: number;
15
+ intervalMs?: number;
16
+ }): Promise<string>;
17
+ //# sourceMappingURL=connectionString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectionString.d.ts","sourceRoot":"","sources":["../src/connectionString.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGtD,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,qBAAa,iCAAkC,SAAQ,KAAK;IACxD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;gBAEpB,cAAc,EAAE,MAAM;CAKrC;AAOD;;;GAGG;AACH,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EACtB,EACI,WAAkC,EAClC,UAAgC,GACnC,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,GACtD,OAAO,CAAC,MAAM,CAAC,CAgBjB"}
@@ -0,0 +1,36 @@
1
+ import { sleep } from "@mongodb-js/mcp-core";
2
+ /** Keep well under the MCP client's default ~60s request timeout. */
3
+ export const DEFAULT_MAX_ATTEMPTS = 60;
4
+ export const DEFAULT_INTERVAL_MS = 500;
5
+ export class AtlasLocalDeploymentNotReadyError extends Error {
6
+ constructor(deploymentName) {
7
+ super(`Atlas Local deployment "${deploymentName}" is still starting up`);
8
+ this.name = "AtlasLocalDeploymentNotReadyError";
9
+ this.deploymentName = deploymentName;
10
+ }
11
+ }
12
+ function isMissingPortBindingError(error) {
13
+ const message = error instanceof Error ? error.message : String(error);
14
+ return message.includes("Missing port binding information");
15
+ }
16
+ /**
17
+ * atlas-local-create-deployment can return before Docker publishes port bindings.
18
+ * Retry briefly so connect usually works without exceeding MCP request timeouts.
19
+ */
20
+ export async function waitForConnectionString(client, deploymentName, { maxAttempts = DEFAULT_MAX_ATTEMPTS, intervalMs = DEFAULT_INTERVAL_MS, } = {}) {
21
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
22
+ try {
23
+ return await client.getConnectionString(deploymentName);
24
+ }
25
+ catch (error) {
26
+ if (!isMissingPortBindingError(error)) {
27
+ throw error;
28
+ }
29
+ if (attempt < maxAttempts - 1) {
30
+ await sleep(intervalMs);
31
+ }
32
+ }
33
+ }
34
+ throw new AtlasLocalDeploymentNotReadyError(deploymentName);
35
+ }
36
+ //# sourceMappingURL=connectionString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectionString.js","sourceRoot":"","sources":["../src/connectionString.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,qEAAqE;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC,MAAM,OAAO,iCAAkC,SAAQ,KAAK;IAGxD,YAAY,cAAsB;QAC9B,KAAK,CAAC,2BAA2B,cAAc,wBAAwB,CAAC,CAAC;QACzE,IAAI,CAAC,IAAI,GAAG,mCAAmC,CAAC;QAChD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACzC,CAAC;CACJ;AAED,SAAS,yBAAyB,CAAC,KAAc;IAC7C,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAC;AAChE,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CACzC,MAAc,EACd,cAAsB,EACtB,EACI,WAAW,GAAG,oBAAoB,EAClC,UAAU,GAAG,mBAAmB,MACe,EAAE;IAErD,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC;QACrD,IAAI,CAAC;YACD,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAC5D,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACtB,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAAE,CAAC;gBACpC,MAAM,KAAK,CAAC;YAChB,CAAC;YAED,IAAI,OAAO,GAAG,WAAW,GAAG,CAAC,EAAE,CAAC;gBAC5B,MAAM,KAAK,CAAC,UAAU,CAAC,CAAC;YAC5B,CAAC;QACL,CAAC;IACL,CAAC;IAED,MAAM,IAAI,iCAAiC,CAAC,cAAc,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { createAtlasLocalClient, type AtlasLocalClientFactoryFn, type LibraryLoader } from "./atlasLocalClient.js";
2
+ export { AtlasLocalToolBase, type IAtlasLocalConfig, type IAtlasLocalSession, AtlasLocalToolMetadataDeploymentIdKey, } from "./atlasLocalTool.js";
3
+ export type { Deployment } from "@mongodb-js/atlas-local";
4
+ export * from "./tools/tools.js";
5
+ import type { IAtlasLocalSession } from "./atlasLocalTool.js";
6
+ import type { ToolClass } from "@mongodb-js/mcp-core";
7
+ export declare const AtlasLocalTools: ToolClass<IAtlasLocalSession>[];
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,KAAK,yBAAyB,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnH,OAAO,EACH,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,qCAAqC,GACxC,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,cAAc,kBAAkB,CAAC;AAEjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAO9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAKjD,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ export { createAtlasLocalClient } from "./atlasLocalClient.js";
2
+ export { AtlasLocalToolBase, AtlasLocalToolMetadataDeploymentIdKey, } from "./atlasLocalTool.js";
3
+ export * from "./tools/tools.js";
4
+ import { CreateDeploymentTool, ListDeploymentsTool, DeleteDeploymentTool, ConnectDeploymentTool, } from "./tools/tools.js";
5
+ export const AtlasLocalTools = [
6
+ CreateDeploymentTool,
7
+ ListDeploymentsTool,
8
+ DeleteDeploymentTool,
9
+ ConnectDeploymentTool,
10
+ ];
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAsD,MAAM,uBAAuB,CAAC;AACnH,OAAO,EACH,kBAAkB,EAGlB,qCAAqC,GACxC,MAAM,qBAAqB,CAAC;AAE7B,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EACH,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,GACxB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,CAAC,MAAM,eAAe,GAAoC;IAC5D,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;IACpB,qBAAqB;CACf,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { CallToolResult, ConnectionMetadata, OperationType } from "@mongodb-js/mcp-types";
2
+ import { AtlasLocalToolBase } from "../../atlasLocalTool.js";
3
+ import type { ToolArgs, ToolResult } from "@mongodb-js/mcp-core";
4
+ import type { Client } from "@mongodb-js/atlas-local";
5
+ import { z } from "zod";
6
+ declare const ConnectDeploymentOutputSchema: {
7
+ connected: z.ZodBoolean;
8
+ deploymentName: z.ZodString;
9
+ connectionId: z.ZodOptional<z.ZodString>;
10
+ };
11
+ export declare class ConnectDeploymentTool extends AtlasLocalToolBase {
12
+ static toolName: string;
13
+ description: string;
14
+ static operationType: OperationType;
15
+ argsShape: {
16
+ deploymentName: z.ZodString;
17
+ };
18
+ outputSchema: {
19
+ connected: z.ZodBoolean;
20
+ deploymentName: z.ZodString;
21
+ connectionId: z.ZodOptional<z.ZodString>;
22
+ };
23
+ protected executeWithAtlasLocalClient({ deploymentName }: ToolArgs<typeof this.argsShape>, { client }: {
24
+ client: Client;
25
+ }): Promise<ToolResult<typeof ConnectDeploymentOutputSchema> & Pick<CallToolResult, "_meta">>;
26
+ protected resolveTelemetryMetadata(args: ToolArgs<typeof this.argsShape>, { result }: {
27
+ result: CallToolResult;
28
+ }): Promise<ConnectionMetadata>;
29
+ }
30
+ export {};
31
+ //# sourceMappingURL=connectDeployment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectDeployment.d.ts","sourceRoot":"","sources":["../../../src/tools/connect/connectDeployment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,6BAA6B;;;;CAIlC,CAAC;AAEF,qBAAa,qBAAsB,SAAQ,kBAAkB;IACzD,MAAM,CAAC,QAAQ,SAAoC;IAC5C,WAAW,SAC+F;IACjH,MAAM,CAAC,aAAa,EAAE,aAAa,CAAa;IACzC,SAAS;;MAEd;IAEc,YAAY;;;;MAAiC;cAE7C,2BAA2B,CACvC,EAAE,cAAc,EAAE,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,EACnD,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAC/B,OAAO,CAAC,UAAU,CAAC,OAAO,6BAA6B,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;cAoDnE,wBAAwB,CAC7C,IAAI,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,EACrC,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,cAAc,CAAA;KAAE,GACvC,OAAO,CAAC,kBAAkB,CAAC;CAUjC"}
@@ -0,0 +1,80 @@
1
+ import { AtlasLocalToolBase } from "../../atlasLocalTool.js";
2
+ import { CommonArgs } from "@mongodb-js/mcp-core";
3
+ import { AtlasLocalDeploymentNotReadyError, waitForConnectionString } from "../../connectionString.js";
4
+ import { z } from "zod";
5
+ const ConnectDeploymentOutputSchema = {
6
+ connected: z.boolean(),
7
+ deploymentName: z.string(),
8
+ connectionId: z.string().optional(),
9
+ };
10
+ export class ConnectDeploymentTool extends AtlasLocalToolBase {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.description = "Connect to a MongoDB Atlas Local deployment and get back a connectionId to pass to the other MongoDB tools";
14
+ this.argsShape = {
15
+ deploymentName: CommonArgs.asciiOnlyString().describe("Name of the deployment to connect to"),
16
+ };
17
+ this.outputSchema = ConnectDeploymentOutputSchema;
18
+ }
19
+ async executeWithAtlasLocalClient({ deploymentName }, { client }) {
20
+ let connectionString;
21
+ try {
22
+ // Get the connection string for the deployment. atlas-local-create-deployment can return
23
+ // before Docker publishes port bindings, so retry briefly to usually avoid surfacing that
24
+ // race condition to the caller.
25
+ connectionString = await waitForConnectionString(client, deploymentName);
26
+ }
27
+ catch (error) {
28
+ if (error instanceof AtlasLocalDeploymentNotReadyError) {
29
+ return {
30
+ content: [
31
+ {
32
+ type: "text",
33
+ text: `Atlas Local deployment "${deploymentName}" is still starting up. Wait a few seconds and call atlas-local-connect-deployment again with the same deployment name.`,
34
+ },
35
+ ],
36
+ structuredContent: {
37
+ connected: false,
38
+ deploymentName,
39
+ },
40
+ isError: true,
41
+ };
42
+ }
43
+ throw error;
44
+ }
45
+ // Establish the connection through the connection registry so it can be
46
+ // referenced by its connectionId from the other MongoDB tools.
47
+ const entry = await this.session.connectionRegistry.connect({
48
+ settings: { connectionString },
49
+ name: deploymentName,
50
+ clientName: this.session.mcpClient?.name,
51
+ });
52
+ return {
53
+ content: [
54
+ {
55
+ type: "text",
56
+ text: `Successfully connected to Atlas Local deployment "${deploymentName}". Your connectionId is "${entry.connectionId}" — pass it as the connectionId argument to all MongoDB tool calls that should run against this deployment.`,
57
+ },
58
+ ],
59
+ structuredContent: {
60
+ connected: true,
61
+ deploymentName,
62
+ connectionId: entry.connectionId,
63
+ },
64
+ _meta: {
65
+ ...(await this.lookupTelemetryMetadata(client, deploymentName)),
66
+ },
67
+ };
68
+ }
69
+ async resolveTelemetryMetadata(args, { result }) {
70
+ const connectionId = result.structuredContent?.connectionId;
71
+ return {
72
+ ...(await super.resolveTelemetryMetadata(args, { result })),
73
+ ...(connectionId && { connection_id: connectionId }),
74
+ ...this.getConnectionInfoMetadata(connectionId ? (await this.session.connectionRegistry.peek(connectionId))?.state : undefined),
75
+ };
76
+ }
77
+ }
78
+ ConnectDeploymentTool.toolName = "atlas-local-connect-deployment";
79
+ ConnectDeploymentTool.operationType = "connect";
80
+ //# sourceMappingURL=connectDeployment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectDeployment.js","sourceRoot":"","sources":["../../../src/tools/connect/connectDeployment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,iCAAiC,EAAE,uBAAuB,EAAE,MAAM,2BAA2B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,EAAE,cAAc;YACpB,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI;SAC3C,CAAC,CAAC;QAEH,OAAO;YACH,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,qDAAqD,cAAc,4BAA4B,KAAK,CAAC,YAAY,6GAA6G;iBACvO;aACJ;YACD,iBAAiB,EAAE;gBACf,SAAS,EAAE,IAAI;gBACf,cAAc;gBACd,YAAY,EAAE,KAAK,CAAC,YAAY;aACnC;YACD,KAAK,EAAE;gBACH,GAAG,CAAC,MAAM,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;aAClE;SACJ,CAAC;IACN,CAAC;IAEkB,KAAK,CAAC,wBAAwB,CAC7C,IAAqC,EACrC,EAAE,MAAM,EAA8B;QAEtC,MAAM,YAAY,GAAI,MAAM,CAAC,iBAA2D,EAAE,YAAY,CAAC;QACvG,OAAO;YACH,GAAG,CAAC,MAAM,KAAK,CAAC,wBAAwB,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;YAC3D,GAAG,CAAC,YAAY,IAAI,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;YACpD,GAAG,IAAI,CAAC,yBAAyB,CAC7B,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,SAAS,CAC/F;SACJ,CAAC;IACN,CAAC;;AA7EM,8BAAQ,GAAG,gCAAgC,AAAnC,CAAoC;AAG5C,mCAAa,GAAkB,SAAS,AAA3B,CAA4B"}
@@ -0,0 +1,34 @@
1
+ import type { CallToolResult, OperationType } from "@mongodb-js/mcp-types";
2
+ import { AtlasLocalToolBase } from "../../atlasLocalTool.js";
3
+ import type { ToolArgs, ToolResult } from "@mongodb-js/mcp-core";
4
+ import type { Client } from "@mongodb-js/atlas-local";
5
+ import { z } from "zod";
6
+ declare const CreateDeploymentOutputSchema: {
7
+ deploymentName: z.ZodString;
8
+ containerId: z.ZodString;
9
+ loadSampleData: z.ZodBoolean;
10
+ imageTag: z.ZodString;
11
+ };
12
+ export type CreateDeploymentOutput = z.infer<z.ZodObject<typeof CreateDeploymentOutputSchema>>;
13
+ export declare class CreateDeploymentTool extends AtlasLocalToolBase {
14
+ static toolName: string;
15
+ description: string;
16
+ static operationType: OperationType;
17
+ argsShape: {
18
+ deploymentName: z.ZodOptional<z.ZodString>;
19
+ loadSampleData: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
20
+ imageTag: z.ZodDefault<z.ZodOptional<z.ZodString>>;
21
+ };
22
+ outputSchema: {
23
+ deploymentName: z.ZodString;
24
+ containerId: z.ZodString;
25
+ loadSampleData: z.ZodBoolean;
26
+ imageTag: z.ZodString;
27
+ };
28
+ protected executeWithAtlasLocalClient({ deploymentName, loadSampleData, imageTag }: ToolArgs<typeof this.argsShape>, { client }: {
29
+ client: Client;
30
+ }): Promise<ToolResult<typeof CreateDeploymentOutputSchema> & Pick<CallToolResult, "_meta">>;
31
+ private buildStructuredContent;
32
+ }
33
+ export {};
34
+ //# sourceMappingURL=createDeployment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDeployment.d.ts","sourceRoot":"","sources":["../../../src/tools/create/createDeployment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAuC,MAAM,yBAAyB,CAAC;AAE3F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,4BAA4B;;;;;CAKjC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAAC;AAE/F,qBAAa,oBAAqB,SAAQ,kBAAkB;IACxD,MAAM,CAAC,QAAQ,SAAmC;IAC3C,WAAW,SACiP;IACnQ,MAAM,CAAC,aAAa,EAAE,aAAa,CAAY;IACxC,SAAS;;;;MAQd;IAEc,YAAY;;;;;MAAgC;cAE5C,2BAA2B,CACvC,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,EAC7E,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAC/B,OAAO,CAAC,UAAU,CAAC,OAAO,4BAA4B,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAuD3F,OAAO,CAAC,sBAAsB;CAWjC"}
@@ -0,0 +1,89 @@
1
+ import { AtlasLocalToolBase } from "../../atlasLocalTool.js";
2
+ import { CommonArgs } from "@mongodb-js/mcp-core";
3
+ import { AtlasLocalDeploymentNotReadyError, waitForConnectionString } from "../../connectionString.js";
4
+ import { z } from "zod";
5
+ const CreateDeploymentOutputSchema = {
6
+ deploymentName: z.string(),
7
+ containerId: z.string(),
8
+ loadSampleData: z.boolean(),
9
+ imageTag: z.string(),
10
+ };
11
+ export class CreateDeploymentTool extends AtlasLocalToolBase {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.description = "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";
15
+ this.argsShape = {
16
+ deploymentName: CommonArgs.asciiOnlyString().describe("Name of the deployment to create").optional(),
17
+ loadSampleData: z.boolean().describe("Load sample data into the deployment").optional().default(false),
18
+ imageTag: z
19
+ .string()
20
+ .describe("Atlas Local image tag: 'preview', 'latest', or a semver (e.g. '8.0.0'). Default: 'preview'.")
21
+ .optional()
22
+ .default("preview"),
23
+ };
24
+ this.outputSchema = CreateDeploymentOutputSchema;
25
+ }
26
+ async executeWithAtlasLocalClient({ deploymentName, loadSampleData, imageTag }, { client }) {
27
+ const deploymentOptions = {
28
+ name: deploymentName,
29
+ creationSource: {
30
+ type: "MCPServer",
31
+ source: "MCPServer",
32
+ },
33
+ loadSampleData,
34
+ imageTag,
35
+ ...(this.session.config.voyageApiKey ? { voyageApiKey: this.session.config.voyageApiKey } : {}),
36
+ doNotTrack: !this.telemetry.isTelemetryEnabled(),
37
+ };
38
+ // Create the deployment
39
+ const deployment = await client.createDeployment(deploymentOptions);
40
+ // createDeployment returns once the container is healthy, but Docker may
41
+ // not have published port bindings yet. Block until connect can succeed.
42
+ const resolvedDeploymentName = deployment.name ?? deploymentName;
43
+ let stillStarting = false;
44
+ if (resolvedDeploymentName) {
45
+ try {
46
+ await waitForConnectionString(client, resolvedDeploymentName);
47
+ }
48
+ catch (error) {
49
+ if (error instanceof AtlasLocalDeploymentNotReadyError) {
50
+ stillStarting = true;
51
+ }
52
+ else {
53
+ throw error;
54
+ }
55
+ }
56
+ }
57
+ const structuredContent = this.buildStructuredContent(deployment, {
58
+ deploymentName: resolvedDeploymentName ?? "",
59
+ loadSampleData,
60
+ imageTag,
61
+ });
62
+ const startingNote = stillStarting
63
+ ? " The deployment is still initializing; if atlas-local-connect-deployment fails, wait a few seconds and try connecting again."
64
+ : "";
65
+ return {
66
+ content: [
67
+ {
68
+ type: "text",
69
+ text: `Deployment with container ID "${deployment.containerId}" and name "${deployment.name}" created (imageTag: ${imageTag}).${startingNote}`,
70
+ },
71
+ ],
72
+ structuredContent,
73
+ _meta: {
74
+ ...(await this.lookupTelemetryMetadata(client, deployment.containerId)),
75
+ },
76
+ };
77
+ }
78
+ buildStructuredContent(deployment, args) {
79
+ return {
80
+ deploymentName: args.deploymentName,
81
+ containerId: deployment.containerId,
82
+ loadSampleData: args.loadSampleData,
83
+ imageTag: args.imageTag,
84
+ };
85
+ }
86
+ }
87
+ CreateDeploymentTool.toolName = "atlas-local-create-deployment";
88
+ CreateDeploymentTool.operationType = "create";
89
+ //# sourceMappingURL=createDeployment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDeployment.js","sourceRoot":"","sources":["../../../src/tools/create/createDeployment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,iCAAiC,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACvG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,4BAA4B,GAAG;IACjC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;IAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC;AAIF,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IAA5D;;QAEW,gBAAW,GACd,8PAA8P,CAAC;QAE5P,cAAS,GAAG;YACf,cAAc,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAC,QAAQ,EAAE;YACpG,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;YACtG,QAAQ,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,QAAQ,CAAC,6FAA6F,CAAC;iBACvG,QAAQ,EAAE;iBACV,OAAO,CAAC,SAAS,CAAC;SAC1B,CAAC;QAEc,iBAAY,GAAG,4BAA4B,CAAC;IAuEhE,CAAC;IArEa,KAAK,CAAC,2BAA2B,CACvC,EAAE,cAAc,EAAE,cAAc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,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,iCAAiC,UAAU,CAAC,WAAW,eAAe,UAAU,CAAC,IAAI,wBAAwB,QAAQ,KAAK,YAAY,EAAE;iBACjJ;aACJ;YACD,iBAAiB;YACjB,KAAK,EAAE;gBACH,GAAG,CAAC,MAAM,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;aAC1E;SACJ,CAAC;IACN,CAAC;IAEO,sBAAsB,CAC1B,UAAsB,EACtB,IAA2E;QAE3E,OAAO;YACH,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ;SAC1B,CAAC;IACN,CAAC;;AApFM,6BAAQ,GAAG,+BAA+B,AAAlC,CAAmC;AAG3C,kCAAa,GAAkB,QAAQ,AAA1B,CAA2B"}
@@ -0,0 +1,22 @@
1
+ import type { CallToolResult } from "@mongodb-js/mcp-types";
2
+ import { AtlasLocalToolBase } from "../../atlasLocalTool.js";
3
+ import type { ToolArgs } from "@mongodb-js/mcp-core";
4
+ import type { OperationType } from "@mongodb-js/mcp-types";
5
+ import type { Client } from "@mongodb-js/atlas-local";
6
+ import { z } from "zod";
7
+ export declare class DeleteDeploymentTool extends AtlasLocalToolBase {
8
+ static toolName: string;
9
+ description: string;
10
+ static operationType: OperationType;
11
+ argsShape: {
12
+ deploymentName: z.ZodString;
13
+ };
14
+ outputSchema: {
15
+ deleted: z.ZodBoolean;
16
+ deploymentName: z.ZodString;
17
+ };
18
+ protected executeWithAtlasLocalClient({ deploymentName }: ToolArgs<typeof this.argsShape>, { client }: {
19
+ client: Client;
20
+ }): Promise<CallToolResult>;
21
+ }
22
+ //# sourceMappingURL=deleteDeployment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteDeployment.d.ts","sourceRoot":"","sources":["../../../src/tools/delete/deleteDeployment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,qBAAa,oBAAqB,SAAQ,kBAAkB;IACxD,MAAM,CAAC,QAAQ,SAAmC;IAC3C,WAAW,SAA6C;IAC/D,MAAM,CAAC,aAAa,EAAE,aAAa,CAAY;IACxC,SAAS;;MAEd;IACc,YAAY;;;MAAgC;cAE5C,2BAA2B,CACvC,EAAE,cAAc,EAAE,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,EACnD,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAC/B,OAAO,CAAC,cAAc,CAAC;CAoB7B"}
@@ -0,0 +1,38 @@
1
+ import { AtlasLocalToolBase } from "../../atlasLocalTool.js";
2
+ import { CommonArgs } from "@mongodb-js/mcp-core";
3
+ import { z } from "zod";
4
+ const DeleteDeploymentOutputSchema = {
5
+ deleted: z.boolean(),
6
+ deploymentName: z.string(),
7
+ };
8
+ export class DeleteDeploymentTool extends AtlasLocalToolBase {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.description = "Delete a MongoDB Atlas local deployment";
12
+ this.argsShape = {
13
+ deploymentName: CommonArgs.asciiOnlyString().describe("Name of the deployment to delete"),
14
+ };
15
+ this.outputSchema = DeleteDeploymentOutputSchema;
16
+ }
17
+ async executeWithAtlasLocalClient({ deploymentName }, { client }) {
18
+ // Lookup telemetry metadata
19
+ // We need to lookup the telemetry metadata before deleting the deployment
20
+ // to ensure that the deployment ID is set in the result metadata
21
+ const telemetryMetadata = await this.lookupTelemetryMetadata(client, deploymentName);
22
+ // Delete the deployment
23
+ await client.deleteDeployment(deploymentName);
24
+ return {
25
+ content: [{ type: "text", text: `Deployment "${deploymentName}" deleted successfully.` }],
26
+ structuredContent: {
27
+ deleted: true,
28
+ deploymentName,
29
+ },
30
+ _meta: {
31
+ ...telemetryMetadata,
32
+ },
33
+ };
34
+ }
35
+ }
36
+ DeleteDeploymentTool.toolName = "atlas-local-delete-deployment";
37
+ DeleteDeploymentTool.operationType = "delete";
38
+ //# sourceMappingURL=deleteDeployment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteDeployment.js","sourceRoot":"","sources":["../../../src/tools/delete/deleteDeployment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAI7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,4BAA4B,GAAG;IACjC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;CAC7B,CAAC;AAEF,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IAA5D;;QAEW,gBAAW,GAAG,yCAAyC,CAAC;QAExD,cAAS,GAAG;YACf,cAAc,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;SAC5F,CAAC;QACc,iBAAY,GAAG,4BAA4B,CAAC;IAyBhE,CAAC;IAvBa,KAAK,CAAC,2BAA2B,CACvC,EAAE,cAAc,EAAmC,EACnD,EAAE,MAAM,EAAsB;QAE9B,4BAA4B;QAC5B,0EAA0E;QAC1E,iEAAiE;QACjE,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QAErF,wBAAwB;QACxB,MAAM,MAAM,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;QAE9C,OAAO;YACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,cAAc,yBAAyB,EAAE,CAAC;YACzF,iBAAiB,EAAE;gBACf,OAAO,EAAE,IAAI;gBACb,cAAc;aACjB;YACD,KAAK,EAAE;gBACH,GAAG,iBAAiB;aACvB;SACJ,CAAC;IACN,CAAC;;AA9BM,6BAAQ,GAAG,+BAA+B,AAAlC,CAAmC;AAE3C,kCAAa,GAAkB,QAAQ,AAA1B,CAA2B"}
@@ -0,0 +1,25 @@
1
+ import type { CallToolResult } from "@mongodb-js/mcp-types";
2
+ import { AtlasLocalToolBase } from "../../atlasLocalTool.js";
3
+ import type { ToolArgs } from "@mongodb-js/mcp-core";
4
+ import type { OperationType } from "@mongodb-js/mcp-types";
5
+ import type { Client } from "@mongodb-js/atlas-local";
6
+ import { z } from "zod";
7
+ export declare class ListDeploymentsTool extends AtlasLocalToolBase {
8
+ static toolName: string;
9
+ description: string;
10
+ static operationType: OperationType;
11
+ argsShape: {};
12
+ outputSchema: {
13
+ count: z.ZodNumber;
14
+ deployments: z.ZodArray<z.ZodObject<{
15
+ name: z.ZodOptional<z.ZodString>;
16
+ state: z.ZodString;
17
+ mongodbVersion: z.ZodString;
18
+ }, z.core.$strip>>;
19
+ };
20
+ protected executeWithAtlasLocalClient(_args: ToolArgs<typeof this.argsShape>, { client }: {
21
+ client: Client;
22
+ }): Promise<CallToolResult>;
23
+ private formatDeploymentsTable;
24
+ }
25
+ //# sourceMappingURL=listDeployments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listDeployments.d.ts","sourceRoot":"","sources":["../../../src/tools/read/listDeployments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,qBAAa,mBAAoB,SAAQ,kBAAkB;IACvD,MAAM,CAAC,QAAQ,SAAkC;IAC1C,WAAW,SAA0C;IAC5D,MAAM,CAAC,aAAa,EAAE,aAAa,CAAU;IACtC,SAAS,KAAM;IACN,YAAY;;;;;;;MAA+B;cAE3C,2BAA2B,CACvC,KAAK,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,EACtC,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAC/B,OAAO,CAAC,cAAc,CAAC;IAQ1B,OAAO,CAAC,sBAAsB;CA8BjC"}
@@ -0,0 +1,56 @@
1
+ import { AtlasLocalToolBase } from "../../atlasLocalTool.js";
2
+ import { formatUntrustedData } from "@mongodb-js/mcp-core";
3
+ import { z } from "zod";
4
+ const ListDeploymentsOutputSchema = {
5
+ count: z.number(),
6
+ deployments: z.array(z.object({
7
+ name: z.string().optional(),
8
+ state: z.string(),
9
+ mongodbVersion: z.string(),
10
+ })),
11
+ };
12
+ export class ListDeploymentsTool extends AtlasLocalToolBase {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.description = "List MongoDB Atlas local deployments";
16
+ this.argsShape = {};
17
+ this.outputSchema = ListDeploymentsOutputSchema;
18
+ }
19
+ async executeWithAtlasLocalClient(_args, { client }) {
20
+ // List the deployments
21
+ const deployments = await client.listDeployments();
22
+ // Format the deployments
23
+ return this.formatDeploymentsTable(deployments);
24
+ }
25
+ formatDeploymentsTable(deployments) {
26
+ // Check if deployments are absent
27
+ if (!deployments?.length) {
28
+ return {
29
+ content: [{ type: "text", text: "No deployments found." }],
30
+ structuredContent: {
31
+ count: 0,
32
+ deployments: [],
33
+ },
34
+ };
35
+ }
36
+ // Filter out the fields we want to return to the user
37
+ // We don't want to return the entire deployment object because it contains too much data
38
+ const deploymentsJson = deployments.map((deployment) => {
39
+ return {
40
+ name: deployment.name,
41
+ state: deployment.state,
42
+ mongodbVersion: deployment.mongodbVersion,
43
+ };
44
+ });
45
+ return {
46
+ content: formatUntrustedData(`Found ${deployments.length} deployments`, JSON.stringify(deploymentsJson)),
47
+ structuredContent: {
48
+ count: deployments.length,
49
+ deployments: deploymentsJson,
50
+ },
51
+ };
52
+ }
53
+ }
54
+ ListDeploymentsTool.toolName = "atlas-local-list-deployments";
55
+ ListDeploymentsTool.operationType = "read";
56
+ //# sourceMappingURL=listDeployments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listDeployments.js","sourceRoot":"","sources":["../../../src/tools/read/listDeployments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,2BAA2B,GAAG;IAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,KAAK,CAChB,CAAC,CAAC,MAAM,CAAC;QACL,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;KAC7B,CAAC,CACL;CACJ,CAAC;AAEF,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB;IAA3D;;QAEW,gBAAW,GAAG,sCAAsC,CAAC;QAErD,cAAS,GAAG,EAAE,CAAC;QACN,iBAAY,GAAG,2BAA2B,CAAC;IA2C/D,CAAC;IAzCa,KAAK,CAAC,2BAA2B,CACvC,KAAsC,EACtC,EAAE,MAAM,EAAsB;QAE9B,uBAAuB;QACvB,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,eAAe,EAAE,CAAC;QAEnD,yBAAyB;QACzB,OAAO,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;IAEO,sBAAsB,CAAC,WAAyB;QACpD,kCAAkC;QAClC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;YACvB,OAAO;gBACH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;gBAC1D,iBAAiB,EAAE;oBACf,KAAK,EAAE,CAAC;oBACR,WAAW,EAAE,EAAE;iBAClB;aACJ,CAAC;QACN,CAAC;QAED,sDAAsD;QACtD,yFAAyF;QACzF,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;YACnD,OAAO;gBACH,IAAI,EAAE,UAAU,CAAC,IAAI;gBACrB,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,cAAc,EAAE,UAAU,CAAC,cAAc;aAC5C,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,OAAO;YACH,OAAO,EAAE,mBAAmB,CAAC,SAAS,WAAW,CAAC,MAAM,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;YACxG,iBAAiB,EAAE;gBACf,KAAK,EAAE,WAAW,CAAC,MAAM;gBACzB,WAAW,EAAE,eAAe;aAC/B;SACJ,CAAC;IACN,CAAC;;AA9CM,4BAAQ,GAAG,8BAA8B,AAAjC,CAAkC;AAE1C,iCAAa,GAAkB,MAAM,AAAxB,CAAyB"}
@@ -0,0 +1,5 @@
1
+ export { CreateDeploymentTool } from "./create/createDeployment.js";
2
+ export { ListDeploymentsTool } from "./read/listDeployments.js";
3
+ export { DeleteDeploymentTool } from "./delete/deleteDeployment.js";
4
+ export { ConnectDeploymentTool } from "./connect/connectDeployment.js";
5
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/tools/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { CreateDeploymentTool } from "./create/createDeployment.js";
2
+ export { ListDeploymentsTool } from "./read/listDeployments.js";
3
+ export { DeleteDeploymentTool } from "./delete/deleteDeployment.js";
4
+ export { ConnectDeploymentTool } from "./connect/connectDeployment.js";
5
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/tools/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@mongodb-js/mcp-tools-atlas-local",
3
+ "version": "3.0.0-prerelease.1",
4
+ "type": "module",
5
+ "description": "Atlas Local tools and client for MongoDB MCP server",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "default": "./dist/index.js"
10
+ }
11
+ },
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsc --build tsconfig.build.json",
19
+ "test": "vitest --run",
20
+ "check": "tsc --build tsconfig.build.json --noEmit"
21
+ },
22
+ "dependencies": {
23
+ "@mongodb-js/atlas-local": "^1.3.0",
24
+ "@mongodb-js/mcp-core": "workspace:*",
25
+ "@mongodb-js/mcp-tools-mongodb": "workspace:*",
26
+ "zod": "^4.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "@mongodb-js/mcp-types": "workspace:*",
30
+ "@types/node": "^25.6.0",
31
+ "typescript": "^5.9.2",
32
+ "vitest": "^4.1.5"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ }
37
+ }