Skip to content

Commit 3965349

Browse files
chore: minor fixup
1 parent 15a2f62 commit 3965349

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -574,34 +574,45 @@ npx -y mongodb-mcp-server@latest --logPath=/path/to/logs --readOnly --indexCheck
574574

575575
#### MCP configuration file examples
576576

577-
##### Connection String with environment variables
577+
##### Connection String with command-line arguments
578+
579+
> **🔒 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)
578580
579581
```json
580582
{
581583
"mcpServers": {
582584
"MongoDB": {
583585
"command": "npx",
584-
"args": ["-y", "mongodb-mcp-server", "--readOnly"],
585-
"env": {
586-
"MDB_MCP_CONNECTION_STRING": "mongodb+srv://username:[email protected]/myDatabase"
587-
}
586+
"args": [
587+
"-y",
588+
"mongodb-mcp-server",
589+
"--connectionString",
590+
"mongodb+srv://username:[email protected]/myDatabase",
591+
"--readOnly"
592+
]
588593
}
589594
}
590595
}
591596
```
592597

593-
##### Atlas API credentials with environment variables
598+
##### Atlas API credentials with command-line arguments
599+
600+
> **🔒 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)
594601
595602
```json
596603
{
597604
"mcpServers": {
598605
"MongoDB": {
599606
"command": "npx",
600-
"args": ["-y", "mongodb-mcp-server", "--readOnly"],
601-
"env": {
602-
"MDB_MCP_API_CLIENT_ID": "your-atlas-service-accounts-client-id",
603-
"MDB_MCP_API_CLIENT_SECRET": "your-atlas-service-accounts-client-secret"
604-
}
607+
"args": [
608+
"-y",
609+
"mongodb-mcp-server",
610+
"--apiClientId",
611+
"your-atlas-service-accounts-client-id",
612+
"--apiClientSecret",
613+
"your-atlas-service-accounts-client-secret",
614+
"--readOnly"
615+
]
605616
}
606617
}
607618
}

0 commit comments

Comments
 (0)