You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Model Context Protocol server for interacting with MongoDB Atlas. This project implements a Model Context Protocol (MCP) server enabling AI assistants to interact with MongoDB Atlas resources through natural language.
4
-
5
-
> [!CAUTION]
6
-
> Do not use this in production. This is a work in progress and is not intended for production use. It is meant for demonstration purposes only.
3
+
A Model Context Protocol server for interacting with MongoDB Databases and MongoDB Atlas.
- A MongoDB connection string or Atlas API credentials, **_the Server will not start unless configured_**.
32
+
-**_Atlas API credentials_** are required to use the Atlas tools. You can create a service account in MongoDB Atlas and use its credentials for authentication. See [Atlas API Access](#atlas-api-access) for more details.
33
+
- If you have a MongoDB connection string, you can use it directly to connect to your MongoDB instance.
34
34
35
-
Prerequisites:
35
+
## Setup
36
36
37
-
- Node.js v20.x
37
+
### Quick Start
38
38
39
-
Step 1: Add the mcp server to VSCode configuration
39
+
Most MCP clients require a configuration file to be created or modified to add the MCP server.
40
40
41
-
- Press `Cmd + Shift + P` and type `MCP: Add MCP Server` and select it.
##### Atlas API credentials with command-line arguments
319
+
320
+
```json
321
+
{
322
+
"servers": {
323
+
"MongoDB": {
324
+
"command": "npx",
325
+
"args": [
326
+
"-y",
327
+
"mongodb-mcp-server",
328
+
"--apiClientId",
329
+
"your-atlas-client-id",
330
+
"--apiClientSecret",
331
+
"your-atlas-client-secret"
332
+
]
333
+
}
334
+
}
335
+
}
336
+
```
337
+
261
338
## 🤝 Contributing
262
339
263
340
Interested in contributing? Great! Please check our [Contributing Guide](CONTRIBUTING.md) for guidelines on code contributions, standards, adding new tools, and troubleshooting information.
username: z.string().describe("Username for the new user"),
14
-
password: z.string().describe("Password for the new user"),
15
+
// Models will generate overly simplistic passwords like SecurePassword123 or
16
+
// AtlasPassword123, which are easily guessable and exploitable. We're instructing
17
+
// the model not to try and generate anything and instead leave the field unset.
18
+
password: z
19
+
.string()
20
+
.optional()
21
+
.nullable()
22
+
.describe(
23
+
"Password for the new user. If the user hasn't supplied an explicit password, leave it unset and under no circumstances try to generate a random one. A secure password will be generated by the MCP server if necessary."
24
+
),
15
25
roles: z
16
26
.array(
17
27
z.object({
@@ -34,6 +44,11 @@ export class CreateDBUserTool extends AtlasToolBase {
0 commit comments