@@ -510,11 +510,33 @@ The MCP server provides authentication-aware error handling with structured resp
510510
511511### Security Features
512512
513+ - ** Request Size Limiting** : Configurable JSON payload size limits prevent DoS attacks (default: 2MB)
513514- ** Security Event Logging** : 401/403 errors are logged with ` [SECURITY] ` prefix for monitoring
514515- ** Error Context Preservation** : Backend API error responses are included in ` details `
515516- ** Privacy Protection** : Query parameters are stripped from URLs in error messages
516517- ** Structured Responses** : All errors return JSON with consistent format instead of throwing exceptions
517518
519+ #### Request Size Configuration
520+
521+ The server automatically limits JSON request body sizes to prevent denial-of-service attacks and memory exhaustion:
522+
523+ ``` bash
524+ # Use default 2MB limit
525+ mcp-openapi-server --http
526+
527+ # Set custom limit
528+ mcp-openapi-server --http --max-request-size 5mb
529+
530+ # Other valid formats
531+ mcp-openapi-server --max-request-size 1024kb
532+ mcp-openapi-server --max-request-size 512kb
533+ ```
534+
535+ ** Recommended limits for banking APIs:**
536+ - ** Conservative** : ` 1mb ` - Handles most banking operations with safety margin
537+ - ** Standard** : ` 2mb ` (default) - Balances security and functionality
538+ - ** Liberal** : ` 5mb ` - For batch operations or document attachments
539+
518540## OpenAPI Specification Setup
519541
520542### Custom Spec IDs
@@ -643,6 +665,7 @@ interface ServerOptions {
643665 verbose? : boolean ; // Enable verbose logging
644666 baseUrl? : string ; // Base URL for backend APIs (overrides config file)
645667 maxToolNameLength? : number ; // Maximum length for generated tool names (default: 48)
668+ maxRequestSize? : string ; // Maximum size for JSON request bodies (default: "2mb")
646669}
647670```
648671
@@ -656,6 +679,7 @@ Options:
656679 --port <number> Port for HTTP server mode (default: "4000")
657680 --base-url <url> Base URL for backend APIs (overrides config file)
658681 --max-tool-name-length <number> Maximum length for generated tool names (default: "48")
682+ --max-request-size <size> Maximum size for JSON request bodies (default: "2mb")
659683 --http Run in HTTP server mode instead of stdio (default: false)
660684 -v, --verbose Enable verbose logging (default: true)
661685 -h, --help Display help for command
0 commit comments