-
Notifications
You must be signed in to change notification settings - Fork 85
chore: update config docs #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
c5d5c13
b4f0395
735d1dd
1fb6375
525e589
240e199
6282952
aa4bf7b
484390d
78705ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -10,6 +10,7 @@ A Model Context Protocol server for interacting with MongoDB Atlas. This project | |||||
- [🚀 Getting Started](#getting-started) | ||||||
- [Prerequisites](#prerequisites) | ||||||
- [Installation](#installation) | ||||||
- [WindSurf](#windsurf) | ||||||
- [VSCode](#vscode) | ||||||
- [Claude Desktop](#claude) | ||||||
- [🛠️ Supported Tools](#supported-tools) | ||||||
|
@@ -19,6 +20,7 @@ A Model Context Protocol server for interacting with MongoDB Atlas. This project | |||||
- [Atlas API Access](#atlas-api-access) | ||||||
- [Configuration Methods](#configuration-methods) | ||||||
- [👩💻 Client Integration](#client-integration) | ||||||
- [WindSurf](#windsurf) | ||||||
- [VSCode](#vscode) | ||||||
- [Claude](#claude) | ||||||
- [🤝 Contributing](#contributing) | ||||||
|
@@ -30,11 +32,38 @@ A Model Context Protocol server for interacting with MongoDB Atlas. This project | |||||
|
||||||
## Installation | ||||||
|
||||||
### VSCode | ||||||
|
||||||
Prerequisites: | ||||||
Common prerequisites: | ||||||
|
||||||
- Node.js v20.x | ||||||
- A MongoDB connection string or Atlas API credentials, the Server will not start unless configured, see [configuration](#configuration) section for more details. | ||||||
|
||||||
### WindSurf | ||||||
|
||||||
The latest instructions can be found at https://docs.windsurf.com/windsurf/mcp | ||||||
|
||||||
Step 1: Create MCP configuration file | ||||||
|
||||||
Create or edit the configuration file at `~/.codeium/windsurf/mcp_config.json`: | ||||||
|
||||||
```json | ||||||
{ | ||||||
"servers": { | ||||||
"MongoDB": { | ||||||
"command": "npx", | ||||||
"args": ["-y", "mongodb-mcp-server"] | ||||||
} | ||||||
} | ||||||
} | ||||||
``` | ||||||
|
||||||
Step 2: Setup a connection string or Atlas API credentials | ||||||
|
||||||
- Option 1: Connection String via args [example](#connection-string-with-args) | ||||||
- Option 2: Atlas API credentials via args [example](#atlas-api-credentials-with-args) | ||||||
- Option 3: Connection String via environment variables [example](#connection-string-with-environment-variables) | ||||||
- Option 4: Atlas API credentials via environment variables [example](#atlas-api-credentials-with-environment-variables) | ||||||
|
||||||
### VSCode | ||||||
|
||||||
Step 1: Add the mcp server to VSCode configuration | ||||||
|
||||||
|
@@ -61,19 +90,16 @@ Note: the file should look like: | |||||
} | ||||||
``` | ||||||
|
||||||
Notes: You can configure the server with atlas access, make sure to follow configuration section for more details. | ||||||
|
||||||
Step 2: Try talking to github copilot | ||||||
Step 2: Setup a connection string or Atlas API credentials | ||||||
|
||||||
- Can you connect to my mongodb instance? | ||||||
- Option 1: Connection String via args [example](#connection-string-with-args) | ||||||
- Option 2: Atlas API credentials via args [example](#atlas-api-credentials-with-args) | ||||||
- Option 3: Connection String via environment variables [example](#connection-string-with-environment-variables) | ||||||
- Option 4: Atlas API credentials via environment variables [example](#atlas-api-credentials-with-environment-variables) | ||||||
|
||||||
### Claude Desktop | ||||||
|
||||||
Step 1: Install claude and login | ||||||
|
||||||
Note: follow instructions at https://claude.ai/download | ||||||
|
||||||
Step 2: Launch Claude Settings -> Developer -> Edit Config | ||||||
Step 1: Launch Claude Settings -> Developer -> Edit Config | ||||||
|
||||||
Paste the mcp server configuration into the file | ||||||
|
||||||
|
@@ -88,9 +114,12 @@ Paste the mcp server configuration into the file | |||||
} | ||||||
``` | ||||||
|
||||||
Step 3: Close and Relaunch Claude Desktop and click on the hammer icon, the MongoDB MCP server should be detected. | ||||||
Step 2: Setup a connection string or Atlas API credentials | ||||||
|
||||||
You may experiment asking `Can you connect to my mongodb instance?`. | ||||||
- Option 1: Connection String via args [example](#connection-string-with-args) | ||||||
- Option 2: Atlas API credentials via args [example](#atlas-api-credentials-with-args) | ||||||
- Option 3: Connection String via environment variables [example](#connection-string-with-environment-variables) | ||||||
- Option 4: Atlas API credentials via environment variables [example](#atlas-api-credentials-with-environment-variables) | ||||||
|
||||||
## 🛠️ Supported Tools | ||||||
|
||||||
|
@@ -250,6 +279,41 @@ export MDB_MCP_LOG_PATH="/path/to/logs" | |||||
|
||||||
``` | ||||||
|
||||||
#### MCP configuration file examples | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The section title 'MCP configuration file examples' is used again at a later section (line 296). Consider consolidating these examples or using distinct subheadings to clearly differentiate between configuration methods for environment variables and command-line arguments.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
|
||||||
##### Connection String with environment variables | ||||||
|
||||||
```json | ||||||
{ | ||||||
"servers": { | ||||||
"MongoDB": { | ||||||
"command": "npx", | ||||||
"args": ["-y", "mongodb-mcp-server"], | ||||||
"env": { | ||||||
"MDB_MCP_CONNECTION_STRING": "mongodb+srv://username:[email protected]/myDatabase" | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
``` | ||||||
|
||||||
##### Atlas API credentials with environment variables | ||||||
|
||||||
```json | ||||||
{ | ||||||
"servers": { | ||||||
"MongoDB": { | ||||||
"command": "npx", | ||||||
"args": ["-y", "mongodb-mcp-server"], | ||||||
"env": { | ||||||
"MDB_MCP_API_CLIENT_ID": "your-atlas-client-id", | ||||||
"MDB_MCP_API_CLIENT_SECRET": "your-atlas-client-secret" | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
``` | ||||||
|
||||||
#### Command-Line Arguments | ||||||
|
||||||
Pass configuration options as command-line arguments when starting the server: | ||||||
|
@@ -258,6 +322,48 @@ Pass configuration options as command-line arguments when starting the server: | |||||
npx -y mongodb-mcp-server --apiClientId="your-atlas-client-id" --apiClientSecret="your-atlas-client-secret" --connectionString="mongodb+srv://username:[email protected]/myDatabase" --logPath=/path/to/logs | ||||||
``` | ||||||
|
||||||
#### MCP configuration file examples | ||||||
|
||||||
##### Connection String with command-line arguments | ||||||
|
||||||
```json | ||||||
{ | ||||||
"servers": { | ||||||
"MongoDB": { | ||||||
"command": "npx", | ||||||
"args": [ | ||||||
"-y", | ||||||
"mongodb-mcp-server", | ||||||
"--connectionString", | ||||||
"mongodb+srv://username:[email protected]/myDatabase", | ||||||
"--logPath", | ||||||
blva marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
"/path/to/logs" | ||||||
] | ||||||
} | ||||||
} | ||||||
} | ||||||
``` | ||||||
|
||||||
##### Atlas API credentials with command-line arguments | ||||||
|
||||||
```json | ||||||
{ | ||||||
"servers": { | ||||||
"MongoDB": { | ||||||
"command": "npx", | ||||||
"args": [ | ||||||
"-y", | ||||||
"mongodb-mcp-server", | ||||||
"--apiClientId", | ||||||
"your-atlas-client-id", | ||||||
"--apiClientSecret", | ||||||
"your-atlas-client-secret" | ||||||
] | ||||||
} | ||||||
} | ||||||
} | ||||||
``` | ||||||
|
||||||
## 🤝 Contributing | ||||||
|
||||||
Interested in contributing? Great! Please check our [Contributing Guide](CONTRIBUTING.md) for guidelines on code contributions, standards, adding new tools, and troubleshooting information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blva - as i understood, if you don't have the atlas API token OR a connection string here, the server will basically not start, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, updated