Skip to content

Commit 34d50d8

Browse files
authored
Merge branch 'main' into assistant-tool
2 parents 59b3c63 + 46a93cc commit 34d50d8

File tree

127 files changed

+2778
-1151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+2778
-1151
lines changed

.github/workflows/accuracy-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
MDB_ACCURACY_BASELINE_COMMIT: ${{ github.event.pull_request.base.sha || '' }}
2929
steps:
3030
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
31-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v5
3232
- uses: actions/setup-node@v4
3333
with:
3434
node-version-file: package.json

.github/workflows/check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020
- uses: actions/setup-node@v4
2121
with:
2222
node-version-file: package.json
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
33-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v5
3434
- uses: actions/setup-node@v4
3535
with:
3636
node-version-file: package.json
@@ -44,7 +44,7 @@ jobs:
4444
runs-on: ubuntu-latest
4545
steps:
4646
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
47-
- uses: actions/checkout@v4
47+
- uses: actions/checkout@v5
4848
- uses: actions/setup-node@v4
4949
with:
5050
node-version-file: package.json

.github/workflows/code_health.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
2222
if: matrix.os != 'windows-latest'
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v5
2424
- uses: actions/setup-node@v4
2525
with:
2626
node-version-file: package.json
@@ -42,7 +42,7 @@ jobs:
4242
runs-on: ubuntu-latest
4343
steps:
4444
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
45-
- uses: actions/checkout@v4
45+
- uses: actions/checkout@v5
4646
- uses: actions/setup-node@v4
4747
with:
4848
node-version-file: package.json
@@ -68,7 +68,7 @@ jobs:
6868
runs-on: ubuntu-latest
6969
needs: [run-tests, run-atlas-tests]
7070
steps:
71-
- uses: actions/checkout@v4
71+
- uses: actions/checkout@v5
7272
- uses: actions/setup-node@v4
7373
with:
7474
node-version-file: package.json

.github/workflows/code_health_fork.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
2121
if: matrix.os != 'windows-latest'
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323
- uses: actions/setup-node@v4
2424
with:
2525
node-version-file: package.json

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- javascript-typescript
2424
steps:
2525
- name: Checkout repository
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@v5
2727
- name: Initialize CodeQL
2828
uses: github/codeql-action/init@v3
2929
with:

.github/workflows/docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
config: ${{ vars.PERMISSIONS_CONFIG }}
1616
- name: Check out code
17-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
17+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
1818
- name: Set up Docker Buildx
1919
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
2020
- name: Login to Docker Hub

.github/workflows/prepare_release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
with:
2323
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
2424
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v5
2626
- uses: actions/setup-node@v4
2727
with:
2828
node-version-file: package.json

.github/workflows/publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
VERSION: ${{ steps.get-version.outputs.VERSION }}
1515
steps:
1616
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
1818
with:
1919
fetch-depth: 0
2020
- uses: actions/setup-node@v4
@@ -52,7 +52,7 @@ jobs:
5252
if: needs.check.outputs.VERSION_EXISTS == 'false'
5353
steps:
5454
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
55-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@v5
5656
- uses: actions/setup-node@v4
5757
with:
5858
node-version-file: package.json

.smithery/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
22
# ----- Build Stage -----
33
FROM node:lts-alpine AS builder
4+
5+
RUN adduser -D mcpuser
6+
USER mcpuser
7+
48
WORKDIR /app
59

610
# Copy package and configuration

