Skip to content

Commit 900626a

Browse files
committed
fix: docs
1 parent fd0ebb7 commit 900626a

File tree

2 files changed

+69
-2
lines changed

2 files changed

+69
-2
lines changed

.github/workflows/docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
with:
3535
username: "${{ secrets.DOCKERHUB_USERNAME }}"
3636
password: "${{ secrets.DOCKERHUB_SECRET }}"
37-
- name: Build and push image to dockerhub staging registry
37+
- name: Build and push image to dockerhub registry
3838
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1
3939
with:
4040
context: .

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

9292
Start 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:[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+
112179
## 🛠️ Supported Tools
113180

114181
### Tool List

0 commit comments

Comments
 (0)