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