界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

frontmcp-config

frontmcp-config

【开发与工程】Use when configuring a FrontMCP server through frontmcp.config or the @FrontMcp options. Covers auth modes (public, transparent, local, remote), OAuth plus credential vault and secureStore, CORS, HTTP port / entry-path prefix / unix socket, security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options), rate limiting / throttling / concurrency…

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

Aagentfront / frontmcpApache-2.0

技能说明

GitHub

name: frontmcp-config description: 'Use when configuring a FrontMCP server through frontmcp.config or the @FrontMcp options. Covers auth modes (public, transparent, local, remote), OAuth plus credential vault and secureStore, CORS, HTTP port / entry-path prefix / unix socket, security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options), rate limiting / throttling / concurrency / timeout / IP filtering (GuardConfig), session storage (Redis, Vercel KV), client transport protocols (SSE, Streamable HTTP, stateless, protocol presets), elicitation, multi-target build config, and skillsConfig (HTTP catalog, caching, audit log, instruction injection). Triggers: configure auth, set up CORS, add rate limiting, throttle requests, manage sessions, choose transport, set HTTP options, configure JWT or OAuth. The skill for server CONFIGURATION.' when_to_use: | Trigger when creating or editing frontmcp.config.ts/js or the @FrontMcp({...}) options: configuring auth modes, OAuth + credential vault, CORS, HTTP port / entry path / unix socket, security headers, rate limiting / throttling / GuardConfig, session storage (Redis, Vercel KV), client transport / protocol presets, elicitation, multi-target builds, or skillsConfig. paths: '**/frontmcp.config.*' tags: [router, config, transport, http, auth, session, redis, sqlite, throttle, guide] category: config targets: [all] bundle: [recommended, full] priority: 10 visibility: both license: Apache-2.0 metadata: docs: https://frontmcp.dev/reference

FrontMCP Configuration Router

Entry point for configuring FrontMCP servers. This skill helps you find the right configuration reference (under references/) based on what aspect of your server you need to set up.

When to Use This Skill

Must Use

  • Setting up a new server and need to understand which configuration options exist
  • Deciding between authentication modes, transport protocols, or storage backends
  • Planning server configuration across transport, auth, throttling, and storage

Recommended

  • Looking up which reference covers a specific config option (CORS, rate limits, session TTL, etc.)
  • Understanding how configuration layers work (server-level vs app-level vs tool-level)
  • Reviewing the full configuration surface area before production deployment

Skip When

  • You already know which config area to change (go directly to configure-transport, configure-auth, etc.)
  • You need to build components, not configure the server (see frontmcp-development)
  • You need to deploy, not configure (see frontmcp-deployment)

Decision: Use this skill when you need to figure out WHAT to configure. Open the matching reference under references/ directly when you already know.

Prerequisites

  • A FrontMCP project scaffolded with frontmcp create (see frontmcp-setup)
  • Node.js 24+ and npm/yarn installed

Steps

  1. Identify the configuration area you need using the Scenario Routing Table below
  2. Navigate to the specific configuration reference (e.g., references/configure-transport.md, references/configure-auth.md) for detailed instructions
  3. Apply the configuration in your @FrontMcp or @App decorator
  4. Verify using the Verification Checklist at the end of this skill

Scenario Routing Table

ScenarioReferenceDescription
Choose between SSE, Streamable HTTP, or stdioconfigure-transportTransport protocol selection with distributed session options
Set up CORS, port, base path, or request limitsconfigure-httpHTTP server options for Streamable HTTP and SSE transports
Add rate limiting, concurrency, or IP filteringconfigure-throttleServer-level and per-tool throttle configuration
Enable tools to ask users for inputconfigure-elicitationElicitation schemas, stores, and multi-step flows
Set up authentication (public, transparent, local, remote)configure-authOAuth flows, credential vault, multi-app auth
Configure session storage backendsconfigure-sessionMemory, Redis, Vercel KV, and custom session stores
Add Redis for production storagesetup-redisDocker Redis, Vercel KV, pub/sub for distributed subscriptions
Add SQLite for local developmentsetup-sqliteSQLite with WAL mode, migration helpers
Understand auth mode details (public/transparent/local/remote)configure-auth-modesAuthentication mode details (public, transparent, local, remote)
Fine-tune guard configuration for throttlingconfigure-throttle-guard-configAdvanced guard configuration for throttling
Use transport protocol presetsconfigure-transport-protocol-presetsTransport protocol preset configurations
Configure multi-target deployments and frontmcp.config.tsconfigure-deployment-targetsTyped config with defineConfig(), 9 deployment targets, JSON schema
Add CSP, HSTS, X-Frame-Options, and other security headersconfigure-security-headersCSP directives, report-only mode, HSTS preload, custom headers
Configure skills HTTP, instructions injection, or audit logconfigure-skills-httpFull skillsConfig reference: auth, cache, instructions, audit log
Split apps into separate scopes (splitByApp)decorators-guidePer-app scope and basePath isolation on @FrontMcp
Enable widget-to-host communication (ext-apps)decorators-guideextApps host capabilities, session validation, widget comms
Enable background jobs and workflowsdecorators-guidejobs: { enabled: true, store? } on @FrontMcp
Configure pagination for list operationsdecorators-guidepagination defaults for tools/list endpoint
Configure npm/ESM package loader for remote appsdecorators-guideloader config for App.esm() / App.remote() resolution

