Skip to content

Commit 86cfd03

Browse files
chore: add examples for cmd and pwsh
1 parent 3965349 commit 86cfd03

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ export MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
114114
npx -y mongodb-mcp-server@latest --readOnly
115115
```
116116

117+
> **💡 Platform Note:** The examples above use Unix/Linux/macOS syntax. For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
118+
117119
- For a complete list of configuration options see [Configuration Options](#configuration-options)
118120
- To configure your Atlas Service Accounts credentials please refer to [Atlas API Access](#atlas-api-access)
119121
- Connection String via environment variables in the MCP file [example](#connection-string-with-environment-variables)
@@ -147,6 +149,8 @@ docker run --rm -i \
147149
mongodb/mongodb-mcp-server:latest
148150
```
149151

152+
> **💡 Platform Note:** The examples above use Unix/Linux/macOS syntax. For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
153+
150154
##### Option C: With Atlas API credentials
151155

152156
```shell
@@ -162,6 +166,8 @@ docker run --rm -i \
162166
mongodb/mongodb-mcp-server:latest
163167
```
164168

169+
> **💡 Platform Note:** The examples above use Unix/Linux/macOS syntax. For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
170+
165171
##### Docker in MCP Configuration File
166172

167173
Without options:
@@ -370,6 +376,8 @@ You can combine multiple loggers, e.g. `--loggers disk stderr` or `export MDB_MC
370376
export MDB_MCP_LOGGERS="disk,stderr"
371377
```
372378

379+
> **💡 Platform Note:** For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
380+
373381
##### Example: Set logger via command-line argument
374382

375383
```shell
@@ -420,6 +428,8 @@ You can enable read-only mode using:
420428
- **Environment variable**: `export MDB_MCP_READ_ONLY=true`
421429
- **Command-line argument**: `--readOnly`
422430

431+
> **💡 Platform Note:** For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
432+
423433
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.
424434

425435
#### Index Check Mode
@@ -433,6 +443,8 @@ You can enable index check mode using:
433443
- **Environment variable**: `export MDB_MCP_INDEX_CHECK=true`
434444
- **Command-line argument**: `--indexCheck`
435445

446+
> **💡 Platform Note:** For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
447+
436448
When index check mode is active, you'll see an error message if a query is rejected due to not using an index.
437449

438450
#### Exports
@@ -456,6 +468,8 @@ You can disable telemetry using:
456468
- **Command-line argument**: `--telemetry disabled`
457469
- **DO_NOT_TRACK environment variable**: `export DO_NOT_TRACK=1`
458470

471+
> **💡 Platform Note:** For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
472+
459473
### Atlas API Access
460474

461475
To use the Atlas API tools, you'll need to create a service account in MongoDB Atlas:
@@ -509,16 +523,43 @@ For a full list of roles and their privileges, see the [Atlas User Roles documen
509523

510524
Set environment variables with the prefix `MDB_MCP_` followed by the option name in uppercase with underscores:
511525

512-
```shell
526+
**Linux/macOS (bash/zsh):**
527+
528+
```bash
513529
# Set Atlas API credentials (via Service Accounts)
514530
export MDB_MCP_API_CLIENT_ID="your-atlas-service-accounts-client-id"
515531
export MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
516532

517533
# Set a custom MongoDB connection string
518534
export MDB_MCP_CONNECTION_STRING="mongodb+srv://username:[email protected]/myDatabase"
519535

536+
# Set log path
520537
export MDB_MCP_LOG_PATH="/path/to/logs"
538+
```
539+
540+
**Windows Command Prompt (cmd):**
521541

542+
```cmd
543+
set "MDB_MCP_API_CLIENT_ID=your-atlas-service-accounts-client-id"
544+
set "MDB_MCP_API_CLIENT_SECRET=your-atlas-service-accounts-client-secret"
545+
546+
set "MDB_MCP_CONNECTION_STRING=mongodb+srv://username:[email protected]/myDatabase"
547+
548+
set "MDB_MCP_LOG_PATH=C:\path\to\logs"
549+
```
550+
551+
**Windows PowerShell:**
552+
553+
```powershell
554+
# Set Atlas API credentials (via Service Accounts)
555+
$env:MDB_MCP_API_CLIENT_ID="your-atlas-service-accounts-client-id"
556+
$env:MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret"
557+
558+
# Set a custom MongoDB connection string
559+
$env:MDB_MCP_CONNECTION_STRING="mongodb+srv://username:[email protected]/myDatabase"
560+
561+
# Set log path
562+
$env:MDB_MCP_LOG_PATH="C:\path\to\logs"
522563
```
523564

524565
#### MCP configuration file examples
@@ -572,6 +613,8 @@ export MDB_MCP_CONNECTION_STRING="mongodb+srv://username:[email protected]
572613
npx -y mongodb-mcp-server@latest --logPath=/path/to/logs --readOnly --indexCheck
573614
```
574615

616+
> **💡 Platform Note:** The examples above use Unix/Linux/macOS syntax. For Windows users, see [Environment Variables](#environment-variables) for platform-specific instructions.
617+
575618
#### MCP configuration file examples
576619

577620
##### Connection String with command-line arguments

0 commit comments

Comments
 (0)