You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
[](https://insiders.vscode.dev/redirect/mcp/install?name=mongodb&inputs=%5B%7B%22id%22%3A%22connection_string%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22MongoDB%20connection%20string%22%7D%5D&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mongodb-mcp-server%22%2C%22--readOnly%22%5D%2C%22env%22%3A%7B%22MDB_MCP_CONNECTION_STRING%22%3A%22%24%7Binput%3Aconnection_string%7D%22%7D%7D)
2
-
[](https://cursor.com/install-mcp?name=MongoDB&config=eyJjb21tYW5kIjoibnB4IC15IG1vbmdvZGItbWNwLXNlcnZlciAtLXJlYWRPbmx5In0%3D)
2
+
[](https://cursor.com/en-US/install-mcp?name=MongoDB&config=eyJjb21tYW5kIjoibnB4IC15IG1vbmdvZGItbWNwLXNlcnZlciAtLXJlYWRPbmx5In0%3D)
3
3
4
4
# MongoDB MCP Server
5
5
@@ -406,6 +406,8 @@ When using the `disk` logger, log files are stored in:
406
406
407
407
You can override the log directory with the `logPath` option.
408
408
409
+
> **🔒 Security Guideline:** The user account running the MCP server must have both read and write permissions to the `logPath` directory. Ensure this directory is properly secured with appropriate file system permissions to prevent unauthorized access to log files.
410
+
409
411
#### Disabled Tools
410
412
411
413
You can disable specific tools or categories of tools by using the `disabledTools` option. This option accepts an array of strings,
@@ -479,6 +481,8 @@ The `exportTimeoutMs` configuration controls the time after which the exported d
479
481
480
482
The `exportCleanupIntervalMs` configuration controls how frequently the cleanup process runs to remove expired export files. By default, cleanup runs every 2 minutes (120000ms).
481
483
484
+
> **🔒 Security Guideline:** The user account running the MCP server must have both read and write permissions to the `exportsPath` directory. Ensure this directory is properly secured with appropriate file system permissions to prevent unauthorized access to exported data files, which may contain sensitive MongoDB data. Consider the sensitivity of your data when choosing the export location and apply restrictive permissions accordingly.
485
+
482
486
#### Telemetry
483
487
484
488
The `telemetry` configuration option allows you to disable telemetry collection. When enabled, the MCP server will collect usage data and send it to MongoDB.
.sort((a,b)=>a.category.localeCompare(b.category));// Sort Atlas tools before MongoDB tools
19
19
20
20
// Find what Atlas connect tools are available and suggest when the LLM should to use each. If no Atlas tools are found, return a suggestion for the MongoDB connect tool.
connectionString: z.string().describe("MongoDB connection string (in the mongodb:// or mongodb+srv:// format)"),
12
-
})
13
-
.describe("Options for connecting to MongoDB.");
14
-
15
-
constconnectedSchema=z
16
-
.object({
17
-
connectionString: z
18
-
.string()
19
-
.optional()
20
-
.describe("MongoDB connection string to switch to (in the mongodb:// or mongodb+srv:// format)"),
21
-
})
22
-
.describe(
23
-
"Options for switching the current MongoDB connection. If a connection string is not provided, the connection string from the config will be used."
24
-
);
25
-
26
-
constconnectedName="switch-connection"asconst;
27
-
constdisconnectedName="connect"asconst;
28
-
29
-
constconnectedDescription=
30
-
"Switch to a different MongoDB connection. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new instance.";
31
-
constdisconnectedDescription=
32
-
"Connect to a MongoDB instance. The config resource captures if the server is already connected to a MongoDB cluster. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new MongoDB cluster.";
"Connect to a MongoDB instance. The config resource captures if the server is already connected to a MongoDB cluster. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new MongoDB cluster.";
37
10
38
11
// Here the default is empty just to trigger registration, but we're going to override it with the correct
39
12
// schema in the register method.
40
-
protectedargsShape={
41
-
connectionString: z.string().optional(),
13
+
protectedoverrideargsShape={
14
+
connectionString: z.string().describe("MongoDB connection string (in the mongodb:// or mongodb+srv:// format)"),
"Switch to a different MongoDB connection. If the user has configured a connection string or has previously called the connect tool, a connection is already established and there's no need to call this tool unless the user has explicitly requested to switch to a new instance.";
12
+
13
+
protectedoverrideargsShape={
14
+
connectionString: z
15
+
.string()
16
+
.optional()
17
+
.describe(
18
+
"MongoDB connection string to switch to (in the mongodb:// or mongodb+srv:// format). If a connection string is not provided, the connection string from the config will be used."
0 commit comments