Configuration Layers

FrontMCP configuration cascades through three layers:

Server (@FrontMcp)     ← Global defaults
  └── App (@App)       ← App-level overrides
       └── Tool (@Tool) ← Per-tool overrides
SettingServer (@FrontMcp)App (@App)Tool (@Tool)
TransportYesNoNo
HTTP (CORS, port)YesNoNo
Throttle (rate limit)Yes (throttle global defaults)NoYes (rateLimit, concurrency, timeout)
Auth modeYesYes (override)No
Auth providersNoYes (authProviders)Yes (authProviders)
Session storeYesNoNo
ElicitationYes (enable: elicitation)NoYes (usage: this.elicit())
ExtAppsYesNoNo
Jobs / WorkflowsYes (jobs: { enabled })NoNo
PaginationYesNoNo
SplitByAppYesNoNo

Cross-Cutting Patterns

PatternRule
Auth + sessionAuth mode determines session requirements: remote needs Redis/KV; public can use memory
Transport + storageStateless transports (serverless) require distributed storage; stateful (Node) can use in-process
Throttle scopeServer-level throttle applies to all tools; per-tool throttle overrides for specific tools
Environment configUse environment variables for all secrets (API keys, Redis URLs, OAuth credentials)
Config validationFrontMCP validates config at startup; invalid config throws before the server starts

Common Patterns

PatternCorrectIncorrectWhy
Auth mode for devauth: { mode: 'public' } or auth: { mode: 'transparent', provider: '...' } locallyauth: { mode: 'remote', ... } with real OAuth in devRemote auth requires a running OAuth provider; public/transparent are simpler for local dev
Session storeRedis for production, memory for developmentMemory for productionMemory sessions are lost on restart and don't work across serverless invocations
Rate limit placementServer-level for global limits, per-tool for expensive operationsOnly server-levelSome tools are cheap (list) and some are expensive (generate); per-tool limits prevent abuse of expensive tools
CORS configExplicit allowed origins in productioncors: { origin: '*' } in productionWildcard CORS allows any origin to call your server
Config secretsprocess.env.REDIS_URL via environment variableHardcoded redis://localhost:6379 in sourceHardcoded secrets leak to git and break in different environments

Verification Checklist

Transport and HTTP

  • Transport protocol configured and server starts without errors
  • CORS allows expected origins (test with browser or curl)
  • Port and base path accessible from client

Authentication

  • Auth mode set appropriately for the environment (public/transparent for dev, remote for prod)
  • OAuth credentials stored in environment variables, not source code
  • Session store configured with appropriate backend (memory for dev, Redis for prod)

Throttle and Security

  • Global rate limit configured to prevent abuse
  • Expensive tools have per-tool throttle overrides
  • IP allow/deny lists configured if needed

Storage

  • Redis or SQLite configured and connectable
  • Storage persists across server restarts (not memory in production)

Troubleshooting

ProblemCauseSolution
Server fails to start with config errorInvalid or missing required config fieldCheck the error message; FrontMCP validates config at startup and reports the specific invalid field
CORS blocked in browserMissing or incorrect CORS origin configAdd the client's origin to http.cors.origin; see configure-http
Rate limit too aggressiveGlobal limit applied to all toolsAdd per-tool overrides for cheap tools with higher limits; see configure-throttle
Sessions lost on serverlessUsing memory session store on stateless platformSwitch to Redis or Vercel KV; see configure-session
Auth callback failsOAuth redirect URI mismatchEnsure the redirect URI registered with your OAuth provider matches the server's /oauth/callback endpoint; see configure-auth

Examples

Each reference has matching examples under examples/<reference>/:

configure-auth-modes

ExampleLevelDescription
local-self-signed-tokensIntermediateConfigure a server that signs its own JWT tokens with consent and incremental auth enabled.
remote-enterprise-oauthAdvancedProxy auth to one mandatory upstream IdP, mint a FrontMCP session, read the upstream token.
transparent-jwt-validationBasicValidate externally-issued JWTs without managing token lifecycle on the server.

