@@ -87,7 +87,7 @@ Use your Atlas API Service Accounts credentials. Must follow all the steps in [A
8787}
8888```
8989
90- ### Option 3: Standalone Service using command arguments
90+ #### Option 3: Standalone Service using command arguments
9191
9292Start Server using npx command:
9393
@@ -109,6 +109,73 @@ You can use environment variables in the config file or set them and run the ser
109109- Connection String via environment variables in the MCP file [ example] ( #connection-string-with-environment-variables )
110110- Atlas API credentials via environment variables in the MCP file [ example] ( #atlas-api-credentials-with-environment-variables )
111111
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:password@cluster.mongodb.net/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:password@cluster.mongodb.net/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+
112179## 🛠️ Supported Tools
113180
114181### Tool List
0 commit comments