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
Copy file name to clipboardExpand all lines: README.md
+29-10Lines changed: 29 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
-
[](https://insiders.vscode.dev/redirect/mcp/install?name=mongodb&inputs=%5B%7B%22id%22%3A%22connection_string%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22MongoDB%20connection%20string%22%7D%5D&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mongodb-mcp-server%22%5D%2C%22env%22%3A%7B%22MDB_MCP_CONNECTION_STRING%22%3A%22%24%7Binput%3Aconnection_string%7D%22%7D%7D)
2
-
[](https://cursor.com/install-mcp?name=MongoDB&config=eyJjb21tYW5kIjoibnB4IC15IG1vbmdvZGItbWNwLXNlcnZlciJ9)
1
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=mongodb&inputs=%5B%7B%22id%22%3A%22connection_string%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22MongoDB%20connection%20string%22%7D%5D&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22mongodb-mcp-server%22%2C%22--readOnly%22%5D%2C%22env%22%3A%7B%22MDB_MCP_CONNECTION_STRING%22%3A%22%24%7Binput%3Aconnection_string%7D%22%7D%7D)
2
+
[](cursor://anysphere.cursor-deeplink/mcp/install?name=MongoDB&config=eyJjb21tYW5kIjoibnB4IC15IG1vbmdvZGItbWNwLXNlcnZlciAtLXJlYWRPbmx5In0%3D)
3
3
[](https://smithery.ai/server/@mongodb-js/mongodb-mcp-server)
4
4
5
5
# MongoDB MCP Server
@@ -42,7 +42,7 @@ node -v
42
42
43
43
### Quick Start
44
44
45
-
> **Note:** When using Atlas API credentials, be sure to assign only the minimum required permissions to your service account. See [Atlas API Permissions](#atlas-api-permissions) for details.
45
+
**Note:** When using Atlas API credentials, be sure to assign only the minimum required permissions to your service account. See [Atlas API Permissions](#atlas-api-permissions) for details.
46
46
47
47
Most MCP clients require a configuration file to be created or modified to add the MCP server.
48
48
@@ -53,6 +53,8 @@ Note: The configuration file syntax can be different across clients. Please refe
> **Default Safety Notice:** All examples below include `--readOnly` by default to ensure safe, read-only access to your data. Remove `--readOnly` if you need to enable write operations.
57
+
56
58
#### Option 1: Connection String args
57
59
58
60
You can pass your connection string via args, make sure to use a valid username and password.
@@ -66,7 +68,8 @@ You can pass your connection string via args, make sure to use a valid username
66
68
"-y",
67
69
"mongodb-mcp-server",
68
70
"--connectionString",
69
-
"mongodb://localhost:27017/myDatabase"
71
+
"mongodb://localhost:27017/myDatabase",
72
+
"--readOnly"
70
73
]
71
74
}
72
75
}
@@ -90,7 +93,8 @@ Use your Atlas API Service Accounts credentials. Must follow all the steps in [A
90
93
"--apiClientId",
91
94
"your-atlas-service-accounts-client-id",
92
95
"--apiClientSecret",
93
-
"your-atlas-service-accounts-client-secret"
96
+
"your-atlas-service-accounts-client-secret",
97
+
"--readOnly"
94
98
]
95
99
}
96
100
}
@@ -102,7 +106,7 @@ Use your Atlas API Service Accounts credentials. Must follow all the steps in [A
0 commit comments