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.
FrontMCP uses a typed configuration file to define project settings, deployment targets, server configuration, and security policies. The file supports TypeScript, JavaScript, and JSON formats with full IDE autocomplete.
Quick Start
Create frontmcp.config.ts in your project root:
import { defineConfig } from ' @frontmcp/cli ' ;
export default defineConfig ({
name : ' my-server ' ,
deployments : [{ target : ' node ' }],
});
The defineConfig() helper is a pass-through that enables IDE type hints and autocomplete.
File Resolution Order
FrontMCP searches for configuration files in this order:
frontmcp.config.ts
frontmcp.config.js
frontmcp.config.json
frontmcp.config.mjs
frontmcp.config.cjs
Fallback: derives minimal config from package.json (name, default node target)
When using JSON format, add "$schema" for autocomplete in VS Code and WebStorm: {
" $schema " : " ./node_modules/@frontmcp/cli/frontmcp.schema.json " ,
" name " : " my-server " ,
" deployments " : [{ " target " : " node " }]
}
Top-Level Fields
Field Type Required Description namestring Yes Server name (kebab-case, no spaces) versionstring No Server version entrystring No Custom entry file path nodeVersionstring No Target Node.js version deploymentsDeploymentTarget[] Yes One or more deployment targets buildobject No Build-specific options (esbuild config, dependencies)
Deployment Targets
Each entry in deployments defines a build target with independent settings:
Target Description Transport Storage nodeStandalone Node.js server Streamable HTTP, SSE, stdio Redis, SQLite, memory distributedMulti-pod with HA Streamable HTTP Redis (required) vercelVercel Functions Streamable HTTP Vercel KV lambdaAWS Lambda Streamable HTTP DynamoDB, ElastiCache cloudflareCloudflare Workers Streamable HTTP KV, Durable Objects browserBrowser bundle In-memory Memory only cliStandalone binary stdio SQLite, memory sdkLibrary for embedding Direct (in-process) Configurable mcpbMCP Bundle archive (see MCPB ) stdio SQLite, memory
Deployment Target Fields
Field Type Description targetstring One of the 9 target types above serverServerConfig HTTP, CORS, CSP, and security header settings haHaConfig HA settings (distributed target only) cliCliConfig CLI-specific settings (cli target only) jsboolean Generate .js bundle instead of native binary (cli target) envRecord Per-target environment variables
MCPB-Only Fields
The mcpb target supports additional fields for MCP Bundle metadata:
Field Type Description displayNamestring Human-friendly bundle title shown in the installer longDescriptionstring Markdown description for the extension details page author{ name, email?, url? }Overrides parsed package.json.author licensestring SPDX license identifier homepagestring Project homepage URL repositorystring | { type, url } Source repository documentationstring Documentation URL supportstring Support / issues URL iconstring Icon path relative to project root (PNG) keywordsstring[] Keywords for client search privacyPoliciesstring[] Privacy policy URLs for external services this server talks to compatibilityobject { claude_desktop?, platforms?, runtimes? } constraintsuserConfigRecord MCPB user_config overrides (type, min/max, etc.) — merged with translated setup.steps sea{ enabled?, mergeFrom? }Build SEA binary for the host and/or merge pre-built binaries includeNodeModulesboolean Include server/node_modules/ in the archive (off by default) deterministicboolean Produce byte-identical archives across runs (defaults to true)
Server Configuration
export default defineConfig ({
name : ' my-server ' ,
deployments : [{
target : ' node ' ,
server : {
http : {
port : 3000 ,
socketPath : ' /tmp/mcp.sock ' , // Unix socket (mutually exclusive with port)
entryPath : ' / ' ,
cors : {
origin : ' https://app.example.com ' ,
credentials : true ,
},
portRange : [ 3000 , 3010 ], // Auto-find available port in range
},
csp : {
enabled : true ,
directives : {
' default-src ' : " 'self' " ,
' script-src ' : " 'self' https://cdn.example.com " ,
},
reportUri : ' https://report.example.com/csp ' ,
reportOnly : false ,
},
headers : {
hsts : ' max-age=31536000; includeSubDomains ' ,
contentTypeOptions : ' nosniff ' ,
frameOptions : ' DENY ' ,
},
cookies : {
secure : true ,
sameSite : ' Lax ' ,
},
},
}],
});
HTTP Options
Field Type Default Description portnumber 3000 HTTP listen port socketPathstring --- Unix socket path (overrides port) entryPathstring /Base path for all endpoints corsobject --- CORS configuration (origin, credentials) portRange[number, number] --- Auto-find available port in range
CSP Options
Field Type Default Description enabledboolean false Enable CSP headers directivesRecord --- Directive name to value(s) map (e.g., { 'default-src': "'self'" }) reportUristring --- URI for CSP violation reports reportOnlyboolean false Use Content-Security-Policy-Report-Only header
Field Type Default Description hstsstring --- Strict-Transport-Security valuecontentTypeOptionsstring nosniffX-Content-Type-Options valueframeOptionsstring DENYX-Frame-Options value
HA Configuration
Field Type Default Description heartbeatIntervalMsnumber 10000 Heartbeat write interval heartbeatTtlMsnumber 30000 Heartbeat TTL (2-3x interval) takeoverGracePeriodMsnumber 5000 Grace period before takeover redisKeyPrefixstring mcp:ha:Redis key prefix
Multi-Target Example
Deploy the same server to Node.js, distributed, and Vercel:
import { defineConfig } from ' @frontmcp/cli ' ;
export default defineConfig ({
name : ' my-server ' ,
version : ' 1.0.0 ' ,
deployments : [
{
target : ' node ' ,
server : { http : { port : 3000 } },
},
{
target : ' distributed ' ,
ha : { heartbeatIntervalMs : 5000 },
server : {
csp : {
enabled : true ,
directives : { ' default-src ' : " 'self' " , ' upgrade-insecure-requests ' : '' },
},
headers : { hsts : ' max-age=31536000; includeSubDomains ' },
},
},
{
target : ' vercel ' ,
},
],
});
Build each target independently:
frontmcp build --target node
frontmcp build --target distributed
frontmcp build --target vercel
Helper Functions
import { defineConfig , loadFrontMcpConfig , findDeployment , getDeploymentTargets } from ' @frontmcp/cli ' ;
// Load config from a directory
const config = await loadFrontMcpConfig ( process . cwd ());
// Find a specific deployment target
const distributed = findDeployment ( config , ' distributed ' );
// List all configured targets
const targets = getDeploymentTargets ( config ); // ['node', 'distributed', 'vercel']
Production Build Build and deploy guide
High Availability Multi-pod deployment with session failover
Security Headers CSP and security header configuration
Runtime Modes Standalone, distributed, and serverless modes