You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add httpBodyLimit config option for HTTP transport
Adds a new configuration option to control the maximum size of HTTP request
bodies when using the HTTP transport. This addresses PayloadTooLargeError
issues when clients send large JSON payloads.
- Default value: 100kb (Express.js default)
- Supports formats like '100kb', '1mb', '50mb'
- Only applies when transport is 'http'
Includes:
- Unit tests for config parsing (CLI and env vars)
- Integration tests for body limit enforcement
- Updated configOverrides test for not-allowed fields
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -364,6 +364,7 @@ The MongoDB MCP Server can be configured using multiple methods, with the follow
364
364
|`MDB_MCP_EXPORT_CLEANUP_INTERVAL_MS` / `--exportCleanupIntervalMs`|`120000`| Time in milliseconds between export cleanup cycles that remove expired export files. |
365
365
|`MDB_MCP_EXPORT_TIMEOUT_MS` / `--exportTimeoutMs`|`300000`| Time in milliseconds after which an export is considered expired and eligible for cleanup. |
366
366
|`MDB_MCP_EXPORTS_PATH` / `--exportsPath`| see below\*| Folder to store exported data files. |
367
+
|`MDB_MCP_HTTP_BODY_LIMIT` / `--httpBodyLimit`|`"100kb"`| Maximum size of the HTTP request body (only used when transport is 'http'). Supports formats like '100kb', '1mb', '50mb'. |
367
368
|`MDB_MCP_HTTP_HEADERS` / `--httpHeaders`|`"{}"`| Header that the HTTP server will validate when making requests (only used when transport is 'http'). |
368
369
|`MDB_MCP_HTTP_HOST` / `--httpHost`|`"127.0.0.1"`| Host address to bind the HTTP server to (only used when transport is 'http'). |
369
370
|`MDB_MCP_HTTP_PORT` / `--httpPort`|`3000`| Port number for the HTTP server (only used when transport is 'http'). Use 0 for a random port. |
.regex(/^\d+(?:kb|mb|gb)$/i,"Invalid httpBodyLimit: must be a string like '100kb', '1mb', or '1gb'")
132
+
.default("100kb")
133
+
.describe(
134
+
"Maximum size of the HTTP request body (only used when transport is 'http'). Supports formats like '100kb', '1mb', '50mb'. This is the Express.js json() middleware limit."
0 commit comments