@@ -157,8 +157,6 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
157
157
158
158
1 . Command-line arguments
159
159
2 . Environment variables
160
- 3 . Configuration file
161
- 4 . Default values
162
160
163
161
### Configuration Options
164
162
@@ -167,6 +165,12 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
167
165
| ` apiClientId ` | Atlas API client ID for authentication |
168
166
| ` apiClientSecret ` | Atlas API client secret for authentication |
169
167
| ` connectionString ` | MongoDB connection string for direct database connections (optional users may choose to inform it on every tool call) |
168
+ | ` logPath ` | Folder to store logs |
169
+
170
+ ** Default Log Path:**
171
+
172
+ - Windows: ` %LOCALAPPDATA%\mongodb\mongodb-mcp\.app-logs `
173
+ - macOS/Linux: ` ~/.mongodb/mongodb-mcp/.app-logs `
170
174
171
175
### Atlas API Access
172
176
@@ -195,23 +199,6 @@ To use the Atlas API tools, you'll need to create a service account in MongoDB A
195
199
196
200
### Configuration Methods
197
201
198
- #### Configuration File
199
-
200
- Create a JSON configuration file at one of these locations:
201
-
202
- - Linux/macOS: ` /etc/mongodb-mcp.conf `
203
- - Windows: ` %LOCALAPPDATA%\mongodb\mongodb-mcp\mongodb-mcp.conf `
204
-
205
- Example configuration file:
206
-
207
- ``` json
208
- {
209
- "apiClientId" : " your-atlas-client-id" ,
210
- "apiClientSecret" : " your-atlas-client-secret" ,
211
- "connectionString" :
" mongodb+srv://username:[email protected] /myDatabase"
212
- }
213
- ```
214
-
215
202
#### Environment Variables
216
203
217
204
Set environment variables with the prefix ` MDB_MCP_ ` followed by the option name in uppercase with underscores:
@@ -223,14 +210,16 @@ export MDB_MCP_API_CLIENT_SECRET="your-atlas-client-secret"
223
210
224
211
# Set a custom MongoDB connection string
225
212
export MDB_MCP_CONNECTION_STRING=
" mongodb+srv://username:[email protected] /myDatabase"
213
+
214
+ export MDB_MCP_LOG_PATH=" /path/to/logs"
226
215
```
227
216
228
217
#### Command-Line Arguments
229
218
230
219
Pass configuration options as command-line arguments when starting the server:
231
220
232
221
``` shell
233
- node dist/index.js --apiClientId=
" your-atlas-client-id" --apiClientSecret=
" your-atlas-client-secret" --connectionString=
" mongodb+srv://username:[email protected] /myDatabase"
222
+ node dist/index.js --apiClientId=
" your-atlas-client-id" --apiClientSecret=
" your-atlas-client-secret" --connectionString=
" mongodb+srv://username:[email protected] /myDatabase" --logPath=/path/to/logs
234
223
```
235
224
236
225
## 🤝 Contributing
0 commit comments