configure-auth

ExampleLevelDescription
multi-app-authAdvancedConfigure a single FrontMCP server with multiple apps, each using a different auth mode -- public for open endpoints and remote for admin endpoints.
public-mode-setupBasicSet up a FrontMCP server with public (unauthenticated) access and anonymous scopes.
remote-oauth-with-vaultIntermediateConfigure a FrontMCP server with remote OAuth 2.1 authentication and use the credential vault to call downstream APIs on behalf of the authenticated user.

configure-elicitation

ExampleLevelDescription
basic-confirmation-gateBasicRequest user confirmation before executing a destructive action.
distributed-elicitation-redisIntermediateConfigure elicitation with Redis storage for multi-instance production deployments.

configure-http

ExampleLevelDescription
cors-restricted-originsBasicConfigure CORS to allow only specific frontend origins with credentials.
entry-path-reverse-proxyIntermediateMount the MCP server under a URL prefix for reverse proxy or multi-service setups.
unix-socket-localIntermediateBind the server to a unix socket instead of a TCP port for local-only communication.

configure-session

ExampleLevelDescription
multi-server-key-prefixIntermediateUse unique key prefixes when multiple FrontMCP servers share one Redis instance.
redis-session-storeBasicConfigure Redis-backed session storage for production deployments.
vercel-kv-sessionIntermediateConfigure Vercel KV for session storage in serverless Vercel deployments.

configure-throttle-guard-config

ExampleLevelDescription
full-guard-configAdvancedComplete GuardConfig using every available field for maximum protection.
minimal-guard-configBasicEnable throttle with just a global rate limit and default timeout.

configure-throttle

ExampleLevelDescription
distributed-redis-throttleAdvancedConfigure Redis-backed rate limiting for multi-instance deployments behind a load balancer.
per-tool-rate-limitIntermediateOverride server defaults with per-tool rate limits and concurrency caps.
server-level-rate-limitBasicConfigure global rate limits and IP filtering at the server level.

configure-transport-protocol-presets

ExampleLevelDescription
legacy-preset-nodejsBasicUse the default legacy preset for maximum compatibility with all MCP clients.
stateless-api-serverlessIntermediateUse the stateless-api preset for Vercel, Lambda, or Cloudflare Workers.

configure-transport

ExampleLevelDescription
custom-protocol-flagsAdvancedOverride individual protocol flags instead of using a preset for fine-grained control.
distributed-sessions-redisIntermediateConfigure transport with Redis persistence for multi-instance load-balanced deployments.
stateless-serverlessBasicConfigure stateless transport for Vercel, Lambda, or Cloudflare deployments.

configure-deployment-targets

ExampleLevelDescription
multi-target-with-securityIntermediateConfigure a FrontMCP project with node + distributed targets, CSP headers, and HSTS
distributed-ha-configAdvancedConfigure a distributed deployment target with HA settings for heartbeat, session takeover, and Redis-backed session persistence
json-schema-ide-supportBasicUse frontmcp.config.json with JSON Schema for VS Code and WebStorm autocomplete

configure-security-headers

ExampleLevelDescription
csp-report-onlyBasicTest CSP policies in report-only mode to identify violations before enforcement
full-production-headersIntermediateComplete security headers configuration for production with CSP enforcement, HSTS preload, and clickjacking protection

Accessing This Skill

Skills are distributed as plain SKILL.md files plus a sibling references/ and examples/ tree, so consumers can pick whichever access mode fits:

ModeHow it works
FilesystemRead libs/skills/catalog/frontmcp-config/ directly from a clone of the catalog repo, or from a published @frontmcp/skills install. SKILL.md is the entry point.
frontmcp CLIfrontmcp skills list, frontmcp skills read frontmcp-config, frontmcp skills read frontmcp-config:references/<file>.md, frontmcp skills install frontmcp-config — no server required.
MCP skill://When a developer mounts this skill into their own FrontMCP server (@FrontMcp({ skills: [...] })), the SDK exposes it via SEP-2640 resources: skill://frontmcp-config/SKILL.md, skill://frontmcp-config/references/{file}.md, etc. The server’s skill://index.json returns the SEP-2640 discovery document for everything mounted on it.

The catalog itself is not an MCP server. The skill:// URIs only resolve when a server has been configured to host this skill.

Reference

  • FrontMCP Overview
  • Related skills: configure-transport, configure-http, configure-throttle, configure-elicitation, configure-auth, configure-session, setup-redis, setup-sqlite
我的收藏