mongodb-mcp-server 0.3.0 → 1.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.
- package/README.md +137 -63
- package/dist/cjs/common/atlas/accessListUtils.d.ts +2 -1
- package/dist/cjs/common/atlas/accessListUtils.d.ts.map +1 -1
- package/dist/cjs/common/atlas/accessListUtils.js +4 -1
- package/dist/cjs/common/atlas/accessListUtils.js.map +1 -1
- package/dist/cjs/common/config.d.ts +11 -0
- package/dist/cjs/common/config.d.ts.map +1 -1
- package/dist/cjs/common/config.js +115 -4
- package/dist/cjs/common/config.js.map +1 -1
- package/dist/cjs/common/connectionErrorHandler.d.ts +18 -0
- package/dist/cjs/common/connectionErrorHandler.d.ts.map +1 -0
- package/dist/cjs/common/connectionErrorHandler.js +70 -0
- package/dist/cjs/common/connectionErrorHandler.js.map +1 -0
- package/dist/cjs/common/connectionManager.d.ts +36 -10
- package/dist/cjs/common/connectionManager.d.ts.map +1 -1
- package/dist/cjs/common/connectionManager.js +59 -45
- package/dist/cjs/common/connectionManager.js.map +1 -1
- package/dist/cjs/common/errors.d.ts +5 -4
- package/dist/cjs/common/errors.d.ts.map +1 -1
- package/dist/cjs/common/errors.js +1 -0
- package/dist/cjs/common/errors.js.map +1 -1
- package/dist/cjs/common/exportsManager.d.ts +7 -6
- package/dist/cjs/common/exportsManager.d.ts.map +1 -1
- package/dist/cjs/common/exportsManager.js +22 -25
- package/dist/cjs/common/exportsManager.js.map +1 -1
- package/dist/cjs/common/keychain.d.ts +22 -0
- package/dist/cjs/common/keychain.d.ts.map +1 -0
- package/dist/cjs/common/keychain.js +36 -0
- package/dist/cjs/common/keychain.js.map +1 -0
- package/dist/cjs/common/logger.d.ts +11 -3
- package/dist/cjs/common/logger.d.ts.map +1 -1
- package/dist/cjs/common/logger.js +20 -11
- package/dist/cjs/common/logger.js.map +1 -1
- package/dist/cjs/common/packageInfo.js +1 -1
- package/dist/cjs/common/packageInfo.js.map +1 -1
- package/dist/cjs/common/session.d.ts +4 -1
- package/dist/cjs/common/session.d.ts.map +1 -1
- package/dist/cjs/common/session.js +6 -5
- package/dist/cjs/common/session.js.map +1 -1
- package/dist/cjs/elicitation.d.ts +25 -0
- package/dist/cjs/elicitation.d.ts.map +1 -0
- package/dist/cjs/elicitation.js +50 -0
- package/dist/cjs/elicitation.js.map +1 -0
- package/dist/cjs/helpers/connectionOptions.js +3 -6
- package/dist/cjs/helpers/connectionOptions.js.map +1 -1
- package/dist/cjs/index.js +8 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib.d.ts +8 -4
- package/dist/cjs/lib.d.ts.map +1 -1
- package/dist/cjs/lib.js +12 -5
- package/dist/cjs/lib.js.map +1 -1
- package/dist/cjs/resources/common/exportedData.d.ts.map +1 -1
- package/dist/cjs/resources/common/exportedData.js +12 -3
- package/dist/cjs/resources/common/exportedData.js.map +1 -1
- package/dist/cjs/server.d.ts +7 -1
- package/dist/cjs/server.d.ts.map +1 -1
- package/dist/cjs/server.js +27 -6
- package/dist/cjs/server.js.map +1 -1
- package/dist/cjs/telemetry/eventCache.d.ts +11 -4
- package/dist/cjs/telemetry/eventCache.d.ts.map +1 -1
- package/dist/cjs/telemetry/eventCache.js +13 -6
- package/dist/cjs/telemetry/eventCache.js.map +1 -1
- package/dist/cjs/telemetry/telemetry.d.ts +9 -2
- package/dist/cjs/telemetry/telemetry.d.ts.map +1 -1
- package/dist/cjs/telemetry/telemetry.js +79 -42
- package/dist/cjs/telemetry/telemetry.js.map +1 -1
- package/dist/cjs/telemetry/types.d.ts +49 -0
- package/dist/cjs/telemetry/types.d.ts.map +1 -1
- package/dist/cjs/tools/args.d.ts +22 -0
- package/dist/cjs/tools/args.d.ts.map +1 -0
- package/dist/cjs/tools/args.js +50 -0
- package/dist/cjs/tools/args.js.map +1 -0
- package/dist/cjs/tools/atlas/atlasTool.d.ts +1 -2
- package/dist/cjs/tools/atlas/atlasTool.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/atlasTool.js.map +1 -1
- package/dist/cjs/tools/atlas/connect/connectCluster.d.ts +7 -4
- package/dist/cjs/tools/atlas/connect/connectCluster.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/connect/connectCluster.js +57 -31
- package/dist/cjs/tools/atlas/connect/connectCluster.js.map +1 -1
- package/dist/cjs/tools/atlas/create/createAccessList.d.ts +9 -1
- package/dist/cjs/tools/atlas/create/createAccessList.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/create/createAccessList.js +30 -13
- package/dist/cjs/tools/atlas/create/createAccessList.js.map +1 -1
- package/dist/cjs/tools/atlas/create/createDBUser.d.ts +21 -1
- package/dist/cjs/tools/atlas/create/createDBUser.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/create/createDBUser.js +38 -22
- package/dist/cjs/tools/atlas/create/createDBUser.js.map +1 -1
- package/dist/cjs/tools/atlas/create/createFreeCluster.d.ts +4 -5
- package/dist/cjs/tools/atlas/create/createFreeCluster.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/create/createFreeCluster.js +4 -4
- package/dist/cjs/tools/atlas/create/createFreeCluster.js.map +1 -1
- package/dist/cjs/tools/atlas/create/createProject.d.ts +7 -4
- package/dist/cjs/tools/atlas/create/createProject.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/create/createProject.js +7 -4
- package/dist/cjs/tools/atlas/create/createProject.js.map +1 -1
- package/dist/cjs/tools/atlas/read/inspectAccessList.d.ts +5 -3
- package/dist/cjs/tools/atlas/read/inspectAccessList.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/read/inspectAccessList.js +7 -4
- package/dist/cjs/tools/atlas/read/inspectAccessList.js.map +1 -1
- package/dist/cjs/tools/atlas/read/inspectCluster.d.ts +7 -4
- package/dist/cjs/tools/atlas/read/inspectCluster.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/read/inspectCluster.js +8 -5
- package/dist/cjs/tools/atlas/read/inspectCluster.js.map +1 -1
- package/dist/cjs/tools/atlas/read/listAlerts.d.ts +5 -3
- package/dist/cjs/tools/atlas/read/listAlerts.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/read/listAlerts.js +7 -4
- package/dist/cjs/tools/atlas/read/listAlerts.js.map +1 -1
- package/dist/cjs/tools/atlas/read/listClusters.d.ts +4 -2
- package/dist/cjs/tools/atlas/read/listClusters.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/read/listClusters.js +13 -10
- package/dist/cjs/tools/atlas/read/listClusters.js.map +1 -1
- package/dist/cjs/tools/atlas/read/listDBUsers.d.ts +4 -2
- package/dist/cjs/tools/atlas/read/listDBUsers.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/read/listDBUsers.js +6 -3
- package/dist/cjs/tools/atlas/read/listDBUsers.js.map +1 -1
- package/dist/cjs/tools/atlas/read/listProjects.d.ts +4 -2
- package/dist/cjs/tools/atlas/read/listProjects.d.ts.map +1 -1
- package/dist/cjs/tools/atlas/read/listProjects.js +7 -4
- package/dist/cjs/tools/atlas/read/listProjects.js.map +1 -1
- package/dist/cjs/tools/mongodb/connect/connect.d.ts +2 -5
- package/dist/cjs/tools/mongodb/connect/connect.d.ts.map +1 -1
- package/dist/cjs/tools/mongodb/connect/connect.js +2 -2
- package/dist/cjs/tools/mongodb/connect/connect.js.map +1 -1
- package/dist/cjs/tools/mongodb/delete/deleteMany.d.ts +1 -0
- package/dist/cjs/tools/mongodb/delete/deleteMany.d.ts.map +1 -1
- package/dist/cjs/tools/mongodb/delete/deleteMany.js +10 -0
- package/dist/cjs/tools/mongodb/delete/deleteMany.js.map +1 -1
- package/dist/cjs/tools/mongodb/delete/dropCollection.d.ts +1 -0
- package/dist/cjs/tools/mongodb/delete/dropCollection.d.ts.map +1 -1
- package/dist/cjs/tools/mongodb/delete/dropCollection.js +5 -0
- package/dist/cjs/tools/mongodb/delete/dropCollection.js.map +1 -1
- package/dist/cjs/tools/mongodb/delete/dropDatabase.d.ts +1 -0
- package/dist/cjs/tools/mongodb/delete/dropDatabase.d.ts.map +1 -1
- package/dist/cjs/tools/mongodb/delete/dropDatabase.js +5 -0
- package/dist/cjs/tools/mongodb/delete/dropDatabase.js.map +1 -1
- package/dist/cjs/tools/mongodb/metadata/logs.d.ts +1 -1
- package/dist/cjs/tools/mongodb/metadata/logs.d.ts.map +1 -1
- package/dist/cjs/tools/mongodb/metadata/logs.js +9 -11
- package/dist/cjs/tools/mongodb/metadata/logs.js.map +1 -1
- package/dist/cjs/tools/mongodb/mongodbTool.d.ts.map +1 -1
- package/dist/cjs/tools/mongodb/mongodbTool.js +11 -52
- package/dist/cjs/tools/mongodb/mongodbTool.js.map +1 -1
- package/dist/cjs/tools/mongodb/read/aggregate.d.ts +1 -0
- package/dist/cjs/tools/mongodb/read/aggregate.d.ts.map +1 -1
- package/dist/cjs/tools/mongodb/read/aggregate.js +21 -0
- package/dist/cjs/tools/mongodb/read/aggregate.js.map +1 -1
- package/dist/cjs/tools/mongodb/read/export.js +1 -1
- package/dist/cjs/tools/mongodb/read/export.js.map +1 -1
- package/dist/cjs/tools/tool.d.ts +20 -5
- package/dist/cjs/tools/tool.d.ts.map +1 -1
- package/dist/cjs/tools/tool.js +43 -6
- package/dist/cjs/tools/tool.js.map +1 -1
- package/dist/cjs/transports/base.d.ts +17 -5
- package/dist/cjs/transports/base.d.ts.map +1 -1
- package/dist/cjs/transports/base.js +24 -9
- package/dist/cjs/transports/base.js.map +1 -1
- package/dist/cjs/transports/stdio.d.ts +2 -4
- package/dist/cjs/transports/stdio.d.ts.map +1 -1
- package/dist/cjs/transports/stdio.js +6 -6
- package/dist/cjs/transports/stdio.js.map +1 -1
- package/dist/cjs/transports/streamableHttp.d.ts +3 -4
- package/dist/cjs/transports/streamableHttp.d.ts.map +1 -1
- package/dist/cjs/transports/streamableHttp.js +22 -9
- package/dist/cjs/transports/streamableHttp.js.map +1 -1
- package/dist/esm/common/atlas/accessListUtils.d.ts +2 -1
- package/dist/esm/common/atlas/accessListUtils.d.ts.map +1 -1
- package/dist/esm/common/atlas/accessListUtils.js +4 -1
- package/dist/esm/common/atlas/accessListUtils.js.map +1 -1
- package/dist/esm/common/config.d.ts +11 -0
- package/dist/esm/common/config.d.ts.map +1 -1
- package/dist/esm/common/config.js +112 -4
- package/dist/esm/common/config.js.map +1 -1
- package/dist/esm/common/connectionErrorHandler.d.ts +18 -0
- package/dist/esm/common/connectionErrorHandler.d.ts.map +1 -0
- package/dist/esm/common/connectionErrorHandler.js +66 -0
- package/dist/esm/common/connectionErrorHandler.js.map +1 -0
- package/dist/esm/common/connectionManager.d.ts +36 -10
- package/dist/esm/common/connectionManager.d.ts.map +1 -1
- package/dist/esm/common/connectionManager.js +54 -39
- package/dist/esm/common/connectionManager.js.map +1 -1
- package/dist/esm/common/errors.d.ts +5 -4
- package/dist/esm/common/errors.d.ts.map +1 -1
- package/dist/esm/common/errors.js +1 -0
- package/dist/esm/common/errors.js.map +1 -1
- package/dist/esm/common/exportsManager.d.ts +7 -6
- package/dist/esm/common/exportsManager.d.ts.map +1 -1
- package/dist/esm/common/exportsManager.js +21 -24
- package/dist/esm/common/exportsManager.js.map +1 -1
- package/dist/esm/common/keychain.d.ts +22 -0
- package/dist/esm/common/keychain.d.ts.map +1 -0
- package/dist/esm/common/keychain.js +31 -0
- package/dist/esm/common/keychain.js.map +1 -0
- package/dist/esm/common/logger.d.ts +11 -3
- package/dist/esm/common/logger.d.ts.map +1 -1
- package/dist/esm/common/logger.js +20 -11
- package/dist/esm/common/logger.js.map +1 -1
- package/dist/esm/common/packageInfo.js +1 -1
- package/dist/esm/common/packageInfo.js.map +1 -1
- package/dist/esm/common/session.d.ts +4 -1
- package/dist/esm/common/session.d.ts.map +1 -1
- package/dist/esm/common/session.js +6 -5
- package/dist/esm/common/session.js.map +1 -1
- package/dist/esm/elicitation.d.ts +25 -0
- package/dist/esm/elicitation.d.ts.map +1 -0
- package/dist/esm/elicitation.js +46 -0
- package/dist/esm/elicitation.js.map +1 -0
- package/dist/esm/helpers/connectionOptions.js +1 -1
- package/dist/esm/helpers/connectionOptions.js.map +1 -1
- package/dist/esm/index.js +9 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib.d.ts +8 -4
- package/dist/esm/lib.d.ts.map +1 -1
- package/dist/esm/lib.js +5 -2
- package/dist/esm/lib.js.map +1 -1
- package/dist/esm/resources/common/exportedData.d.ts.map +1 -1
- package/dist/esm/resources/common/exportedData.js +12 -3
- package/dist/esm/resources/common/exportedData.js.map +1 -1
- package/dist/esm/server.d.ts +7 -1
- package/dist/esm/server.d.ts.map +1 -1
- package/dist/esm/server.js +28 -7
- package/dist/esm/server.js.map +1 -1
- package/dist/esm/telemetry/eventCache.d.ts +11 -4
- package/dist/esm/telemetry/eventCache.d.ts.map +1 -1
- package/dist/esm/telemetry/eventCache.js +13 -6
- package/dist/esm/telemetry/eventCache.js.map +1 -1
- package/dist/esm/telemetry/telemetry.d.ts +9 -2
- package/dist/esm/telemetry/telemetry.d.ts.map +1 -1
- package/dist/esm/telemetry/telemetry.js +79 -42
- package/dist/esm/telemetry/telemetry.js.map +1 -1
- package/dist/esm/telemetry/types.d.ts +49 -0
- package/dist/esm/telemetry/types.d.ts.map +1 -1
- package/dist/esm/tools/args.d.ts +22 -0
- package/dist/esm/tools/args.d.ts.map +1 -0
- package/dist/esm/tools/args.js +47 -0
- package/dist/esm/tools/args.js.map +1 -0
- package/dist/esm/tools/atlas/atlasTool.d.ts +1 -2
- package/dist/esm/tools/atlas/atlasTool.d.ts.map +1 -1
- package/dist/esm/tools/atlas/atlasTool.js.map +1 -1
- package/dist/esm/tools/atlas/connect/connectCluster.d.ts +7 -4
- package/dist/esm/tools/atlas/connect/connectCluster.d.ts.map +1 -1
- package/dist/esm/tools/atlas/connect/connectCluster.js +56 -30
- package/dist/esm/tools/atlas/connect/connectCluster.js.map +1 -1
- package/dist/esm/tools/atlas/create/createAccessList.d.ts +9 -1
- package/dist/esm/tools/atlas/create/createAccessList.d.ts.map +1 -1
- package/dist/esm/tools/atlas/create/createAccessList.js +29 -12
- package/dist/esm/tools/atlas/create/createAccessList.js.map +1 -1
- package/dist/esm/tools/atlas/create/createDBUser.d.ts +21 -1
- package/dist/esm/tools/atlas/create/createDBUser.d.ts.map +1 -1
- package/dist/esm/tools/atlas/create/createDBUser.js +37 -21
- package/dist/esm/tools/atlas/create/createDBUser.js.map +1 -1
- package/dist/esm/tools/atlas/create/createFreeCluster.d.ts +4 -5
- package/dist/esm/tools/atlas/create/createFreeCluster.d.ts.map +1 -1
- package/dist/esm/tools/atlas/create/createFreeCluster.js +4 -4
- package/dist/esm/tools/atlas/create/createFreeCluster.js.map +1 -1
- package/dist/esm/tools/atlas/create/createProject.d.ts +7 -4
- package/dist/esm/tools/atlas/create/createProject.d.ts.map +1 -1
- package/dist/esm/tools/atlas/create/createProject.js +6 -3
- package/dist/esm/tools/atlas/create/createProject.js.map +1 -1
- package/dist/esm/tools/atlas/read/inspectAccessList.d.ts +5 -3
- package/dist/esm/tools/atlas/read/inspectAccessList.d.ts.map +1 -1
- package/dist/esm/tools/atlas/read/inspectAccessList.js +6 -3
- package/dist/esm/tools/atlas/read/inspectAccessList.js.map +1 -1
- package/dist/esm/tools/atlas/read/inspectCluster.d.ts +7 -4
- package/dist/esm/tools/atlas/read/inspectCluster.d.ts.map +1 -1
- package/dist/esm/tools/atlas/read/inspectCluster.js +7 -4
- package/dist/esm/tools/atlas/read/inspectCluster.js.map +1 -1
- package/dist/esm/tools/atlas/read/listAlerts.d.ts +5 -3
- package/dist/esm/tools/atlas/read/listAlerts.d.ts.map +1 -1
- package/dist/esm/tools/atlas/read/listAlerts.js +6 -3
- package/dist/esm/tools/atlas/read/listAlerts.js.map +1 -1
- package/dist/esm/tools/atlas/read/listClusters.d.ts +4 -2
- package/dist/esm/tools/atlas/read/listClusters.d.ts.map +1 -1
- package/dist/esm/tools/atlas/read/listClusters.js +12 -9
- package/dist/esm/tools/atlas/read/listClusters.js.map +1 -1
- package/dist/esm/tools/atlas/read/listDBUsers.d.ts +4 -2
- package/dist/esm/tools/atlas/read/listDBUsers.d.ts.map +1 -1
- package/dist/esm/tools/atlas/read/listDBUsers.js +5 -2
- package/dist/esm/tools/atlas/read/listDBUsers.js.map +1 -1
- package/dist/esm/tools/atlas/read/listProjects.d.ts +4 -2
- package/dist/esm/tools/atlas/read/listProjects.d.ts.map +1 -1
- package/dist/esm/tools/atlas/read/listProjects.js +6 -3
- package/dist/esm/tools/atlas/read/listProjects.js.map +1 -1
- package/dist/esm/tools/mongodb/connect/connect.d.ts +2 -5
- package/dist/esm/tools/mongodb/connect/connect.d.ts.map +1 -1
- package/dist/esm/tools/mongodb/connect/connect.js +2 -2
- package/dist/esm/tools/mongodb/connect/connect.js.map +1 -1
- package/dist/esm/tools/mongodb/delete/deleteMany.d.ts +1 -0
- package/dist/esm/tools/mongodb/delete/deleteMany.d.ts.map +1 -1
- package/dist/esm/tools/mongodb/delete/deleteMany.js +10 -0
- package/dist/esm/tools/mongodb/delete/deleteMany.js.map +1 -1
- package/dist/esm/tools/mongodb/delete/dropCollection.d.ts +1 -0
- package/dist/esm/tools/mongodb/delete/dropCollection.d.ts.map +1 -1
- package/dist/esm/tools/mongodb/delete/dropCollection.js +5 -0
- package/dist/esm/tools/mongodb/delete/dropCollection.js.map +1 -1
- package/dist/esm/tools/mongodb/delete/dropDatabase.d.ts +1 -0
- package/dist/esm/tools/mongodb/delete/dropDatabase.d.ts.map +1 -1
- package/dist/esm/tools/mongodb/delete/dropDatabase.js +5 -0
- package/dist/esm/tools/mongodb/delete/dropDatabase.js.map +1 -1
- package/dist/esm/tools/mongodb/metadata/logs.d.ts +1 -1
- package/dist/esm/tools/mongodb/metadata/logs.d.ts.map +1 -1
- package/dist/esm/tools/mongodb/metadata/logs.js +9 -11
- package/dist/esm/tools/mongodb/metadata/logs.js.map +1 -1
- package/dist/esm/tools/mongodb/mongodbTool.d.ts.map +1 -1
- package/dist/esm/tools/mongodb/mongodbTool.js +11 -52
- package/dist/esm/tools/mongodb/mongodbTool.js.map +1 -1
- package/dist/esm/tools/mongodb/read/aggregate.d.ts +1 -0
- package/dist/esm/tools/mongodb/read/aggregate.d.ts.map +1 -1
- package/dist/esm/tools/mongodb/read/aggregate.js +21 -0
- package/dist/esm/tools/mongodb/read/aggregate.js.map +1 -1
- package/dist/esm/tools/mongodb/read/export.js +1 -1
- package/dist/esm/tools/mongodb/read/export.js.map +1 -1
- package/dist/esm/tools/tool.d.ts +20 -5
- package/dist/esm/tools/tool.d.ts.map +1 -1
- package/dist/esm/tools/tool.js +43 -6
- package/dist/esm/tools/tool.js.map +1 -1
- package/dist/esm/transports/base.d.ts +17 -5
- package/dist/esm/transports/base.d.ts.map +1 -1
- package/dist/esm/transports/base.js +24 -9
- package/dist/esm/transports/base.js.map +1 -1
- package/dist/esm/transports/stdio.d.ts +2 -4
- package/dist/esm/transports/stdio.d.ts.map +1 -1
- package/dist/esm/transports/stdio.js +6 -6
- package/dist/esm/transports/stdio.js.map +1 -1
- package/dist/esm/transports/streamableHttp.d.ts +3 -4
- package/dist/esm/transports/streamableHttp.d.ts.map +1 -1
- package/dist/esm/transports/streamableHttp.js +22 -9
- package/dist/esm/transports/streamableHttp.js.map +1 -1
- package/package.json +22 -21
package/README.md
CHANGED
|
@@ -47,7 +47,9 @@ node -v
|
|
|
47
47
|
|
|
48
48
|
### Quick Start
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
> **🔒 Security Recommendation 1:** When using Atlas API credentials, be sure to assign only the minimum required permissions to your service account. See [Atlas API Permissions](#atlas-api-permissions) for details.
|
|
51
|
+
|
|
52
|
+
> **🔒 Security Recommendation 2:** For enhanced security, we strongly recommend using environment variables to pass sensitive configuration such as connection strings and API credentials instead of command line arguments. Command line arguments can be visible in process lists and logged in various system locations, potentially exposing your secrets. Environment variables provide a more secure way to handle sensitive information.
|
|
51
53
|
|
|
52
54
|
Most MCP clients require a configuration file to be created or modified to add the MCP server.
|
|
53
55
|
|
|
@@ -60,22 +62,19 @@ Note: The configuration file syntax can be different across clients. Please refe
|
|
|
60
62
|
|
|
61
63
|
> **Default Safety Notice:** All examples below include `--readOnly` by default to ensure safe, read-only access to your data. Remove `--readOnly` if you need to enable write operations.
|
|
62
64
|
|
|
63
|
-
#### Option 1: Connection String
|
|
65
|
+
#### Option 1: Connection String
|
|
64
66
|
|
|
65
|
-
You can pass your connection string via
|
|
67
|
+
You can pass your connection string via environment variables, make sure to use a valid username and password.
|
|
66
68
|
|
|
67
69
|
```json
|
|
68
70
|
{
|
|
69
71
|
"mcpServers": {
|
|
70
72
|
"MongoDB": {
|
|
71
73
|
"command": "npx",
|
|
72
|
-
"args": [
|
|
73
|
-
|
|
74
|
-
"mongodb
|
|
75
|
-
|
|
76
|
-
"mongodb://localhost:27017/myDatabase",
|
|
77
|
-
"--readOnly"
|
|
78
|
-
]
|
|
74
|
+
"args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
|
|
75
|
+
"env": {
|
|
76
|
+
"MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
|
|
77
|
+
}
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
}
|
|
@@ -83,7 +82,7 @@ You can pass your connection string via args, make sure to use a valid username
|
|
|
83
82
|
|
|
84
83
|
NOTE: The connection string can be configured to connect to any MongoDB cluster, whether it's a local instance or an Atlas cluster.
|
|
85
84
|
|
|
86
|
-
#### Option 2: Atlas API
|
|
85
|
+
#### Option 2: Atlas API Credentials
|
|
87
86
|
|
|
88
87
|
Use your Atlas API Service Accounts credentials. Must follow all the steps in [Atlas API Access](#atlas-api-access) section.
|
|
89
88
|
|
|
@@ -92,43 +91,37 @@ Use your Atlas API Service Accounts credentials. Must follow all the steps in [A
|
|
|
92
91
|
"mcpServers": {
|
|
93
92
|
"MongoDB": {
|
|
94
93
|
"command": "npx",
|
|
95
|
-
"args": [
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
"--apiClientSecret",
|
|
101
|
-
"your-atlas-service-accounts-client-secret",
|
|
102
|
-
"--readOnly"
|
|
103
|
-
]
|
|
94
|
+
"args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
|
|
95
|
+
"env": {
|
|
96
|
+
"MDB_MCP_API_CLIENT_ID": "your-atlas-service-accounts-client-id",
|
|
97
|
+
"MDB_MCP_API_CLIENT_SECRET": "your-atlas-service-accounts-client-secret"
|
|
98
|
+
}
|
|
104
99
|
}
|
|
105
100
|
}
|
|
106
101
|
}
|
|
107
102
|
```
|
|
108
103
|
|
|
109
|
-
#### Option 3: Standalone Service using command arguments
|
|
104
|
+
#### Option 3: Standalone Service using environment variables and command line arguments
|
|
110
105
|
|
|
111
|
-
|
|
106
|
+
You can source environment variables defined in a config file or explicitly set them like we do in the example below and run the server via npx.
|
|
112
107
|
|
|
113
108
|
```shell
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
- For a complete list of arguments see [Configuration Options](#configuration-options)
|
|
118
|
-
- To configure your Atlas Service Accounts credentials please refer to [Atlas API Access](#atlas-api-access)
|
|
119
|
-
|
|
120
|
-
#### Option 4: Standalone Service using environment variables
|
|
109
|
+
# Set your credentials as environment variables first
|
|
110
|
+
export MDB_MCP_API_CLIENT_ID="your-atlas-service-accounts-client-id"
|
|
111
|
+
export MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
|
|
121
112
|
|
|
122
|
-
|
|
123
|
-
|
|
113
|
+
# Then start the server
|
|
114
|
+
npx -y mongodb-mcp-server@latest --readOnly
|
|
124
115
|
```
|
|
125
116
|
|
|
126
|
-
|
|
117
|
+
> **💡 Platform Note:** The examples above use Unix/Linux/macOS syntax. For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
|
|
127
118
|
|
|
119
|
+
- For a complete list of configuration options see [Configuration Options](#configuration-options)
|
|
120
|
+
- To configure your Atlas Service Accounts credentials please refer to [Atlas API Access](#atlas-api-access)
|
|
128
121
|
- Connection String via environment variables in the MCP file [example](#connection-string-with-environment-variables)
|
|
129
122
|
- Atlas API credentials via environment variables in the MCP file [example](#atlas-api-credentials-with-environment-variables)
|
|
130
123
|
|
|
131
|
-
#### Option
|
|
124
|
+
#### Option 4: Using Docker
|
|
132
125
|
|
|
133
126
|
You can run the MongoDB MCP Server in a Docker container, which provides isolation and doesn't require a local Node.js installation.
|
|
134
127
|
|
|
@@ -146,22 +139,35 @@ docker run --rm -i \
|
|
|
146
139
|
##### Option B: With MongoDB connection string
|
|
147
140
|
|
|
148
141
|
```shell
|
|
142
|
+
# Set your credentials as environment variables first
|
|
143
|
+
export MDB_MCP_CONNECTION_STRING="mongodb+srv://username:password@cluster.mongodb.net/myDatabase"
|
|
144
|
+
|
|
145
|
+
# Then start the docker container
|
|
149
146
|
docker run --rm -i \
|
|
150
|
-
-e MDB_MCP_CONNECTION_STRING
|
|
147
|
+
-e MDB_MCP_CONNECTION_STRING \
|
|
151
148
|
-e MDB_MCP_READ_ONLY="true" \
|
|
152
149
|
mongodb/mongodb-mcp-server:latest
|
|
153
150
|
```
|
|
154
151
|
|
|
152
|
+
> **💡 Platform Note:** The examples above use Unix/Linux/macOS syntax. For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
|
|
153
|
+
|
|
155
154
|
##### Option C: With Atlas API credentials
|
|
156
155
|
|
|
157
156
|
```shell
|
|
157
|
+
# Set your credentials as environment variables first
|
|
158
|
+
export MDB_MCP_API_CLIENT_ID="your-atlas-service-accounts-client-id"
|
|
159
|
+
export MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
|
|
160
|
+
|
|
161
|
+
# Then start the docker container
|
|
158
162
|
docker run --rm -i \
|
|
159
|
-
-e MDB_MCP_API_CLIENT_ID
|
|
160
|
-
-e MDB_MCP_API_CLIENT_SECRET
|
|
163
|
+
-e MDB_MCP_API_CLIENT_ID \
|
|
164
|
+
-e MDB_MCP_API_CLIENT_SECRET \
|
|
161
165
|
-e MDB_MCP_READ_ONLY="true" \
|
|
162
166
|
mongodb/mongodb-mcp-server:latest
|
|
163
167
|
```
|
|
164
168
|
|
|
169
|
+
> **💡 Platform Note:** The examples above use Unix/Linux/macOS syntax. For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
|
|
170
|
+
|
|
165
171
|
##### Docker in MCP Configuration File
|
|
166
172
|
|
|
167
173
|
Without options:
|
|
@@ -196,11 +202,14 @@ With connection string:
|
|
|
196
202
|
"--rm",
|
|
197
203
|
"-i",
|
|
198
204
|
"-e",
|
|
199
|
-
"MDB_MCP_CONNECTION_STRING
|
|
205
|
+
"MDB_MCP_CONNECTION_STRING",
|
|
200
206
|
"-e",
|
|
201
207
|
"MDB_MCP_READ_ONLY=true",
|
|
202
208
|
"mongodb/mongodb-mcp-server:latest"
|
|
203
|
-
]
|
|
209
|
+
],
|
|
210
|
+
"env": {
|
|
211
|
+
"MDB_MCP_CONNECTION_STRING": "mongodb+srv://username:password@cluster.mongodb.net/myDatabase"
|
|
212
|
+
}
|
|
204
213
|
}
|
|
205
214
|
}
|
|
206
215
|
}
|
|
@@ -220,17 +229,21 @@ With Atlas API credentials:
|
|
|
220
229
|
"-e",
|
|
221
230
|
"MDB_MCP_READ_ONLY=true",
|
|
222
231
|
"-e",
|
|
223
|
-
"MDB_MCP_API_CLIENT_ID
|
|
232
|
+
"MDB_MCP_API_CLIENT_ID",
|
|
224
233
|
"-e",
|
|
225
|
-
"MDB_MCP_API_CLIENT_SECRET
|
|
234
|
+
"MDB_MCP_API_CLIENT_SECRET",
|
|
226
235
|
"mongodb/mongodb-mcp-server:latest"
|
|
227
|
-
]
|
|
236
|
+
],
|
|
237
|
+
"env": {
|
|
238
|
+
"MDB_MCP_API_CLIENT_ID": "your-atlas-service-accounts-client-id",
|
|
239
|
+
"MDB_MCP_API_CLIENT_SECRET": "your-atlas-service-accounts-client-secret"
|
|
240
|
+
}
|
|
228
241
|
}
|
|
229
242
|
}
|
|
230
243
|
}
|
|
231
244
|
```
|
|
232
245
|
|
|
233
|
-
#### Option
|
|
246
|
+
#### Option 5: Running as an HTTP Server
|
|
234
247
|
|
|
235
248
|
> **⚠️ Security Notice:** This server now supports Streamable HTTP transport for remote connections. **HTTP transport is NOT recommended for production use without implementing proper authentication and security measures.**
|
|
236
249
|
|
|
@@ -316,6 +329,8 @@ NOTE: atlas tools are only available when you set credentials on [configuration]
|
|
|
316
329
|
|
|
317
330
|
## Configuration
|
|
318
331
|
|
|
332
|
+
> **🔒 Security Best Practice:** We strongly recommend using environment variables for sensitive configuration such as API credentials (`MDB_MCP_API_CLIENT_ID`, `MDB_MCP_API_CLIENT_SECRET`) and connection strings (`MDB_MCP_CONNECTION_STRING`) instead of command-line arguments. Environment variables are not visible in process lists and provide better security for your sensitive data.
|
|
333
|
+
|
|
319
334
|
The MongoDB MCP Server can be configured using multiple methods, with the following precedence (highest to lowest):
|
|
320
335
|
|
|
321
336
|
1. Command-line arguments
|
|
@@ -323,25 +338,27 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
|
|
|
323
338
|
|
|
324
339
|
### Configuration Options
|
|
325
340
|
|
|
326
|
-
| CLI Option
|
|
327
|
-
|
|
|
328
|
-
| `apiClientId`
|
|
329
|
-
| `apiClientSecret`
|
|
330
|
-
| `connectionString`
|
|
331
|
-
| `loggers`
|
|
332
|
-
| `logPath`
|
|
333
|
-
| `disabledTools`
|
|
334
|
-
| `
|
|
335
|
-
| `
|
|
336
|
-
| `
|
|
337
|
-
| `
|
|
338
|
-
| `
|
|
339
|
-
| `
|
|
340
|
-
| `
|
|
341
|
-
| `
|
|
342
|
-
| `
|
|
343
|
-
| `
|
|
344
|
-
| `
|
|
341
|
+
| CLI Option | Environment Variable | Default | Description |
|
|
342
|
+
| -------------------------------------- | --------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
343
|
+
| `apiClientId` | `MDB_MCP_API_CLIENT_ID` | <not set> | Atlas API client ID for authentication. Required for running Atlas tools. |
|
|
344
|
+
| `apiClientSecret` | `MDB_MCP_API_CLIENT_SECRET` | <not set> | Atlas API client secret for authentication. Required for running Atlas tools. |
|
|
345
|
+
| `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. |
|
|
346
|
+
| `loggers` | `MDB_MCP_LOGGERS` | disk,mcp | Comma separated values, possible values are `mcp`, `disk` and `stderr`. See [Logger Options](#logger-options) for details. |
|
|
347
|
+
| `logPath` | `MDB_MCP_LOG_PATH` | see note\* | Folder to store logs. |
|
|
348
|
+
| `disabledTools` | `MDB_MCP_DISABLED_TOOLS` | <not set> | An array of tool names, operation types, and/or categories of tools that will be disabled. |
|
|
349
|
+
| `confirmationRequiredTools` | `MDB_MCP_CONFIRMATION_REQUIRED_TOOLS` | create-access-list,create-db-user,drop-database,drop-collection,delete-many | An array of tool names that require user confirmation before execution. **Requires the client to support [elicitation](https://modelcontextprotocol.io/specification/draft/client/elicitation)**. |
|
|
350
|
+
| `readOnly` | `MDB_MCP_READ_ONLY` | false | When set to true, only allows read, connect, and metadata operation types, disabling create/update/delete operations. |
|
|
351
|
+
| `indexCheck` | `MDB_MCP_INDEX_CHECK` | false | When set to true, enforces that query operations must use an index, rejecting queries that perform a collection scan. |
|
|
352
|
+
| `telemetry` | `MDB_MCP_TELEMETRY` | enabled | When set to disabled, disables telemetry collection. |
|
|
353
|
+
| `transport` | `MDB_MCP_TRANSPORT` | stdio | Either 'stdio' or 'http'. |
|
|
354
|
+
| `httpPort` | `MDB_MCP_HTTP_PORT` | 3000 | Port number. |
|
|
355
|
+
| `httpHost` | `MDB_MCP_HTTP_HOST` | 127.0.0.1 | Host to bind the http server. |
|
|
356
|
+
| `idleTimeoutMs` | `MDB_MCP_IDLE_TIMEOUT_MS` | 600000 | Idle timeout for a client to disconnect (only applies to http transport). |
|
|
357
|
+
| `notificationTimeoutMs` | `MDB_MCP_NOTIFICATION_TIMEOUT_MS` | 540000 | Notification timeout for a client to be aware of diconnect (only applies to http transport). |
|
|
358
|
+
| `exportsPath` | `MDB_MCP_EXPORTS_PATH` | see note\* | Folder to store exported data files. |
|
|
359
|
+
| `exportTimeoutMs` | `MDB_MCP_EXPORT_TIMEOUT_MS` | 300000 | Time in milliseconds after which an export is considered expired and eligible for cleanup. |
|
|
360
|
+
| `exportCleanupIntervalMs` | `MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS` | 120000 | Time in milliseconds between export cleanup cycles that remove expired export files. |
|
|
361
|
+
| `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. |
|
|
345
362
|
|
|
346
363
|
#### Logger Options
|
|
347
364
|
|
|
@@ -361,6 +378,8 @@ You can combine multiple loggers, e.g. `--loggers disk stderr` or `export MDB_MC
|
|
|
361
378
|
export MDB_MCP_LOGGERS="disk,stderr"
|
|
362
379
|
```
|
|
363
380
|
|
|
381
|
+
> **💡 Platform Note:** For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
|
|
382
|
+
|
|
364
383
|
##### Example: Set logger via command-line argument
|
|
365
384
|
|
|
366
385
|
```shell
|
|
@@ -400,6 +419,14 @@ Operation types:
|
|
|
400
419
|
- `metadata` - Tools that read metadata, such as list databases, list collections, collection schema, etc.
|
|
401
420
|
- `connect` - Tools that allow you to connect or switch the connection to a MongoDB instance. If this is disabled, you will need to provide a connection string through the config when starting the server.
|
|
402
421
|
|
|
422
|
+
#### Require Confirmation
|
|
423
|
+
|
|
424
|
+
If your client supports [elicitation](https://modelcontextprotocol.io/specification/draft/client/elicitation), you can set the MongoDB MCP server to request user confirmation before executing certain tools.
|
|
425
|
+
|
|
426
|
+
When a tool is marked as requiring confirmation, the server will send an elicitation request to the client. The client with elicitation support will then prompt the user for confirmation and send the response back to the server. If the client does not support elicitation, the tool will execute without confirmation.
|
|
427
|
+
|
|
428
|
+
You can set the `confirmationRequiredTools` configuration option to specify the names of tools which require confirmation. By default, the following tools have this setting enabled: `drop-database`, `drop-collection`, `delete-many`, `atlas-create-db-user`, `atlas-create-access-list`.
|
|
429
|
+
|
|
403
430
|
#### Read-Only Mode
|
|
404
431
|
|
|
405
432
|
The `readOnly` configuration option allows you to restrict the MCP server to only use tools with "read", "connect", and "metadata" operation types. When enabled, all tools that have "create", "update" or "delete" operation types will not be registered with the server.
|
|
@@ -411,6 +438,8 @@ You can enable read-only mode using:
|
|
|
411
438
|
- **Environment variable**: `export MDB_MCP_READ_ONLY=true`
|
|
412
439
|
- **Command-line argument**: `--readOnly`
|
|
413
440
|
|
|
441
|
+
> **💡 Platform Note:** For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
|
|
442
|
+
|
|
414
443
|
When read-only mode is active, you'll see a message in the server logs indicating which tools were prevented from registering due to this restriction.
|
|
415
444
|
|
|
416
445
|
#### Index Check Mode
|
|
@@ -424,6 +453,8 @@ You can enable index check mode using:
|
|
|
424
453
|
- **Environment variable**: `export MDB_MCP_INDEX_CHECK=true`
|
|
425
454
|
- **Command-line argument**: `--indexCheck`
|
|
426
455
|
|
|
456
|
+
> **💡 Platform Note:** For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
|
|
457
|
+
|
|
427
458
|
When index check mode is active, you'll see an error message if a query is rejected due to not using an index.
|
|
428
459
|
|
|
429
460
|
#### Exports
|
|
@@ -447,6 +478,8 @@ You can disable telemetry using:
|
|
|
447
478
|
- **Command-line argument**: `--telemetry disabled`
|
|
448
479
|
- **DO_NOT_TRACK environment variable**: `export DO_NOT_TRACK=1`
|
|
449
480
|
|
|
481
|
+
> **💡 Platform Note:** For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
|
|
482
|
+
|
|
450
483
|
### Atlas API Access
|
|
451
484
|
|
|
452
485
|
To use the Atlas API tools, you'll need to create a service account in MongoDB Atlas:
|
|
@@ -500,7 +533,9 @@ For a full list of roles and their privileges, see the [Atlas User Roles documen
|
|
|
500
533
|
|
|
501
534
|
Set environment variables with the prefix `MDB_MCP_` followed by the option name in uppercase with underscores:
|
|
502
535
|
|
|
503
|
-
|
|
536
|
+
**Linux/macOS (bash/zsh):**
|
|
537
|
+
|
|
538
|
+
```bash
|
|
504
539
|
# Set Atlas API credentials (via Service Accounts)
|
|
505
540
|
export MDB_MCP_API_CLIENT_ID="your-atlas-service-accounts-client-id"
|
|
506
541
|
export MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
|
|
@@ -508,8 +543,33 @@ export MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
|
|
|
508
543
|
# Set a custom MongoDB connection string
|
|
509
544
|
export MDB_MCP_CONNECTION_STRING="mongodb+srv://username:password@cluster.mongodb.net/myDatabase"
|
|
510
545
|
|
|
546
|
+
# Set log path
|
|
511
547
|
export MDB_MCP_LOG_PATH="/path/to/logs"
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
**Windows Command Prompt (cmd):**
|
|
551
|
+
|
|
552
|
+
```cmd
|
|
553
|
+
set "MDB_MCP_API_CLIENT_ID=your-atlas-service-accounts-client-id"
|
|
554
|
+
set "MDB_MCP_API_CLIENT_SECRET=your-atlas-service-accounts-client-secret"
|
|
512
555
|
|
|
556
|
+
set "MDB_MCP_CONNECTION_STRING=mongodb+srv://username:password@cluster.mongodb.net/myDatabase"
|
|
557
|
+
|
|
558
|
+
set "MDB_MCP_LOG_PATH=C:\path\to\logs"
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
**Windows PowerShell:**
|
|
562
|
+
|
|
563
|
+
```powershell
|
|
564
|
+
# Set Atlas API credentials (via Service Accounts)
|
|
565
|
+
$env:MDB_MCP_API_CLIENT_ID="your-atlas-service-accounts-client-id"
|
|
566
|
+
$env:MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
|
|
567
|
+
|
|
568
|
+
# Set a custom MongoDB connection string
|
|
569
|
+
$env:MDB_MCP_CONNECTION_STRING="mongodb+srv://username:password@cluster.mongodb.net/myDatabase"
|
|
570
|
+
|
|
571
|
+
# Set log path
|
|
572
|
+
$env:MDB_MCP_LOG_PATH="C:\path\to\logs"
|
|
513
573
|
```
|
|
514
574
|
|
|
515
575
|
#### MCP configuration file examples
|
|
@@ -551,14 +611,26 @@ export MDB_MCP_LOG_PATH="/path/to/logs"
|
|
|
551
611
|
|
|
552
612
|
Pass configuration options as command-line arguments when starting the server:
|
|
553
613
|
|
|
614
|
+
> **🔒 Security Note:** For sensitive configuration like API credentials and connection strings, use environment variables instead of command-line arguments.
|
|
615
|
+
|
|
554
616
|
```shell
|
|
555
|
-
|
|
617
|
+
# Set sensitive data as environment variable
|
|
618
|
+
export MDB_MCP_API_CLIENT_ID="your-atlas-service-accounts-client-id"
|
|
619
|
+
export MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
|
|
620
|
+
export MDB_MCP_CONNECTION_STRING="mongodb+srv://username:password@cluster.mongodb.net/myDatabase"
|
|
621
|
+
|
|
622
|
+
# Start the server with command line arguments
|
|
623
|
+
npx -y mongodb-mcp-server@latest --logPath=/path/to/logs --readOnly --indexCheck
|
|
556
624
|
```
|
|
557
625
|
|
|
626
|
+
> **💡 Platform Note:** The examples above use Unix/Linux/macOS syntax. For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
|
|
627
|
+
|
|
558
628
|
#### MCP configuration file examples
|
|
559
629
|
|
|
560
630
|
##### Connection String with command-line arguments
|
|
561
631
|
|
|
632
|
+
> **🔒 Security Note:** We do not recommend passing connection string as command line argument. Connection string might contain credentials which can be visible in process lists and logged in various system locations, potentially exposing your credentials. Instead configure [connection string through environment variables](#connection-string-with-environment-variables)
|
|
633
|
+
|
|
562
634
|
```json
|
|
563
635
|
{
|
|
564
636
|
"mcpServers": {
|
|
@@ -578,6 +650,8 @@ npx -y mongodb-mcp-server@latest --apiClientId="your-atlas-service-accounts-clie
|
|
|
578
650
|
|
|
579
651
|
##### Atlas API credentials with command-line arguments
|
|
580
652
|
|
|
653
|
+
> **🔒 Security Note:** We do not recommend passing Atlas API credentials as command line argument. The provided credentials can be visible in process lists and logged in various system locations, potentially exposing your credentials. Instead configure [Atlas API credentials through environment variables](#atlas-api-credentials-with-environment-variables)
|
|
654
|
+
|
|
581
655
|
```json
|
|
582
656
|
{
|
|
583
657
|
"mcpServers": {
|
|
@@ -10,6 +10,7 @@ export declare function makeCurrentIpAccessListEntry(apiClient: ApiClient, proje
|
|
|
10
10
|
* If the IP is already present, this is a no-op.
|
|
11
11
|
* @param apiClient The Atlas API client instance
|
|
12
12
|
* @param projectId The Atlas project ID
|
|
13
|
+
* @returns Promise<boolean> - true if a new IP access list entry was created, false if it already existed
|
|
13
14
|
*/
|
|
14
|
-
export declare function ensureCurrentIpInAccessList(apiClient: ApiClient, projectId: string): Promise<
|
|
15
|
+
export declare function ensureCurrentIpInAccessList(apiClient: ApiClient, projectId: string): Promise<boolean>;
|
|
15
16
|
//# sourceMappingURL=accessListUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessListUtils.d.ts","sourceRoot":"","sources":["../../../../src/common/atlas/accessListUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD,eAAO,MAAM,2BAA2B,sDAAsD,CAAC;AAE/F,wBAAsB,4BAA4B,CAC9C,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,MAAoC,GAC9C,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAOlE;AAED
|
|
1
|
+
{"version":3,"file":"accessListUtils.d.ts","sourceRoot":"","sources":["../../../../src/common/atlas/accessListUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD,eAAO,MAAM,2BAA2B,sDAAsD,CAAC;AAE/F,wBAAsB,4BAA4B,CAC9C,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,MAAoC,GAC9C,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAOlE;AAED;;;;;;GAMG;AACH,wBAAsB,2BAA2B,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA8B3G"}
|
|
@@ -19,6 +19,7 @@ async function makeCurrentIpAccessListEntry(apiClient, projectId, comment = expo
|
|
|
19
19
|
* If the IP is already present, this is a no-op.
|
|
20
20
|
* @param apiClient The Atlas API client instance
|
|
21
21
|
* @param projectId The Atlas project ID
|
|
22
|
+
* @returns Promise<boolean> - true if a new IP access list entry was created, false if it already existed
|
|
22
23
|
*/
|
|
23
24
|
async function ensureCurrentIpInAccessList(apiClient, projectId) {
|
|
24
25
|
const entry = await makeCurrentIpAccessListEntry(apiClient, projectId, exports.DEFAULT_ACCESS_LIST_COMMENT);
|
|
@@ -32,6 +33,7 @@ async function ensureCurrentIpInAccessList(apiClient, projectId) {
|
|
|
32
33
|
context: "accessListUtils",
|
|
33
34
|
message: `IP access list created: ${JSON.stringify(entry)}`,
|
|
34
35
|
});
|
|
36
|
+
return true;
|
|
35
37
|
}
|
|
36
38
|
catch (err) {
|
|
37
39
|
if (err instanceof apiClientError_js_1.ApiClientError && err.response?.status === 409) {
|
|
@@ -41,7 +43,7 @@ async function ensureCurrentIpInAccessList(apiClient, projectId) {
|
|
|
41
43
|
context: "accessListUtils",
|
|
42
44
|
message: `IP address ${entry.ipAddress} is already present in the access list for project ${projectId}.`,
|
|
43
45
|
});
|
|
44
|
-
return;
|
|
46
|
+
return false;
|
|
45
47
|
}
|
|
46
48
|
apiClient.logger.warning({
|
|
47
49
|
id: logger_js_1.LogId.atlasIpAccessListAddFailure,
|
|
@@ -49,5 +51,6 @@ async function ensureCurrentIpInAccessList(apiClient, projectId) {
|
|
|
49
51
|
message: `Error adding IP access list: ${err instanceof Error ? err.message : String(err)}`,
|
|
50
52
|
});
|
|
51
53
|
}
|
|
54
|
+
return false;
|
|
52
55
|
}
|
|
53
56
|
//# sourceMappingURL=accessListUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessListUtils.js","sourceRoot":"","sources":["../../../../src/common/atlas/accessListUtils.ts"],"names":[],"mappings":";;;AAMA,oEAWC;
|
|
1
|
+
{"version":3,"file":"accessListUtils.js","sourceRoot":"","sources":["../../../../src/common/atlas/accessListUtils.ts"],"names":[],"mappings":";;;AAMA,oEAWC;AASD,kEA8BC;AAvDD,4CAAqC;AACrC,2DAAqD;AAExC,QAAA,2BAA2B,GAAG,mDAAmD,CAAC;AAExF,KAAK,UAAU,4BAA4B,CAC9C,SAAoB,EACpB,SAAiB,EACjB,UAAkB,mCAA2B;IAE7C,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,SAAS,CAAC,SAAS,EAAE,CAAC;IAC3D,OAAO;QACH,OAAO,EAAE,SAAS;QAClB,SAAS,EAAE,kBAAkB;QAC7B,OAAO;KACV,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,2BAA2B,CAAC,SAAoB,EAAE,SAAiB;IACrF,MAAM,KAAK,GAAG,MAAM,4BAA4B,CAAC,SAAS,EAAE,SAAS,EAAE,mCAA2B,CAAC,CAAC;IACpG,IAAI,CAAC;QACD,MAAM,SAAS,CAAC,yBAAyB,CAAC;YACtC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE;YACxC,IAAI,EAAE,CAAC,KAAK,CAAC;SAChB,CAAC,CAAC;QACH,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;YACnB,EAAE,EAAE,iBAAK,CAAC,sBAAsB;YAChC,OAAO,EAAE,iBAAiB;YAC1B,OAAO,EAAE,2BAA2B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;SAC9D,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,IAAI,GAAG,YAAY,kCAAc,IAAI,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;YAChE,+CAA+C;YAC/C,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;gBACnB,EAAE,EAAE,iBAAK,CAAC,sBAAsB;gBAChC,OAAO,EAAE,iBAAiB;gBAC1B,OAAO,EAAE,cAAc,KAAK,CAAC,SAAS,sDAAsD,SAAS,GAAG;aAC3G,CAAC,CAAC;YACH,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;YACrB,EAAE,EAAE,iBAAK,CAAC,2BAA2B;YACrC,OAAO,EAAE,iBAAiB;YAC1B,OAAO,EAAE,gCAAgC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;SAC9F,CAAC,CAAC;IACP,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { CliOptions, ConnectionInfo } from "@mongosh/arg-parser";
|
|
2
|
+
export declare function validateConfigKey(key: string): {
|
|
3
|
+
valid: boolean;
|
|
4
|
+
suggestion?: string;
|
|
5
|
+
};
|
|
2
6
|
export interface UserConfig extends CliOptions {
|
|
3
7
|
apiBaseUrl: string;
|
|
4
8
|
apiClientId?: string;
|
|
@@ -10,6 +14,7 @@ export interface UserConfig extends CliOptions {
|
|
|
10
14
|
exportCleanupIntervalMs: number;
|
|
11
15
|
connectionString?: string;
|
|
12
16
|
disabledTools: Array<string>;
|
|
17
|
+
confirmationRequiredTools: Array<string>;
|
|
13
18
|
readOnly?: boolean;
|
|
14
19
|
indexCheck?: boolean;
|
|
15
20
|
transport: "stdio" | "http";
|
|
@@ -19,12 +24,18 @@ export interface UserConfig extends CliOptions {
|
|
|
19
24
|
loggers: Array<"stderr" | "disk" | "mcp">;
|
|
20
25
|
idleTimeoutMs: number;
|
|
21
26
|
notificationTimeoutMs: number;
|
|
27
|
+
atlasTemporaryDatabaseUserLifetimeMs: number;
|
|
22
28
|
}
|
|
23
29
|
export declare const defaultUserConfig: UserConfig;
|
|
24
30
|
export declare const config: UserConfig;
|
|
25
31
|
export type DriverOptions = ConnectionInfo["driverOptions"];
|
|
26
32
|
export declare const defaultDriverOptions: DriverOptions;
|
|
27
33
|
export declare const driverOptions: Omit<import("@mongosh/arg-parser").DevtoolsConnectOptions, "productName" | "productDocsLink">;
|
|
34
|
+
export declare function warnAboutDeprecatedOrUnknownCliArgs(args: Record<string, unknown>, { warn, exit }: {
|
|
35
|
+
warn: (msg: string) => void;
|
|
36
|
+
exit: (status: number) => void | never;
|
|
37
|
+
}): void;
|
|
38
|
+
export declare function registerKnownSecretsInRootKeychain(userConfig: Partial<UserConfig>): void;
|
|
28
39
|
export declare function setupUserConfig({ cli, env, defaults, }: {
|
|
29
40
|
cli: string[];
|
|
30
41
|
env: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/common/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/common/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA2GtE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CA6BtF;AAaD,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,yBAAyB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oCAAoC,EAAE,MAAM,CAAC;CAChD;AAED,eAAO,MAAM,iBAAiB,EAAE,UAyB/B,CAAC;AAEF,eAAO,MAAM,MAAM,YAIjB,CAAC;AAQH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAC5D,eAAO,MAAM,oBAAoB,EAAE,aAWlC,CAAC;AAEF,eAAO,MAAM,aAAa,+FAGxB,CAAC;AAkHH,wBAAgB,mCAAmC,CAC/C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,KAAK,CAAA;CAAE,GACxF,IAAI,CAsCN;AAyBD,wBAAgB,kCAAkC,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,CAqBxF;AAED,wBAAgB,eAAe,CAAC,EAC5B,GAAG,EACH,GAAG,EACH,QAAQ,GACX,EAAE;IACC,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;CACjC,GAAG,UAAU,CAgDb;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,MAAM,EACN,QAAQ,GACX,EAAE;IACC,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CACpC,GAAG,aAAa,CAMhB"}
|