Skip to content

chore: remove configFile and state.json #60

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

Merged
merged 9 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 9 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow

1. Command-line arguments
2. Environment variables
3. Configuration file
4. Default values

### Configuration Options

Expand All @@ -167,6 +165,12 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
| `apiClientId` | Atlas API client ID for authentication |
| `apiClientSecret` | Atlas API client secret for authentication |
| `connectionString` | MongoDB connection string for direct database connections (optional users may choose to inform it on every tool call) |
| `logPath` | Folder to store logs |

**Default Log Path:**

- Windows: `%LOCALAPPDATA%\mongodb\mongodb-mcp\.app-logs`
- macOS/Linux: `~/.mongodb/mongodb-mcp/.app-logs`

### Atlas API Access

Expand Down Expand Up @@ -195,23 +199,6 @@ To use the Atlas API tools, you'll need to create a service account in MongoDB A

### Configuration Methods

#### Configuration File

Create a JSON configuration file at one of these locations:

- Linux/macOS: `/etc/mongodb-mcp.conf`
- Windows: `%LOCALAPPDATA%\mongodb\mongodb-mcp\mongodb-mcp.conf`

Example configuration file:

```json
{
"apiClientId": "your-atlas-client-id",
"apiClientSecret": "your-atlas-client-secret",
"connectionString": "mongodb+srv://username:[email protected]/myDatabase"
}
```

#### Environment Variables

Set environment variables with the prefix `MDB_MCP_` followed by the option name in uppercase with underscores:
Expand All @@ -223,14 +210,16 @@ export MDB_MCP_API_CLIENT_SECRET="your-atlas-client-secret"

# Set a custom MongoDB connection string
export MDB_MCP_CONNECTION_STRING="mongodb+srv://username:[email protected]/myDatabase"

export MDB_MCP_LOG_PATH="/path/to/logs"
```

#### Command-Line Arguments

Pass configuration options as command-line arguments when starting the server:

```shell
node dist/index.js --apiClientId="your-atlas-client-id" --apiClientSecret="your-atlas-client-secret" --connectionString="mongodb+srv://username:[email protected]/myDatabase"
node dist/index.js --apiClientId="your-atlas-client-id" --apiClientSecret="your-atlas-client-secret" --connectionString="mongodb+srv://username:[email protected]/myDatabase" --logPath=/path/to/logs
```

## 🤝 Contributing
Expand Down
216 changes: 0 additions & 216 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"dependencies": {
"@mongodb-js/devtools-connect": "^3.7.2",
"@mongosh/service-provider-node-driver": "^3.6.0",
"@napi-rs/keyring": "^1.1.6",
"@types/express": "^5.0.1",
"bson": "^6.10.3",
"mongodb": "^6.15.0",
Expand Down
Loading
Loading