Skip to content

Commit 49707be

Browse files
chore: update readme with the new tool and resources (#468)
1 parent 0f585db commit 49707be

File tree

4 files changed

+41
-19
lines changed

4 files changed

+41
-19
lines changed

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.

src/resources/common/debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class DebugResource extends ReactiveResource<
2121
uri: "debug://mongodb",
2222
config: {
2323
description:
24-
"Debugging information for MongoDB connectivity issues. Tracks the last connectivity error and attempt information.",
24+
"Debugging information for MongoDB connectivity issues. Tracks the last connectivity attempt and error information.",
2525
},
2626
},
2727
options: {

src/tools/mongodb/read/export.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { AggregateArgs } from "./aggregate.js";
1010

1111
export class ExportTool extends MongoDBToolBase {
1212
public name = "export";
13-
protected description = "Export a collection data or query results in the specified EJSON format.";
13+
protected description = "Export a query or aggregation results in the specified EJSON format.";
1414
protected argsShape = {
1515
...DbOperationArgs,
1616
exportTitle: z.string().describe("A short description to uniquely identify the export."),

tests/integration/tools/mongodb/read/export.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describeWithMongoDB(
5353
validateToolMetadata(
5454
integration,
5555
"export",
56-
"Export a collection data or query results in the specified EJSON format.",
56+
"Export a query or aggregation results in the specified EJSON format.",
5757
[
5858
...databaseCollectionParameters,
5959
{

0 commit comments

Comments
 (0)