Skip to content

Commit 1c0d57f

Browse files
committed
feat(mongodb): add Atlas API inputs, Docker variant, read-only support
- Add optional Atlas API Service Account credentials (client ID + secret) for Atlas management operations (cluster creation, user management, etc.) - Add Docker transport variant (com.mongodb-mcp-docker) using official mongodb/mongodb-mcp-server image - Make connection string optional (server supports runtime connect tool) - Update auth type to optional_api_key to reflect Atlas API credentials - Enable read_only_mode capability (server supports --readOnly flag) Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent 70c6db2 commit 1c0d57f

2 files changed

Lines changed: 135 additions & 5 deletions

File tree

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"$schema": "../schemas/server-definition.schema.json",
3+
"id": "com.mongodb-mcp-docker",
4+
"name": "MongoDB (Docker)",
5+
"alias": "mongodb-docker",
6+
"description": "Connect to MongoDB databases and Atlas clusters via Docker. Query collections, inspect schemas, manage indexes, and run aggregation pipelines in an isolated container.",
7+
"icon": "https://avatars.githubusercontent.com/u/11214950?v=4",
8+
"schema_version": "2.1",
9+
"categories": [
10+
"database"
11+
],
12+
"tags": [
13+
"mongodb",
14+
"database",
15+
"nosql",
16+
"atlas",
17+
"docker",
18+
"aggregation",
19+
"collections"
20+
],
21+
"transport": {
22+
"type": "stdio",
23+
"command": "docker",
24+
"args": [
25+
"run",
26+
"--rm",
27+
"-i",
28+
"-e", "MDB_MCP_CONNECTION_STRING",
29+
"-e", "MDB_MCP_API_CLIENT_ID",
30+
"-e", "MDB_MCP_API_CLIENT_SECRET",
31+
"mongodb/mongodb-mcp-server:latest"
32+
],
33+
"env": {
34+
"MDB_MCP_CONNECTION_STRING": "${input:MONGODB_URI}",
35+
"MDB_MCP_API_CLIENT_ID": "${input:ATLAS_CLIENT_ID}",
36+
"MDB_MCP_API_CLIENT_SECRET": "${input:ATLAS_CLIENT_SECRET}"
37+
},
38+
"metadata": {
39+
"inputs": [
40+
{
41+
"id": "MONGODB_URI",
42+
"label": "MongoDB Connection String",
43+
"description": "MongoDB connection URI. Use host.docker.internal instead of localhost for local instances (e.g., mongodb://host.docker.internal:27017/mydb).",
44+
"type": "text",
45+
"required": false,
46+
"secret": true,
47+
"placeholder": "mongodb+srv://username:password@cluster.mongodb.net/mydb",
48+
"obtain": {
49+
"url": "https://www.mongodb.com/docs/manual/reference/connection-string/",
50+
"instructions": "1. For MongoDB Atlas: Go to your cluster > Connect > Drivers\n2. Copy the connection string\n3. For local MongoDB inside Docker: use mongodb://host.docker.internal:27017/mydb",
51+
"button_label": "Learn More"
52+
}
53+
},
54+
{
55+
"id": "ATLAS_CLIENT_ID",
56+
"label": "Atlas API Client ID",
57+
"description": "MongoDB Atlas Service Account client ID for Atlas management operations. Optional — only needed for Atlas administration.",
58+
"type": "text",
59+
"required": false,
60+
"secret": true,
61+
"placeholder": "mdb_sa_id_..."
62+
},
63+
{
64+
"id": "ATLAS_CLIENT_SECRET",
65+
"label": "Atlas API Client Secret",
66+
"description": "MongoDB Atlas Service Account client secret. Required when Atlas API Client ID is provided.",
67+
"type": "text",
68+
"required": false,
69+
"secret": true,
70+
"placeholder": "mdb_sa_sk_..."
71+
}
72+
]
73+
}
74+
},
75+
"auth": {
76+
"type": "optional_api_key",
77+
"instructions": "Connection string provides database access. Atlas API credentials (optional) enable cluster management features."
78+
},
79+
"contributor": {
80+
"name": "MongoDB",
81+
"github": "mongodb-js",
82+
"url": "https://www.mongodb.com"
83+
},
84+
"links": {
85+
"repository": "https://github.com/mongodb-js/mongodb-mcp-server",
86+
"homepage": "https://www.mongodb.com",
87+
"documentation": "https://www.mongodb.com/docs/mcp-server/get-started/"
88+
},
89+
"platforms": [
90+
"all"
91+
],
92+
"capabilities": {
93+
"tools": true,
94+
"resources": false,
95+
"prompts": false,
96+
"read_only_mode": true
97+
},
98+
"changelog_url": "https://github.com/mongodb-js/mongodb-mcp-server/releases"
99+
}