README.md

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ A Model Context Protocol server for interacting with MongoDB Databases and Mongo
1515
- [🛠️ Supported Tools](#supported-tools)
1616
- [MongoDB Atlas Tools](#mongodb-atlas-tools)
1717
- [MongoDB Database Tools](#mongodb-database-tools)
18+
- [📄 Supported Resources](#supported-resources)
1819
- [⚙️ Configuration](#configuration)
1920
- [Configuration Options](#configuration-options)
2021
- [Atlas API Access](#atlas-api-access)
@@ -305,6 +306,13 @@ NOTE: atlas tools are only available when you set credentials on [configuration]
305306
- `collection-schema` - Describe the schema for a collection
306307
- `collection-storage-size` - Get the size of a collection in MB
307308
- `db-stats` - Return statistics about a MongoDB database
309+
- `export` - Export query or aggregation results to EJSON format. Creates a uniquely named export accessible via the `exported-data` resource.
310+
311+
## 📄 Supported Resources
312+
313+
- `config` - Server configuration, supplied by the user either as environment variables or as startup arguments with sensitive parameters redacted. The resource can be accessed under URI `config://config`.
314+
- `debug` - Debugging information for MongoDB connectivity issues. Tracks the last connectivity attempt and error information. The resource can be accessed under URI `debug://mongodb`.
315+
- `exported-data` - A resource template to access the data exported using the export tool. The template can be accessed under URI `exported-data://{exportName}` where `exportName` is the unique name for an export generated by the export tool.
308316

309317
## Configuration
310318

@@ -315,22 +323,25 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
315323

316324
### Configuration Options
317325

318-
| CLI Option | Environment Variable | Default | Description |
319-
| ----------------------- | --------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
320-
| `apiClientId` | `MDB_MCP_API_CLIENT_ID` | <not set> | Atlas API client ID for authentication. Required for running Atlas tools. |
321-
| `apiClientSecret` | `MDB_MCP_API_CLIENT_SECRET` | <not set> | Atlas API client secret for authentication. Required for running Atlas tools. |
322-
| `connectionString` | `MDB_MCP_CONNECTION_STRING` | <not set> | MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the `connect` tool before interacting with MongoDB data. |
323-
| `loggers` | `MDB_MCP_LOGGERS` | disk,mcp | Comma separated values, possible values are `mcp`, `disk` and `stderr`. See [Logger Options](#logger-options) for details. |
324-
| `logPath` | `MDB_MCP_LOG_PATH` | see note\* | Folder to store logs. |
325-
| `disabledTools` | `MDB_MCP_DISABLED_TOOLS` | <not set> | An array of tool names, operation types, and/or categories of tools that will be disabled. |
326-
| `readOnly` | `MDB_MCP_READ_ONLY` | false | When set to true, only allows read, connect, and metadata operation types, disabling create/update/delete operations. |
327-
| `indexCheck` | `MDB_MCP_INDEX_CHECK` | false | When set to true, enforces that query operations must use an index, rejecting queries that perform a collection scan. |
328-
| `telemetry` | `MDB_MCP_TELEMETRY` | enabled | When set to disabled, disables telemetry collection. |
329-
| `transport` | `MDB_MCP_TRANSPORT` | stdio | Either 'stdio' or 'http'. |
330-
| `httpPort` | `MDB_MCP_HTTP_PORT` | 3000 | Port number. |
331-
| `httpHost` | `MDB_MCP_HTTP_HOST` | 127.0.0.1 | Host to bind the http server. |
332-
| `idleTimeoutMs` | `MDB_MCP_IDLE_TIMEOUT_MS` | 600000 | Idle timeout for a client to disconnect (only applies to http transport). |
333-
| `notificationTimeoutMs` | `MDB_MCP_NOTIFICATION_TIMEOUT_MS` | 540000 | Notification timeout for a client to be aware of diconnect (only applies to http transport). |
326+
| CLI Option | Environment Variable | Default | Description |
327+
| ------------------------- | ------------------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
328+
| `apiClientId` | `MDB_MCP_API_CLIENT_ID` | <not set> | Atlas API client ID for authentication. Required for running Atlas tools. |
329+
| `apiClientSecret` | `MDB_MCP_API_CLIENT_SECRET` | <not set> | Atlas API client secret for authentication. Required for running Atlas tools. |
330+
| `connectionString` | `MDB_MCP_CONNECTION_STRING` | <not set> | MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the `connect` tool before interacting with MongoDB data. |
331+
| `loggers` | `MDB_MCP_LOGGERS` | disk,mcp | Comma separated values, possible values are `mcp`, `disk` and `stderr`. See [Logger Options](#logger-options) for details. |
332+
| `logPath` | `MDB_MCP_LOG_PATH` | see note\* | Folder to store logs. |
333+
| `disabledTools` | `MDB_MCP_DISABLED_TOOLS` | <not set> | An array of tool names, operation types, and/or categories of tools that will be disabled. |
334+
| `readOnly` | `MDB_MCP_READ_ONLY` | false | When set to true, only allows read, connect, and metadata operation types, disabling create/update/delete operations. |
335+
| `indexCheck` | `MDB_MCP_INDEX_CHECK` | false | When set to true, enforces that query operations must use an index, rejecting queries that perform a collection scan. |
336+
| `telemetry` | `MDB_MCP_TELEMETRY` | enabled | When set to disabled, disables telemetry collection. |
337+
| `transport` | `MDB_MCP_TRANSPORT` | stdio | Either 'stdio' or 'http'. |
338+
| `httpPort` | `MDB_MCP_HTTP_PORT` | 3000 | Port number. |
339+
| `httpHost` | `MDB_MCP_HTTP_HOST` | 127.0.0.1 | Host to bind the http server. |
340+
| `idleTimeoutMs` | `MDB_MCP_IDLE_TIMEOUT_MS` | 600000 | Idle timeout for a client to disconnect (only applies to http transport). |
341+
| `notificationTimeoutMs` | `MDB_MCP_NOTIFICATION_TIMEOUT_MS` | 540000 | Notification timeout for a client to be aware of diconnect (only applies to http transport). |
342+
| `exportsPath` | `MDB_MCP_EXPORTS_PATH` | see note\* | Folder to store exported data files. |
343+
| `exportTimeoutMs` | `MDB_MCP_EXPORT_TIMEOUT_MS` | 300000 | Time in milliseconds after which an export is considered expired and eligible for cleanup. |
344+
| `exportCleanupIntervalMs` | `MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS` | 120000 | Time in milliseconds between export cleanup cycles that remove expired export files. |
334345

335346
#### Logger Options
336347

@@ -415,6 +426,17 @@ You can enable index check mode using:
415426

416427
When index check mode is active, you'll see an error message if a query is rejected due to not using an index.
417428

429+
#### Exports
430+
431+
The data exported by the `export` tool is temporarily stored in the configured `exportsPath` on the machine running the MCP server until cleaned up by the export cleanup process. If the `exportsPath` configuration is not provided, the following defaults are used:
432+
433+
- **Windows:** `%LOCALAPPDATA%\mongodb\mongodb-mcp\exports`
434+
- **macOS/Linux:** `~/.mongodb/mongodb-mcp/exports`
435+
436+
The `exportTimeoutMs` configuration controls the time after which the exported data is considered expired and eligible for cleanup. By default, exports expire after 5 minutes (300000ms).
437+
438+
The `exportCleanupIntervalMs` configuration controls how frequently the cleanup process runs to remove expired export files. By default, cleanup runs every 2 minutes (120000ms).
439+
418440
#### Telemetry
419441

420442
The `telemetry` configuration option allows you to disable telemetry collection. When enabled, the MCP server will collect usage data and send it to MongoDB.

0 commit comments

Comments
 (0)