Skip to content

Commit 240e199

Browse files
committed
update
1 parent 525e589 commit 240e199

File tree

1 file changed

+52
-74
lines changed

1 file changed

+52
-74
lines changed

README.md

Lines changed: 52 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,101 @@
11
# MongoDB MCP Server
22

3-
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-
3+
A Model Context Protocol server for interacting with MongoDB Databases and MongoDB Atlas.
54

65
## 📚 Table of Contents
76

87
- [🚀 Getting Started](#getting-started)
98
- [Prerequisites](#prerequisites)
10-
- [Installation](#installation)
11-
- [WindSurf](#windsurf)
12-
- [VSCode](#vscode)
13-
- [Claude Desktop](#claude)
9+
- [Setup](#setup)
10+
- [Quick Start](#quick-start)
1411
- [🛠️ Supported Tools](#supported-tools)
15-
- [Tool List](#tool-list)
12+
- [MongoDB Atlas Tools](#mongodb-atlas-tools)
13+
- [MongoDB Database Tools](#mongodb-database-tools)
1614
- [⚙️ Configuration](#configuration)
1715
- [Configuration Options](#configuration-options)
16+
- [Connection Options](#configuration-options)
17+
- [Log Path](#log-path)
18+
- [Disabled Tools](#disabled-tools)
19+
- [Read-Only Mode](#read-only-mode)
20+
- [Telemetry Settings](#telemetry)
1821
- [Atlas API Access](#atlas-api-access)
1922
- [Configuration Methods](#configuration-methods)
20-
- [👩‍💻 Client Integration](#client-integration)
21-
- [WindSurf](#windsurf)
22-
- [VSCode](#vscode)
23-
- [Claude](#claude)
23+
- [Environment Variables](#environment-variables)
24+
- [Command-Line Arguments](#command-line-arguments)
25+
- [MCP Client Configuration](#mcp-configuration-file-examples)
2426
- [🤝 Contributing](#contributing)
2527

2628
## Prerequisites
2729

2830
- Node.js (v20 or later)
29-
- MongoDB Atlas account
3031

31-
## Installation
32+
```shell
33+
node -v
34+
```
3235

33-
Common prerequisites:
36+
- A MongoDB connection string or Atlas API credentials, **_the Server will not start unless configured_**.
37+
- **_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.
38+
- If you have a MongoDB connection string, you can use it directly to connect to your MongoDB instance.
3439

35-
- Node.js v20.x
36-
- A MongoDB connection string or Atlas API credentials, the Server will not start unless configured, see [configuration](#configuration) section for more details.
40+
## Setup
3741

38-
### WindSurf
42+
### Quick Start
3943

40-
The latest instructions can be found at https://docs.windsurf.com/windsurf/mcp
44+
Most MCP clients require a configuration file to be created or modified to add the MCP server.
4145

42-
Step 1: Create MCP configuration file
46+
- **Windsurf** ([latest instructions](https://docs.windsurf.com/windsurf/mcp)): Save the file in `~/.codeium/windsurf/mcp_config.json`
47+
- **VSCode**: https://docs.codeium.com/docs/mcp
48+
- **Claude Desktop**: https://modelcontextprotocol.io/quickstart/user
49+
- **Cursor**: follow https://docs.cursor.com/context/model-context-protocol
4350

44-
Create or edit the configuration file at `~/.codeium/windsurf/mcp_config.json`:
51+
#### Option 1: Connection String args
52+
53+
You can pass your connection string via args, make sure to use a valid username and password.
4554

4655
```json
4756
{
4857
"servers": {
4958
"MongoDB": {
5059
"command": "npx",
51-
"args": ["-y", "mongodb-mcp-server"]
60+
"args": [
61+
"-y",
62+
"mongodb-mcp-server",
63+
"--connectionString",
64+
"mongodb+srv://username:[email protected]/myDatabase"
65+
]
5266
}
5367
}
5468
}
5569
```
5670

57-
Step 2: Setup a connection string or Atlas API credentials
58-
59-
- Option 1: Connection String via args [example](#connection-string-with-args)
60-
- Option 2: Atlas API credentials via args [example](#atlas-api-credentials-with-args)
61-
- Option 3: Connection String via environment variables [example](#connection-string-with-environment-variables)
62-
- Option 4: Atlas API credentials via environment variables [example](#atlas-api-credentials-with-environment-variables)
63-
64-
### VSCode
65-
66-
Step 1: Add the mcp server to VSCode configuration
67-
68-
- Press `Cmd + Shift + P` and type `MCP: Add MCP Server` and select it.
69-
- Select command (Stdio).
70-
- Input command `npx -y mongodb-mcp-server`.
71-
- Choose between user / workspace
72-
- Add arguments to the file
73-
74-
Note: the file should look like:
75-
76-
```
77-
{
78-
"servers": {
79-
"MongoDB": {
80-
"type": "stdio",
81-
"command": "npx",
82-
"args": [
83-
"-y",
84-
"mongodb-mcp-server"
85-
]
86-
}
87-
}
88-
}
89-
```
90-
91-
Step 2: Setup a connection string or Atlas API credentials
92-
93-
- Option 1: Connection String via args [example](#connection-string-with-args)
94-
- Option 2: Atlas API credentials via args [example](#atlas-api-credentials-with-args)
95-
- Option 3: Connection String via environment variables [example](#connection-string-with-environment-variables)
96-
- Option 4: Atlas API credentials via environment variables [example](#atlas-api-credentials-with-environment-variables)
71+
#### Option 2: Atlas API credentials args
9772

98-
### Claude Desktop
99-
100-
Step 1: Launch Claude Settings -> Developer -> Edit Config
101-
102-
Paste the mcp server configuration into the file
73+
Use your Atlas API Service Account credentials. More details in the [Atlas API Access](#atlas-api-access) section.
10374

10475
```json
10576
{
106-
"mcpServers": {
77+
"servers": {
10778
"MongoDB": {
10879
"command": "npx",
109-
"args": ["-y", "mongodb-mcp-server"]
80+
"args": [
81+
"-y",
82+
"mongodb-mcp-server",
83+
"--apiClientId",
84+
"your-atlas-client-id",
85+
"--apiClientSecret",
86+
"your-atlas-client-secret"
87+
]
11088
}
11189
}
11290
}
11391
```
11492

115-
Step 2: Setup a connection string or Atlas API credentials
93+
#### Other options
94+
95+
Alternatively you can use environment variables in the config file or set them and run the server via npx.
11696

117-
- Option 1: Connection String via args [example](#connection-string-with-args)
118-
- Option 2: Atlas API credentials via args [example](#atlas-api-credentials-with-args)
119-
- Option 3: Connection String via environment variables [example](#connection-string-with-environment-variables)
120-
- Option 4: Atlas API credentials via environment variables [example](#atlas-api-credentials-with-environment-variables)
97+
- Connection String via environment variables [example](#connection-string-with-environment-variables)
98+
- Atlas API credentials via environment variables [example](#atlas-api-credentials-with-environment-variables)
12199

122100
## 🛠️ Supported Tools
123101

@@ -181,7 +159,7 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
181159
| `readOnly` | When set to true, only allows read and metadata operation types, disabling create/update/delete operations |
182160
| `telemetry` | When set to disabled, disables telemetry collection |
183161

184-
#### `logPath`
162+
#### Log Path
185163

186164
Default log location is as follows:
187165

0 commit comments

Comments
 (0)