servers/com.mongodb-mcp.json

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,60 @@
2626
"mongodb-mcp-server@latest"
2727
],
2828
"env": {
29-
"MDB_MCP_CONNECTION_STRING": "${input:MONGODB_URI}"
29+
"MDB_MCP_CONNECTION_STRING": "${input:MONGODB_URI}",
30+
"MDB_MCP_API_CLIENT_ID": "${input:ATLAS_CLIENT_ID}",
31+
"MDB_MCP_API_CLIENT_SECRET": "${input:ATLAS_CLIENT_SECRET}"
3032
},
3133
"metadata": {
3234
"inputs": [
3335
{
3436
"id": "MONGODB_URI",
3537
"label": "MongoDB Connection String",
36-
"description": "MongoDB connection URI for your database. Supports local instances, Atlas clusters, and replica sets.",
38+
"description": "MongoDB connection URI for your database. Supports local instances, Atlas clusters, and replica sets. Leave empty to use the runtime connect tool.",
3739
"type": "text",
38-
"required": true,
40+
"required": false,
3941
"secret": true,
4042
"placeholder": "mongodb+srv://username:password@cluster.mongodb.net/mydb",
4143
"obtain": {
4244
"url": "https://www.mongodb.com/docs/manual/reference/connection-string/",
4345
"instructions": "1. For MongoDB Atlas: Go to your cluster > Connect > Drivers\n2. Copy the connection string\n3. Replace <password> with your database password\n4. For local MongoDB: use mongodb://localhost:27017/mydb",
4446
"button_label": "Learn More"
4547
}
48+
},
49+
{
50+
"id": "ATLAS_CLIENT_ID",
51+
"label": "Atlas API Client ID",
52+
"description": "MongoDB Atlas Service Account client ID for Atlas management operations (create clusters, manage users, IP access lists). Optional — only needed for Atlas administration.",
53+
"type": "text",
54+
"required": false,
55+
"secret": true,
56+
"placeholder": "mdb_sa_id_...",
57+
"obtain": {
58+
"url": "https://www.mongodb.com/docs/atlas/configure-api-access/",
59+
"instructions": "1. Go to MongoDB Atlas > Organization Settings > Service Accounts\n2. Create a new Service Account with required roles\n3. Copy the Client ID",
60+
"button_label": "Configure API Access"
61+
}
62+
},
63+
{
64+
"id": "ATLAS_CLIENT_SECRET",
65+
"label": "Atlas API Client Secret",
66+
"description": "MongoDB Atlas Service Account client secret. Required when Atlas API Client ID is provided.",
67+
"type": "text",
68+
"required": false,
69+
"secret": true,
70+
"placeholder": "mdb_sa_sk_...",
71+
"obtain": {
72+
"url": "https://www.mongodb.com/docs/atlas/configure-api-access/",
73+
"instructions": "1. Go to MongoDB Atlas > Organization Settings > Service Accounts\n2. Create or select a Service Account\n3. Copy the Client Secret (shown only once at creation)",
74+
"button_label": "Configure API Access"
75+
}
4676
}
4777
]
4878
}
4979
},
5080
"auth": {
51-
"type": "none"
81+
"type": "optional_api_key",
82+
"instructions": "Connection string provides database access. Atlas API credentials (optional) enable cluster management features."
5283
},
5384
"contributor": {
5485
"name": "MongoDB",
@@ -67,7 +98,7 @@
6798
"tools": true,
6899
"resources": false,
69100
"prompts": false,
70-
"read_only_mode": false
101+
"read_only_mode": true
71102
},
72103
"changelog_url": "https://github.com/mongodb-js/mongodb-mcp-server/releases"
73104
}

0 commit comments

Comments
 (0)