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
+59-1Lines changed: 59 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -341,6 +341,7 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
341
341
342
342
1. Command-line arguments
343
343
2. Environment variables
344
+
3. Configuration File
344
345
345
346
### Configuration Options
346
347
@@ -554,6 +555,63 @@ For a full list of roles and their privileges, see the [Atlas User Roles documen
554
555
555
556
### Configuration Methods
556
557
558
+
#### Configuration File
559
+
560
+
Store configuration in a JSON file and load it using the `MDB_MCP_CONFIG` environment variable (recommended) or `--config` command-line argument.
561
+
562
+
> **🔒 Security Best Practice:** Prefer using the `MDB_MCP_CONFIG` environment variable over the `--config` CLI argument. Command-line arguments are visible in process listings.
563
+
564
+
> **🔒 File Security:** Ensure your configuration file has proper ownership and permissions, limited to the user running the MongoDB MCP server:
565
+
>
566
+
> **Linux/macOS:**
567
+
>
568
+
> ```bash
569
+
> chmod 600 /path/to/config.json
570
+
> chown your-username /path/to/config.json
571
+
>```
572
+
>
573
+
>**Windows:** Right-click the file → Properties → Security → Restrict access to your user account only.
574
+
575
+
Create a JSON file with your configuration (all keys use camelCase):
> **💡 Platform Note:** The examples above use Unix/Linux/macOS syntax. For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
652
710
653
-
#### MCP configuration file examples
711
+
#### MCP client configuration file examples
654
712
655
713
##### Connection String with command-line arguments
0 commit comments