Skip to main content
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:
The 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):
  1. Explicit --config <path> flag on any command.
  2. FRONTMCP_CONFIG env var.
  3. Upward walk from cwd to the nearest ancestor containing a frontmcp.config.* file (caps at 10 levels — monorepo nested apps no longer require cd <repo-root>).
  4. Fallback: derives minimal config from package.json (name, default node target).
Within a directory, the matching extensions are tried in this order:
  1. frontmcp.config.ts
  2. frontmcp.config.js
  3. frontmcp.config.json
  4. frontmcp.config.mjs
  5. frontmcp.config.cjs

Override precedence

For every CLI option that’s also expressible in the config, the effective value is computed as:
Example: 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:
Note: .env and .env.local (loaded by dev) still win over config overlays — file-based env is the deployment escape hatch.

Client snippets

Emit a ready-to-paste snippet:

Deployment Targets

Each entry in deployments defines a build target with independent settings:

Deployment Target Fields

MCPB-Only Fields

The mcpb 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:
Build each target independently:

Project-Defined CLI Commands

The optional cli.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:
After saving the config, the new verbs show up under Project Commands in 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

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