FrontMCP provides transport-level security controls for CORS, network binding, DNS rebinding protection, and host header validation. In development, defaults are permissive for ease of use. In production, FrontMCP logs security warnings and offers a strict mode that enables all protections at once.Documentation Index
Fetch the complete documentation index at: https://docs.agentfront.dev/llms.txt
Use this file to discover all available pages before exploring further.
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.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
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