@@ -89,7 +89,7 @@ Use your Atlas API Service Accounts credentials. Must follow all the steps in [A
89
89
}
90
90
```
91
91
92
- ### Option 3: Standalone Service using command arguments
92
+ #### Option 3: Standalone Service using command arguments
93
93
94
94
Start Server using npx command:
95
95
@@ -111,6 +111,95 @@ You can use environment variables in the config file or set them and run the ser
111
111
- Connection String via environment variables in the MCP file [ example] ( #connection-string-with-environment-variables )
112
112
- Atlas API credentials via environment variables in the MCP file [ example] ( #atlas-api-credentials-with-environment-variables )
113
113
114
+ #### Option 5: Using Docker
115
+
116
+ You can run the MongoDB MCP Server in a Docker container, which provides isolation and doesn't require a local Node.js installation.
117
+
118
+ #### Run with Environment Variables
119
+
120
+ You may provide either a MongoDB connection string OR Atlas API credentials:
121
+
122
+ ##### Option A: No configuration
123
+
124
+ ``` shell
125
+ docker run --rm -i \
126
+ mongodb/mongodb-mcp-server:latest
127
+ ```
128
+
129
+ ##### Option B: With MongoDB connection string
130
+
131
+ ``` shell
132
+ docker run --rm -i \
133
+ -e MDB_MCP_CONNECTION_STRING=
" mongodb+srv://username:[email protected] /myDatabase" \
134
+ mongodb/mongodb-mcp-server:latest
135
+ ```
136
+
137
+ ##### Option C: With Atlas API credentials
138
+
139
+ ``` shell
140
+ docker run --rm -i \
141
+ -e MDB_MCP_API_CLIENT_ID=" your-atlas-service-accounts-client-id" \
142
+ -e MDB_MCP_API_CLIENT_SECRET=" your-atlas-service-accounts-client-secret" \
143
+ mongodb/mongodb-mcp-server:latest
144
+ ```
145
+
146
+ ##### Docker in MCP Configuration File
147
+
148
+ Without options:
149
+
150
+ ``` json
151
+ {
152
+ "mcpServers" : {
153
+ "MongoDB" : {
154
+ "command" : " docker" ,
155
+ "args" : [" run" , " --rm" , " -i" , " mongodb/mongodb-mcp-server:latest" ]
156
+ }
157
+ }
158
+ }
159
+ ```
160
+
161
+ With connection string:
162
+
163
+ ``` json
164
+ {
165
+ "mcpServers" : {
166
+ "MongoDB" : {
167
+ "command" : " docker" ,
168
+ "args" : [
169
+ " run" ,
170
+ " --rm" ,
171
+ " -i" ,
172
+ " -e" ,
173
+ " MDB_MCP_CONNECTION_STRING=mongodb+srv://username:[email protected] /myDatabase" ,
174
+ " mongodb/mongodb-mcp-server:latest"
175
+ ]
176
+ }
177
+ }
178
+ }
179
+ ```
180
+
181
+ With Atlas API credentials:
182
+
183
+ ``` json
184
+ {
185
+ "mcpServers" : {
186
+ "MongoDB" : {
187
+ "command" : " docker" ,
188
+ "args" : [
189
+ " run" ,
190
+ " --rm" ,
191
+ " -i" ,
192
+ " -e" ,
193
+ " MDB_MCP_API_CLIENT_ID=your-atlas-service-accounts-client-id" ,
194
+ " -e" ,
195
+ " MDB_MCP_API_CLIENT_SECRET=your-atlas-service-accounts-client-secret" ,
196
+ " mongodb/mongodb-mcp-server:latest"
197
+ ]
198
+ }
199
+ }
200
+ }
201
+ ```
202
+
114
203
## 🛠️ Supported Tools
115
204
116
205
### Tool List
0 commit comments