diff --git a/README.md b/README.md index b61353bc..f696f2a2 100644 --- a/README.md +++ b/README.md @@ -345,37 +345,37 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow ### Configuration Options -| CLI Option | Environment Variable | Default | Description | -| -------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowRequestOverrides` | `MDB_MCP_ALLOW_REQUEST_OVERRIDES` | `false` | When set to true, allows configuration values to be overridden via request headers and query parameters. | -| `apiClientId` | `MDB_MCP_API_CLIENT_ID` | `` | Atlas API client ID for authentication. Required for running Atlas tools. | -| `apiClientSecret` | `MDB_MCP_API_CLIENT_SECRET` | `` | Atlas API client secret for authentication. Required for running Atlas tools. | -| `atlasTemporaryDatabaseUserLifetimeMs` | `MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS` | `14400000` | Time in milliseconds that temporary database users created when connecting to MongoDB Atlas clusters will remain active before being automatically deleted. | -| `confirmationRequiredTools` | `MDB_MCP_CONFIRMATION_REQUIRED_TOOLS` | `"atlas-create-access-list,atlas-create-db-user,drop-database,drop-collection,delete-many,drop-index"` | Comma separated values of tool names that require user confirmation before execution. Requires the client to support elicitation. | -| `connectionString` | `MDB_MCP_CONNECTION_STRING` | `` | MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the connect tool before interacting with MongoDB data. | -| `disabledTools` | `MDB_MCP_DISABLED_TOOLS` | `""` | Comma separated values of tool names, operation types, and/or categories of tools that will be disabled. | -| `dryRun` | `MDB_MCP_DRY_RUN` | `false` | When true, runs the server in dry mode: dumps configuration and enabled tools, then exits without starting the server. | -| `embeddingsValidation` | `MDB_MCP_EMBEDDINGS_VALIDATION` | `true` | When set to false, disables validation of embeddings dimensions. | -| `exportCleanupIntervalMs` | `MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS` | `120000` | Time in milliseconds between export cleanup cycles that remove expired export files. | -| `exportTimeoutMs` | `MDB_MCP_EXPORT_TIMEOUT_MS` | `300000` | Time in milliseconds after which an export is considered expired and eligible for cleanup. | -| `exportsPath` | `MDB_MCP_EXPORTS_PATH` | see below\* | Folder to store exported data files. | -| `httpHeaders` | `MDB_MCP_HTTP_HEADERS` | `"{}"` | Header that the HTTP server will validate when making requests (only used when transport is 'http'). | -| `httpHost` | `MDB_MCP_HTTP_HOST` | `"127.0.0.1"` | Host address to bind the HTTP server to (only used when transport is 'http'). | -| `httpPort` | `MDB_MCP_HTTP_PORT` | `3000` | Port number for the HTTP server (only used when transport is 'http'). Use 0 for a random port. | -| `idleTimeoutMs` | `MDB_MCP_IDLE_TIMEOUT_MS` | `600000` | Idle timeout for a client to disconnect (only applies to http transport). | -| `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. | -| `logPath` | `MDB_MCP_LOG_PATH` | see below\* | Folder to store logs. | -| `loggers` | `MDB_MCP_LOGGERS` | `"disk,mcp"` see below\* | Comma separated values of logger types. | -| `maxBytesPerQuery` | `MDB_MCP_MAX_BYTES_PER_QUERY` | `16777216` | The maximum size in bytes for results from a find or aggregate tool call. This serves as an upper bound for the responseBytesLimit parameter in those tools. | -| `maxDocumentsPerQuery` | `MDB_MCP_MAX_DOCUMENTS_PER_QUERY` | `100` | The maximum number of documents that can be returned by a find or aggregate tool call. For the find tool, the effective limit will be the smaller of this value and the tool's limit parameter. | -| `notificationTimeoutMs` | `MDB_MCP_NOTIFICATION_TIMEOUT_MS` | `540000` | Notification timeout for a client to be aware of disconnect (only applies to http transport). | -| `previewFeatures` | `MDB_MCP_PREVIEW_FEATURES` | `""` | Comma separated values of preview features that are enabled. | -| `readOnly` | `MDB_MCP_READ_ONLY` | `false` | When set to true, only allows read, connect, and metadata operation types, disabling create/update/delete operations. | -| `telemetry` | `MDB_MCP_TELEMETRY` | `"enabled"` | When set to disabled, disables telemetry collection. | -| `transport` | `MDB_MCP_TRANSPORT` | `"stdio"` | Either 'stdio' or 'http'. | -| `vectorSearchDimensions` | `MDB_MCP_VECTOR_SEARCH_DIMENSIONS` | `1024` | Default number of dimensions for vector search embeddings. | -| `vectorSearchSimilarityFunction` | `MDB_MCP_VECTOR_SEARCH_SIMILARITY_FUNCTION` | `"euclidean"` | Default similarity function for vector search: 'euclidean', 'cosine', or 'dotProduct'. | -| `voyageApiKey` | `MDB_MCP_VOYAGE_API_KEY` | `""` | API key for Voyage AI embeddings service (required for vector search operations with text-to-embedding conversion). | +| Option | Default | Description | +| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `MDB_MCP_ALLOW_REQUEST_OVERRIDES` or `--allowRequestOverrides` | `false` | When set to true, allows configuration values to be overridden via request headers and query parameters. | +| `MDB_MCP_API_CLIENT_ID` or `--apiClientId` | `` | Atlas API client ID for authentication. Required for running Atlas tools. | +| `MDB_MCP_API_CLIENT_SECRET` or `--apiClientSecret` | `` | Atlas API client secret for authentication. Required for running Atlas tools. | +| `MDB_MCP_ATLAS_TEMPORARY_DATABASE_USER_LIFETIME_MS` or `--atlasTemporaryDatabaseUserLifetimeMs` | `14400000` | Time in milliseconds that temporary database users created when connecting to MongoDB Atlas clusters will remain active before being automatically deleted. | +| `MDB_MCP_CONFIRMATION_REQUIRED_TOOLS` or `--confirmationRequiredTools` | `"atlas-create-access-list,atlas-create-db-user,drop-database,drop-collection,delete-many,drop-index"` | Comma separated values of tool names that require user confirmation before execution. Requires the client to support elicitation. | +| `MDB_MCP_CONNECTION_STRING` or `--connectionString` | `` | MongoDB connection string for direct database connections. Optional, if not set, you'll need to call the connect tool before interacting with MongoDB data. | +| `MDB_MCP_DISABLED_TOOLS` or `--disabledTools` | `""` | Comma separated values of tool names, operation types, and/or categories of tools that will be disabled. | +| `MDB_MCP_DRY_RUN` or `--dryRun` | `false` | When true, runs the server in dry mode: dumps configuration and enabled tools, then exits without starting the server. | +| `MDB_MCP_EMBEDDINGS_VALIDATION` or `--embeddingsValidation` | `true` | When set to false, disables validation of embeddings dimensions. | +| `MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS` or `--exportCleanupIntervalMs` | `120000` | Time in milliseconds between export cleanup cycles that remove expired export files. | +| `MDB_MCP_EXPORT_TIMEOUT_MS` or `--exportTimeoutMs` | `300000` | Time in milliseconds after which an export is considered expired and eligible for cleanup. | +| `MDB_MCP_EXPORTS_PATH` or `--exportsPath` | see below\* | Folder to store exported data files. | +| `MDB_MCP_HTTP_HEADERS` or `--httpHeaders` | `"{}"` | Header that the HTTP server will validate when making requests (only used when transport is 'http'). | +| `MDB_MCP_HTTP_HOST` or `--httpHost` | `"127.0.0.1"` | Host address to bind the HTTP server to (only used when transport is 'http'). | +| `MDB_MCP_HTTP_PORT` or `--httpPort` | `3000` | Port number for the HTTP server (only used when transport is 'http'). Use 0 for a random port. | +| `MDB_MCP_IDLE_TIMEOUT_MS` or `--idleTimeoutMs` | `600000` | Idle timeout for a client to disconnect (only applies to http transport). | +| `MDB_MCP_INDEX_CHECK` or `--indexCheck` | `false` | When set to true, enforces that query operations must use an index, rejecting queries that perform a collection scan. | +| `MDB_MCP_LOG_PATH` or `--logPath` | see below\* | Folder to store logs. | +| `MDB_MCP_LOGGERS` or `--loggers` | `"disk,mcp"` see below\* | Comma separated values of logger types. | +| `MDB_MCP_MAX_BYTES_PER_QUERY` or `--maxBytesPerQuery` | `16777216` | The maximum size in bytes for results from a find or aggregate tool call. This serves as an upper bound for the responseBytesLimit parameter in those tools. | +| `MDB_MCP_MAX_DOCUMENTS_PER_QUERY` or `--maxDocumentsPerQuery` | `100` | The maximum number of documents that can be returned by a find or aggregate tool call. For the find tool, the effective limit will be the smaller of this value and the tool's limit parameter. | +| `MDB_MCP_NOTIFICATION_TIMEOUT_MS` or `--notificationTimeoutMs` | `540000` | Notification timeout for a client to be aware of disconnect (only applies to http transport). | +| `MDB_MCP_PREVIEW_FEATURES` or `--previewFeatures` | `""` | Comma separated values of preview features that are enabled. | +| `MDB_MCP_READ_ONLY` or `--readOnly` | `false` | When set to true, only allows read, connect, and metadata operation types, disabling create/update/delete operations. | +| `MDB_MCP_TELEMETRY` or `--telemetry` | `"enabled"` | When set to disabled, disables telemetry collection. | +| `MDB_MCP_TRANSPORT` or `--transport` | `"stdio"` | Either 'stdio' or 'http'. | +| `MDB_MCP_VECTOR_SEARCH_DIMENSIONS` or `--vectorSearchDimensions` | `1024` | Default number of dimensions for vector search embeddings. | +| `MDB_MCP_VECTOR_SEARCH_SIMILARITY_FUNCTION` or `--vectorSearchSimilarityFunction` | `"euclidean"` | Default similarity function for vector search: 'euclidean', 'cosine', or 'dotProduct'. | +| `MDB_MCP_VOYAGE_API_KEY` or `--voyageApiKey` | `""` | API key for Voyage AI embeddings service (required for vector search operations with text-to-embedding conversion). | #### Logger Options diff --git a/scripts/generateArguments.ts b/scripts/generateArguments.ts index 2fccd8c1..9032d4c6 100644 --- a/scripts/generateArguments.ts +++ b/scripts/generateArguments.ts @@ -262,15 +262,15 @@ function updateServerJsonEnvVars(envVars: ArgumentInfo[]): void { function generateReadmeConfigTable(argumentInfos: ArgumentInfo[]): string { const rows = [ - "| CLI Option | Environment Variable | Default | Description |", - "| -------------------------------------- | --------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |", + "| Option | Default | Description |", + "| -------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |", ]; // Filter to only include options that are in the Zod schema (documented options) const documentedVars = argumentInfos.filter((v) => !v.description.startsWith("Configuration option:")); for (const argumentInfo of documentedVars) { - const cliOption = `\`${argumentInfo.configKey}\``; + const cliOption = `\`--${argumentInfo.configKey}\``; const envVarName = `\`${argumentInfo.name}\``; const defaultValue = argumentInfo.defaultValue; @@ -302,7 +302,7 @@ function generateReadmeConfigTable(argumentInfos: ArgumentInfo[]): string { const desc = argumentInfo.description.replace(/\|/g, "\\|"); // Escape pipes in description rows.push( - `| ${cliOption.padEnd(38)} | ${envVarName.padEnd(51)} | ${defaultValueString.padEnd(75)} | ${desc.padEnd(199)} |` + `| ${`${envVarName} or ${cliOption}`.padEnd(89)} | ${defaultValueString.padEnd(75)} | ${desc.padEnd(199)} |` ); } @@ -316,7 +316,7 @@ function updateReadmeConfigTable(envVars: ArgumentInfo[]): void { const newTable = generateReadmeConfigTable(envVars); // Find and replace the configuration options table - const tableRegex = /### Configuration Options\n\n\| CLI Option[\s\S]*?\n\n####/; + const tableRegex = /### Configuration Options\n\n\| Option[\s\S]*?\n\n####/; const replacement = `### Configuration Options\n\n${newTable}\n\n####`; content = content.replace(tableRegex, replacement);