Quick Start
Enable strict security mode for production:Security Options
| Field | Type | Default | Description |
|---|---|---|---|
security.strict | boolean | false | Enable all security features at once |
security.bindAddress | 'loopback' | 'all' | string | '0.0.0.0' | Network bind address |
security.dnsRebindingProtection.enabled | boolean | false | Validate Host and Origin headers |
security.dnsRebindingProtection.allowedHosts | string[] | --- | Allowed Host header values |
security.dnsRebindingProtection.allowedOrigins | string[] | --- | Allowed Origin header values |
CORS Configuration
By default, FrontMCP uses permissive CORS (origin: true) for development convenience. In production, you should restrict origins explicitly:
Bind Address
Controls which network interface the server listens on:| Value | Binds To | Use Case |
|---|---|---|
'loopback' | 127.0.0.1 | Local-only access (development, reverse proxy) |
'all' | 0.0.0.0 | All interfaces (distributed pods, direct access) |
| IP string | Specific IP | Custom network binding |
Strict Mode Behavior
Whensecurity.strict: true:
- Standalone mode: binds to
127.0.0.1(loopback only) - Distributed mode: binds to
0.0.0.0(pods need external access)
Explicit Override
DNS Rebinding Protection
Validates the HTTPHost and Origin headers against an allowlist. When a request arrives with an unrecognized host, the server responds with 403 Forbidden.
allowedHosts: Matches theHostheader exactly (include port if non-standard)allowedOrigins: Matches theOriginheader exactly (include scheme)- If
allowedOriginsis set, requests without anOriginheader are allowed through (non-browser clients)
DNS rebinding attacks use a malicious domain that resolves to
127.0.0.1, tricking a browser into making requests to your local server. Host validation blocks these requests.Request Body Limits
FrontMCP’s Express host applies a default request body limit of'4mb' to
both express.json() and express.urlencoded() — lifting body-parser’s
silent 100KB default, which routinely rejected base64-encoded blobs (PDFs,
DOCXes, large HTML inputs) before they reached MCP tool handlers (issue
#410). Override the limits via the http block on @FrontMcp:
| Option | Type | Default | Notes |
|---|---|---|---|
bodyLimit | number | string | '4mb' | Accepts bytes (number) or body-parser strings ('4mb', '500kb', '2gb', …). |
urlencodedLimit | number | string | falls back to bodyLimit | Independent override for application/x-www-form-urlencoded bodies. |
hostFactory users build their own Express app and are
not affected by bodyLimit/urlencodedLimit — those options are
consumed only by the built-in ExpressHostAdapter. Custom-host
deployments must configure their own body limits.
Security Audit Warnings
In production (NODE_ENV=production) or distributed mode, FrontMCP logs security warnings at startup:
Production Checklist
- Set explicit
cors.origin(nottrue) - Enable
security.dnsRebindingProtectionwithallowedHosts - Set
security.bindAddressto'loopback'if behind a reverse proxy - Configure TLS termination at the reverse proxy layer
- Set
NODE_ENV=productionfor security audit warnings - Review startup logs for
[Security]warnings - Tune
http.bodyLimitto your largest legitimate payload
Example: Full Production Config
Related
Security Headers & CSP
Content Security Policy, HSTS, and X-Frame-Options
High Availability
Distributed sessions, heartbeat, and session takeover
Redis Setup
Redis connection and session store configuration
Production Build
Build and deploy for production