Skip to content

Commit b60d066

Browse files
committed
Add config parameters
1 parent da40b72 commit b60d066

File tree

2 files changed

+54
-14
lines changed

2 files changed

+54
-14
lines changed

.smithery/smithery.yaml

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,52 @@ build:
44
dockerBuildPath: ../
55
startCommand:
66
type: stdio
7+
configSchema:
8+
type: object
9+
properties:
10+
atlasClientId:
11+
type: string
12+
title: Atlas Client Id
13+
description: Atlas API client ID for authentication. Required for running Atlas tools.
14+
atlasClientSecret:
15+
type: string
16+
title: Atlas Client Secret
17+
description: Atlas API client secret for authentication. Required for running Atlas tools.
18+
connectionString:
19+
type: string
20+
title: MongoDB Connection string
21+
description: MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the `connect` tool before interacting with MongoDB data.
22+
readOnly:
23+
type: boolean
24+
title: Read-only
25+
description: When set to true, only allows read and metadata operation types, disabling create/update/delete operations.
26+
727
commandFunction:
828
# A function that produces the CLI command to start the MCP on stdio.
929
|-
10-
(config) => ({
11-
"command": "node",
12-
"args": [
13-
"dist/index.js"
14-
]
15-
})
30+
(config) => {
31+
const env = {};
32+
if (config.atlasClientId) {
33+
env.MDB_MCP_API_CLIENT_ID = config.atlasClientId;
34+
}
35+
36+
if (config.atlasClientSecret) {
37+
env.MDB_MCP_API_CLIENT_SECRET = config.atlasClientSecret;
38+
}
39+
40+
if (config.readOnly) {
41+
env.MDB_MCP_READ_ONLY = true;
42+
}
43+
44+
if (config.connectionString) {
45+
env.MDB_MCP_CONNECTION_STRING = config.connectionString;
46+
}
47+
48+
return {
49+
"command": "node",
50+
"args": [
51+
"dist/index.js"
52+
],
53+
env,
54+
};
55+
}

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 |
256+
| Option | Description |
257257
| ------------------ | --------------------------------------------------------------------------------------------------------------------- |
258-
| `apiClientId` | Atlas API client ID for authentication |
259-
| `apiClientSecret` | Atlas API client secret for authentication |
260-
| `connectionString` | MongoDB connection string for direct database connections (optional users may choose to inform it on every tool call) |
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 |
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. |
260+
| `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. |
265265

266266
#### Log Path
267267

0 commit comments

Comments
 (0)