Quick Start
Createfrontmcp.config.ts in your project root:
defineConfig() helper is a pass-through that enables IDE type hints and autocomplete.
File Resolution Order
FrontMCP locates the config file in this precedence order (issue #400):- Explicit
--config <path>flag on any command. FRONTMCP_CONFIGenv var.- Upward walk from
cwdto the nearest ancestor containing afrontmcp.config.*file (caps at 10 levels — monorepo nested apps no longer requirecd <repo-root>). - Fallback: derives minimal config from
package.json(name, default node target).
frontmcp.config.tsfrontmcp.config.jsfrontmcp.config.jsonfrontmcp.config.mjsfrontmcp.config.cjs
Override precedence
For every CLI option that’s also expressible in the config, the effective value is computed as:frontmcp dev --port 5000 always wins, regardless of transport.http.port in the config. With no flag, the resolver reads transport.http.port, then falls back to the framework default (3000).
When using JSON format, add
"$schema" for autocomplete in VS Code and WebStorm:Top-Level Fields
Per-command consumption (issue #400)
Transport defaults
Env overlays
shared applies everywhere; mode overlays (dev, test, ship) layer on top:
.env and .env.local (loaded by dev) still win over config overlays — file-based env is the deployment escape hatch.
Client snippets
Deployment Targets
Each entry indeployments defines a build target with independent settings:
Deployment Target Fields
MCPB-Only Fields
Themcpb target supports additional fields for MCP Bundle metadata:
Server Configuration
HTTP Options
CSP Options
Security Headers
HA Configuration
Multi-Target Example
Deploy the same server to Node.js, distributed, and Vercel:Project-Defined CLI Commands
The optionalcli.commands block registers project-specific verbs that
ship alongside the built-in frontmcp commands. Each verb spawns a
runner module from the project (TS or JS) as a child process, so the
project’s own code stays out of the CLI’s process.
Verb names must match /^[a-zA-Z][a-zA-Z0-9:_-]*$/ — start with a letter,
then letters, digits, :, _, or -. Examples: deploy, db-migrate,
project:init. Names that match a built-in verb (see Reserved Verbs
below) are rejected at config load.
Each command entry accepts:
frontmcp --help:
Reserved Verbs
Verb names that collide with a built-in command (dev, build, test,
start, skills, etc.) are rejected at config-load time with a helpful
message. Use a project-namespaced prefix (e.g. project:init,
db-migrate) to avoid the collision.
Runner Selection
The runner receives the parsed positionals as argv plus a
FRONTMCP_PROJECT_COMMAND env var containing a JSON payload with
verb, positionals, options, and cwd for richer scripting.
Helper Functions
Related
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