Skip to content

Commit d022bc3

Browse files
committed
Handle missing config
1 parent 0d9d297 commit d022bc3

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

.smithery/smithery.yaml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,25 @@ startCommand:
3434
|-
3535
(config) => {
3636
const args = ['dist/index.js'];
37-
if (config.atlasClientId) {
38-
args.push('--apiClientId');
39-
args.push(config.atlasClientId);
40-
}
37+
if (config) {
38+
if (config.atlasClientId) {
39+
args.push('--apiClientId');
40+
args.push(config.atlasClientId);
41+
}
4142

42-
if (config.atlasClientSecret) {
43-
args.push('--apiClientSecret');
44-
args.push(config.atlasClientSecret);
45-
}
43+
if (config.atlasClientSecret) {
44+
args.push('--apiClientSecret');
45+
args.push(config.atlasClientSecret);
46+
}
4647

47-
if (config.readOnly) {
48-
args.push('--readOnly');
49-
}
48+
if (config.readOnly) {
49+
args.push('--readOnly');
50+
}
5051

51-
if (config.connectionString) {
52-
args.push('--connectionString');
53-
args.push(config.connectionString);
52+
if (config.connectionString) {
53+
args.push('--connectionString');
54+
args.push(config.connectionString);
55+
}
5456
}
5557

5658
return {

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,15 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
253253

254254
### Configuration Options
255255

256-
| Option | Description |
257-
| ------------------ | --------------------------------------------------------------------------------------------------------------------- |
258-
| `apiClientId` | Atlas API client ID for authentication. Required for running Atlas tools. |
259-
| `apiClientSecret` | Atlas API client secret for authentication. Required for running Atlas tools. |
256+
| Option | Description |
257+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
258+
| `apiClientId` | Atlas API client ID for authentication. Required for running Atlas tools. |
259+
| `apiClientSecret` | Atlas API client secret for authentication. Required for running Atlas tools. |
260260
| `connectionString` | MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the `connect` tool before interacting with MongoDB data. |
261-
| `logPath` | Folder to store logs. |
262-
| `disabledTools` | An array of tool names, operation types, and/or categories of tools that will be disabled. |
263-
| `readOnly` | When set to true, only allows read and metadata operation types, disabling create/update/delete operations. |
264-
| `telemetry` | When set to disabled, disables telemetry collection. |
261+
| `logPath` | Folder to store logs. |
262+
| `disabledTools` | An array of tool names, operation types, and/or categories of tools that will be disabled. |
263+
| `readOnly` | When set to true, only allows read and metadata operation types, disabling create/update/delete operations. |
264+
| `telemetry` | When set to disabled, disables telemetry collection. |
265265

266266
#### Log Path
267267

0 commit comments

Comments
 (0)