@frontmcp/skills 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -29
- package/catalog/TEMPLATE.md +26 -0
- package/catalog/create-tool/SKILL.md +318 -0
- package/catalog/create-tool/examples/01-basic-class-tool.md +112 -0
- package/catalog/create-tool/examples/02-basic-function-tool.md +80 -0
- package/catalog/create-tool/examples/03-tool-with-zod-shape-output.md +78 -0
- package/catalog/create-tool/examples/04-tool-with-zod-schema-output.md +97 -0
- package/catalog/create-tool/examples/05-tool-with-primitive-output.md +93 -0
- package/catalog/create-tool/examples/06-tool-with-media-output.md +109 -0
- package/catalog/create-tool/examples/08-tool-with-provider-injection.md +110 -0
- package/catalog/create-tool/examples/09-tool-with-multiple-providers.md +107 -0
- package/catalog/create-tool/examples/11-tool-with-fetch.md +94 -0
- package/catalog/create-tool/examples/12-tool-with-fetch-and-retries.md +115 -0
- package/catalog/create-tool/examples/13-tool-with-single-auth-provider.md +85 -0
- package/catalog/create-tool/examples/14-tool-with-multiple-auth-providers.md +105 -0
- package/catalog/create-tool/examples/15-tool-with-credential-vault.md +115 -0
- package/catalog/create-tool/examples/16-tool-with-rate-limit.md +71 -0
- package/catalog/create-tool/examples/17-tool-with-concurrency-and-timeout.md +101 -0
- package/catalog/create-tool/examples/18-tool-with-progress-and-notify.md +96 -0
- package/catalog/create-tool/examples/19-tool-with-elicitation.md +102 -0
- package/catalog/create-tool/examples/20-tool-with-annotations.md +125 -0
- package/catalog/create-tool/examples/21-tool-with-availability-constraints.md +107 -0
- package/catalog/create-tool/examples/22-tool-with-ui-html-template.md +93 -0
- package/catalog/create-tool/examples/23-tool-with-ui-filesource-tsx.md +112 -0
- package/catalog/create-tool/examples/24-tool-with-ui-csp-and-bridge.md +127 -0
- package/catalog/create-tool/examples/25-tool-handing-off-to-job.md +143 -0
- package/catalog/create-tool/examples/26-tool-with-resource-link-output.md +94 -0
- package/catalog/create-tool/examples/27-tool-with-examples-metadata.md +90 -0
- package/catalog/create-tool/references/annotations.md +96 -0
- package/catalog/create-tool/references/auth-providers.md +167 -0
- package/catalog/create-tool/references/availability.md +106 -0
- package/catalog/create-tool/references/decorator-options.md +95 -0
- package/catalog/create-tool/references/derived-types.md +102 -0
- package/catalog/create-tool/references/elicitation.md +128 -0
- package/catalog/create-tool/references/error-handling.md +128 -0
- package/catalog/create-tool/references/execution-context.md +158 -0
- package/catalog/create-tool/references/file-layout.md +96 -0
- package/catalog/create-tool/references/function-style-builder.md +118 -0
- package/catalog/create-tool/references/input-schema.md +141 -0
- package/catalog/create-tool/references/output-schema.md +175 -0
- package/catalog/create-tool/references/quick-start.md +124 -0
- package/catalog/create-tool/references/registration.md +132 -0
- package/catalog/create-tool/references/remote-and-esm.md +68 -0
- package/catalog/create-tool/references/testing.md +59 -0
- package/catalog/create-tool/references/throttling.md +109 -0
- package/catalog/create-tool/references/ui-widgets.md +198 -0
- package/catalog/create-tool/rules/always-define-output-schema.md +77 -0
- package/catalog/create-tool/rules/derive-execute-types.md +57 -0
- package/catalog/create-tool/rules/input-schema-is-raw-shape.md +76 -0
- package/catalog/create-tool/rules/no-toolcontext-generics.md +50 -0
- package/catalog/create-tool/rules/no-try-catch-around-execute.md +79 -0
- package/catalog/create-tool/rules/register-in-app.md +76 -0
- package/catalog/create-tool/rules/snake-case-tool-names.md +45 -0
- package/catalog/create-tool/rules/use-this-fail-for-business-errors.md +75 -0
- package/catalog/create-tool/rules/widget-paths-anchor-with-import-meta-url.md +76 -0
- package/catalog/create-tool/rules/widget-resource-mode-host-detect.md +61 -0
- package/catalog/frontmcp-auth-ui/SKILL.md +146 -0
- package/catalog/frontmcp-auth-ui/examples/custom-auth-ui/login-slot.md +97 -0
- package/catalog/frontmcp-auth-ui/examples/custom-auth-ui/multi-step-auth-extra.md +133 -0
- package/catalog/frontmcp-auth-ui/references/custom-auth-ui.md +162 -0
- package/catalog/frontmcp-authorities/SKILL.md +55 -18
- package/catalog/frontmcp-authorities/references/authority-profiles.md +25 -1
- package/catalog/frontmcp-authorities/references/custom-evaluators.md +1 -1
- package/catalog/frontmcp-authorities/references/rbac-abac-rebac.md +9 -0
- package/catalog/frontmcp-channels/SKILL.md +7 -1
- package/catalog/frontmcp-config/SKILL.md +14 -7
- package/catalog/frontmcp-config/examples/configure-auth/local-credential-vault.md +94 -0
- package/catalog/frontmcp-config/examples/configure-auth/local-secure-store.md +138 -0
- package/catalog/frontmcp-config/examples/configure-auth/remote-oauth-with-vault.md +45 -23
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-behind-tunnel.md +73 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-consent-enforcement.md +87 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-dcr-control.md +67 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-minimal.md +62 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-multi-provider-orchestration.md +93 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-self-signed-tokens.md +18 -20
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-single-operator.md +66 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/remote-enterprise-oauth.md +37 -23
- package/catalog/frontmcp-config/examples/configure-http/custom-http-routes.md +98 -0
- package/catalog/frontmcp-config/examples/configure-skills-http/audit-log-redis.md +17 -9
- package/catalog/frontmcp-config/references/configure-auth-modes.md +86 -23
- package/catalog/frontmcp-config/references/configure-auth.md +296 -50
- package/catalog/frontmcp-config/references/configure-deployment-targets.md +84 -1
- package/catalog/frontmcp-config/references/configure-http.md +203 -14
- package/catalog/frontmcp-config/references/configure-session.md +14 -7
- package/catalog/frontmcp-deployment/SKILL.md +17 -15
- package/catalog/frontmcp-deployment/references/build-for-mcpb.md +1 -1
- package/catalog/frontmcp-deployment/references/deploy-manifest-yaml.md +308 -0
- package/catalog/frontmcp-deployment/references/deploy-to-cloudflare-skills-only.md +174 -0
- package/catalog/frontmcp-deployment/references/mcp-client-integration.md +145 -2
- package/catalog/frontmcp-development/SKILL.md +36 -50
- package/catalog/frontmcp-development/examples/create-provider/basic-database-provider.md +14 -0
- package/catalog/frontmcp-development/examples/create-provider/config-and-api-providers.md +85 -9
- package/catalog/frontmcp-development/references/create-job.md +45 -11
- package/catalog/frontmcp-development/references/create-provider.md +80 -8
- package/catalog/frontmcp-development/references/create-skill-with-tools.md +31 -0
- package/catalog/frontmcp-development/references/create-skill.md +45 -0
- package/catalog/frontmcp-development/references/decorators-guide.md +15 -15
- package/catalog/frontmcp-extensibility/SKILL.md +1 -1
- package/catalog/frontmcp-extensibility/examples/skill-audit-log/verify-chain.md +8 -6
- package/catalog/frontmcp-extensibility/references/skill-audit-log.md +7 -2
- package/catalog/frontmcp-guides/SKILL.md +8 -8
- package/catalog/frontmcp-observability/SKILL.md +16 -8
- package/catalog/frontmcp-observability/examples/metrics-endpoint/enable-metrics-endpoint.md +77 -0
- package/catalog/frontmcp-observability/references/metrics-endpoint.md +161 -0
- package/catalog/frontmcp-production-readiness/SKILL.md +1 -1
- package/catalog/frontmcp-production-readiness/examples/common-checklist/security-hardening.md +3 -2
- package/catalog/frontmcp-setup/SKILL.md +12 -12
- package/catalog/frontmcp-setup/examples/frontmcp-skills-usage/install-and-search-skills.md +19 -1
- package/catalog/frontmcp-setup/examples/multi-app-composition/per-app-auth-and-isolation.md +7 -4
- package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +260 -19
- package/catalog/frontmcp-setup/references/multi-app-composition.md +6 -5
- package/catalog/frontmcp-setup/references/setup-project.md +29 -0
- package/catalog/frontmcp-setup/references/setup-sqlite.md +68 -9
- package/catalog/frontmcp-testing/SKILL.md +26 -18
- package/catalog/frontmcp-testing/references/test-auth.md +24 -0
- package/catalog/skills-manifest.json +676 -146
- package/package.json +1 -1
- package/src/manifest.d.ts +72 -1
- package/src/manifest.js +4 -1
- package/src/manifest.js.map +1 -1
- package/catalog/frontmcp-development/examples/create-tool/basic-class-tool.md +0 -61
- package/catalog/frontmcp-development/examples/create-tool/tool-with-di-and-errors.md +0 -84
- package/catalog/frontmcp-development/examples/create-tool/tool-with-rate-limiting-and-progress.md +0 -92
- package/catalog/frontmcp-development/examples/create-tool-annotations/destructive-delete-tool.md +0 -92
- package/catalog/frontmcp-development/examples/create-tool-annotations/readonly-query-tool.md +0 -59
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/primitive-and-media-outputs.md +0 -101
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-raw-shape-output.md +0 -62
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-schema-advanced-output.md +0 -101
- package/catalog/frontmcp-development/references/create-tool-annotations.md +0 -48
- package/catalog/frontmcp-development/references/create-tool-output-schema-types.md +0 -71
- package/catalog/frontmcp-development/references/create-tool.md +0 -728
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: configure-http
|
|
3
|
-
description: Configure HTTP server port, CORS policy, unix sockets,
|
|
3
|
+
description: Configure HTTP server port, CORS policy, unix sockets, entry path prefix, request body limits, and custom HTTP routes
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Configuring HTTP Options
|
|
7
7
|
|
|
8
|
-
Configure the HTTP server — port, CORS policy, unix sockets,
|
|
8
|
+
Configure the HTTP server — port, CORS policy, unix sockets, entry path prefix, request body limits, and first-class custom HTTP routes.
|
|
9
9
|
|
|
10
10
|
## When to Use This Skill
|
|
11
11
|
|
|
@@ -14,12 +14,18 @@ Configure the HTTP server — port, CORS policy, unix sockets, and entry path pr
|
|
|
14
14
|
- Changing the default HTTP port or binding to a specific network interface
|
|
15
15
|
- Enabling or restricting CORS for a frontend application that calls the MCP server
|
|
16
16
|
- Binding to a unix socket for local daemon or process-manager integrations
|
|
17
|
+
- Raising or tightening the request body limit (default `'4mb'`) for tools that
|
|
18
|
+
accept base64-encoded blobs (PDFs, DOCXes, large HTML payloads)
|
|
19
|
+
- Adding a custom HTTP route (download endpoint, webhook, health-beyond-`/health`)
|
|
20
|
+
on the same listener as the MCP endpoint via `http.routes`
|
|
17
21
|
|
|
18
22
|
### Recommended
|
|
19
23
|
|
|
20
24
|
- Mounting the MCP server under a URL prefix behind a reverse proxy
|
|
21
25
|
- Setting a dynamic port from an environment variable for container deployments
|
|
22
26
|
- Fine-tuning CORS preflight caching for performance-sensitive frontends
|
|
27
|
+
- Tightening `bodyLimit` on public-facing deployments to bound per-request
|
|
28
|
+
memory
|
|
23
29
|
|
|
24
30
|
### Skip When
|
|
25
31
|
|
|
@@ -45,6 +51,18 @@ Configure the HTTP server — port, CORS policy, unix sockets, and entry path pr
|
|
|
45
51
|
credentials: true,
|
|
46
52
|
maxAge: 86400,
|
|
47
53
|
},
|
|
54
|
+
bodyLimit: '4mb', // default: '4mb' — body-parser-compatible string or bytes (number)
|
|
55
|
+
urlencodedLimit: undefined, // default: falls back to bodyLimit
|
|
56
|
+
routes: [
|
|
57
|
+
// First-class custom HTTP routes (see "Custom HTTP Routes" below)
|
|
58
|
+
{
|
|
59
|
+
method: 'GET',
|
|
60
|
+
path: '/download/:id',
|
|
61
|
+
handler: (req, res) => {
|
|
62
|
+
/* ... */
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
],
|
|
48
66
|
},
|
|
49
67
|
})
|
|
50
68
|
class Server {}
|
|
@@ -127,6 +145,164 @@ http: {
|
|
|
127
145
|
| `credentials` | `boolean` | `false` | Allow cookies/auth headers |
|
|
128
146
|
| `maxAge` | `number` | — | Preflight cache duration (seconds) |
|
|
129
147
|
|
|
148
|
+
## Request Body Limits
|
|
149
|
+
|
|
150
|
+
FrontMCP's Express host applies a default body limit of `'4mb'` to both
|
|
151
|
+
`express.json()` and `express.urlencoded()`. This lifts body-parser's silent
|
|
152
|
+
100KB default, which previously rejected base64-encoded blobs (PDFs, DOCXes,
|
|
153
|
+
large HTML inputs) with HTTP 413 before they reached MCP tool handlers
|
|
154
|
+
(issue #410).
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
http: {
|
|
158
|
+
bodyLimit: '500kb', // tighten for public-facing deployments
|
|
159
|
+
urlencodedLimit: '100kb', // optional — falls back to bodyLimit when omitted
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
| Option | Type | Default | Notes |
|
|
164
|
+
| ----------------- | ------------------ | ------------------------- | ---------------------------------------------------------------------- |
|
|
165
|
+
| `bodyLimit` | `number \| string` | `'4mb'` | Bytes (number) or body-parser string (`'4mb'`, `'500kb'`, `'2gb'`, …). |
|
|
166
|
+
| `urlencodedLimit` | `number \| string` | falls back to `bodyLimit` | Independent override for `application/x-www-form-urlencoded` bodies. |
|
|
167
|
+
|
|
168
|
+
Requests exceeding the configured limit receive a structured JSON-RPC 413
|
|
169
|
+
response — never an Express HTML error page:
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"jsonrpc": "2.0",
|
|
174
|
+
"id": null,
|
|
175
|
+
"error": {
|
|
176
|
+
"code": -32600,
|
|
177
|
+
"message": "Payload Too Large",
|
|
178
|
+
"data": { "limit": 102400, "length": 204800 }
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
> **Security trade-off.** Body-parser buffers the full request body in memory
|
|
184
|
+
> before parsing, so raising `bodyLimit` scales per-request memory with
|
|
185
|
+
> concurrency. Deployments exposed to untrusted networks should set an
|
|
186
|
+
> explicit lower bound sized for the largest legitimate payload. The
|
|
187
|
+
> 100KB → 4MB default change is a liberalization (every request that
|
|
188
|
+
> succeeded before still succeeds), but the implicit DoS guard is gone
|
|
189
|
+
> unless you set the option yourself.
|
|
190
|
+
|
|
191
|
+
Custom `hostFactory` users build their own Express app and are **not
|
|
192
|
+
affected** by `bodyLimit`/`urlencodedLimit` — those options are consumed only
|
|
193
|
+
by the built-in `ExpressHostAdapter`. Custom-host deployments must configure
|
|
194
|
+
their own body limits.
|
|
195
|
+
|
|
196
|
+
## Custom HTTP Routes
|
|
197
|
+
|
|
198
|
+
`http.routes` mounts first-class custom HTTP handlers on the **same listener**
|
|
199
|
+
as the MCP JSON-RPC endpoint. Use them for byte delivery (file/stream/binary
|
|
200
|
+
downloads), webhooks, health probes beyond `/health`, or any non-JSON-RPC
|
|
201
|
+
surface — the MCP channel cannot serve those.
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
import type { ServerRequest, ServerResponse } from '@frontmcp/sdk';
|
|
205
|
+
|
|
206
|
+
http: {
|
|
207
|
+
routes: [
|
|
208
|
+
// Public route (default) — no auth.
|
|
209
|
+
{
|
|
210
|
+
method: 'GET',
|
|
211
|
+
path: '/download/:id',
|
|
212
|
+
handler: (req: ServerRequest, res: ServerResponse) => {
|
|
213
|
+
res.setHeader('Content-Type', 'application/pdf'); // see Content-Type note
|
|
214
|
+
res.status(200).send(loadPdfBytes(req.params.id));
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
// Auth-gated route — runs the MCP `session:verify` flow first.
|
|
218
|
+
{
|
|
219
|
+
method: 'POST',
|
|
220
|
+
path: '/webhooks/billing',
|
|
221
|
+
auth: true,
|
|
222
|
+
handler: (req: ServerRequest, res: ServerResponse) => {
|
|
223
|
+
// req.authSession is populated when auth: true and verification passed
|
|
224
|
+
res.status(202).json({ accepted: true, user: req.authSession?.user?.sub });
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
| Field | Type | Default | Description |
|
|
232
|
+
| --------- | ---------------------- | ---------------- | ------------------------------------------------------------------------ |
|
|
233
|
+
| `method` | `HttpMethod` | — | `'GET' \| 'POST' \| 'PUT' \| 'PATCH' \| 'DELETE' \| 'OPTIONS' \| 'HEAD'` |
|
|
234
|
+
| `path` | `string` | — | Express-style path (`/files/:id`); must not collide with reserved paths |
|
|
235
|
+
| `handler` | `ServerRequestHandler` | — | `(req, res, next) => void \| Promise<void>` |
|
|
236
|
+
| `auth` | `boolean` | `false` (public) | When `true`, gate behind the MCP `session:verify` flow |
|
|
237
|
+
|
|
238
|
+
### Handler signature
|
|
239
|
+
|
|
240
|
+
The handler uses the framework-agnostic `(req, res, next)` signature. Respond
|
|
241
|
+
with `res.status(...).json(...)` / `res.send(...)`, or call `next()` to fall
|
|
242
|
+
through. `req` and `res` are exported as `ServerRequest` / `ServerResponse`
|
|
243
|
+
from `@frontmcp/sdk`, and `ServerRequestHandler` types the handler directly.
|
|
244
|
+
|
|
245
|
+
Routes share the configured **CORS policy, body limits, and security
|
|
246
|
+
middleware** with the MCP endpoint — they ride the same Express app.
|
|
247
|
+
|
|
248
|
+
### `auth` opt-in
|
|
249
|
+
|
|
250
|
+
Routes are **public by default**. Set `auth: true` to run the request through
|
|
251
|
+
the exact same `session:verify` flow the MCP endpoint uses:
|
|
252
|
+
|
|
253
|
+
- **Unauthorized** → short-circuits with `401` + a `WWW-Authenticate` header.
|
|
254
|
+
- **Forbidden** (valid token, insufficient scope) → `403` + `WWW-Authenticate`.
|
|
255
|
+
- **Authorized** → the verified authorization is attached to `req.authSession`
|
|
256
|
+
before your handler runs.
|
|
257
|
+
|
|
258
|
+
In **public auth mode** (or transparent with `allowAnonymous`), `auth: true`
|
|
259
|
+
routes receive an anonymous session and the handler still runs. Under auth
|
|
260
|
+
modes with no anonymous fallback (e.g. `local` with `allowDefaultPublic: false`),
|
|
261
|
+
unauthenticated requests get the `401`.
|
|
262
|
+
|
|
263
|
+
### Reserved-path guard
|
|
264
|
+
|
|
265
|
+
Custom paths that collide with FrontMCP's own surfaces are **rejected at
|
|
266
|
+
startup** (fail-fast) — they would otherwise shadow or be shadowed by the MCP
|
|
267
|
+
endpoint. Reserved:
|
|
268
|
+
|
|
269
|
+
- the resolved MCP entry path (and its `/sse` + `/message` siblings) — split-by-app
|
|
270
|
+
scope bases are included (e.g. `/mcp/billing`),
|
|
271
|
+
- anything under `/oauth/*` and `/.well-known/*`,
|
|
272
|
+
- `/health` and `/metrics`.
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
// ❌ Throws at startup: collides with the MCP entry path when entryPath: '/mcp'
|
|
276
|
+
http: { entryPath: '/mcp', routes: [{ method: 'POST', path: '/mcp', handler }] }
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Content-Type gotcha
|
|
280
|
+
|
|
281
|
+
The built-in `ExpressHostAdapter` defaults **every** response to
|
|
282
|
+
`application/json; charset=utf-8`. HTML, binary, and streaming handlers MUST
|
|
283
|
+
set their own content type **before** sending the body:
|
|
284
|
+
|
|
285
|
+
```typescript
|
|
286
|
+
{
|
|
287
|
+
method: 'GET',
|
|
288
|
+
path: '/report',
|
|
289
|
+
handler: (req, res) => {
|
|
290
|
+
res.setHeader('Content-Type', 'text/html; charset=utf-8'); // or res.type('html')
|
|
291
|
+
res.status(200).send('<!doctype html><h1>Report</h1>');
|
|
292
|
+
},
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Large payloads: prefer a custom route over `@Resource`
|
|
297
|
+
|
|
298
|
+
> **Decision:** When a tool needs to hand the client a **large** payload, return
|
|
299
|
+
> a [`resource_link`](https://docs.agentfront.dev/frontmcp/servers/resources)
|
|
300
|
+
> that points at a custom `http.routes` **GET** handler, and serve the bytes
|
|
301
|
+
> from that handler (it supports stream/binary delivery). A `@Resource` rides
|
|
302
|
+
> the MCP JSON-RPC channel and is **not** out-of-band — large reads block the
|
|
303
|
+
> protocol stream and inflate token usage. The custom route delivers bytes on a
|
|
304
|
+
> separate HTTP request the client fetches directly.
|
|
305
|
+
|
|
130
306
|
## Entry Path Prefix
|
|
131
307
|
|
|
132
308
|
Mount the MCP server under a URL prefix:
|
|
@@ -192,29 +368,42 @@ curl --unix-socket /tmp/my-mcp-server.sock http://localhost/
|
|
|
192
368
|
- [ ] `maxAge` is set to a reasonable value for production (e.g., `86400` for 24 hours)
|
|
193
369
|
- [ ] Dynamic origin function handles `undefined` origin (non-browser requests)
|
|
194
370
|
|
|
371
|
+
### Custom Routes
|
|
372
|
+
|
|
373
|
+
- [ ] No custom `path` collides with the MCP entry path, `/sse`, `/message`, `/oauth/*`, `/.well-known/*`, `/health`, or `/metrics`
|
|
374
|
+
- [ ] HTML/binary/stream handlers call `res.setHeader('Content-Type', ...)` (or `res.type(...)`) before `res.send(...)`
|
|
375
|
+
- [ ] `auth: true` is set on any route that must require a verified session
|
|
376
|
+
- [ ] Large payloads are served via a custom GET route + `resource_link`, not a `@Resource`
|
|
377
|
+
|
|
195
378
|
### Runtime
|
|
196
379
|
|
|
197
380
|
- [ ] Server starts and binds to the expected port or socket path
|
|
198
381
|
- [ ] `curl -v -H "Origin: <your-origin>" <url>` returns correct `Access-Control-Allow-Origin`
|
|
199
382
|
- [ ] Preflight `OPTIONS` requests return `204` with expected CORS headers
|
|
383
|
+
- [ ] Custom routes respond as expected (`curl <url>/<your-route>`)
|
|
200
384
|
|
|
201
385
|
## Troubleshooting
|
|
202
386
|
|
|
203
|
-
| Problem
|
|
204
|
-
|
|
|
205
|
-
| `EADDRINUSE` on startup
|
|
206
|
-
| CORS errors in the browser console
|
|
207
|
-
| Unix socket file not created
|
|
208
|
-
| Routes return 404 after setting `entryPath`
|
|
209
|
-
| Server binds but external clients cannot connect
|
|
387
|
+
| Problem | Cause | Solution |
|
|
388
|
+
| ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
389
|
+
| `EADDRINUSE` on startup | Another process is already using the configured port | Change the port, stop the other process, or use `port: 0` for a random available port |
|
|
390
|
+
| CORS errors in the browser console | Origin not included in the `cors.origin` list or `credentials: true` with wildcard origin | Add the frontend origin to the `origin` array and ensure credentials and origin settings are compatible |
|
|
391
|
+
| Unix socket file not created | Missing write permissions on the target directory or stale socket file from a previous run | Check directory permissions and remove the stale `.sock` file before restarting |
|
|
392
|
+
| Routes return 404 after setting `entryPath` | Client is still requesting the root path without the prefix | Update client base URL to include the entry path (e.g., `http://localhost:3000/api/mcp`) |
|
|
393
|
+
| Server binds but external clients cannot connect | Server bound to `localhost` or `127.0.0.1` inside a container | Set `host: '0.0.0.0'` or use Docker port mapping to expose the container port |
|
|
394
|
+
| `413 Payload Too Large` with JSON-RPC envelope | Request body exceeded `bodyLimit` (default `'4mb'`) | Raise `http.bodyLimit` to fit the payload, or move large blobs to a separate upload endpoint |
|
|
395
|
+
| Server throws at startup mentioning a "reserved" path | A custom `http.routes` path collides with the MCP entry path, `/oauth/*`, `/.well-known/*`, `/health`, or `/metrics` | Rename the custom route to a non-reserved path |
|
|
396
|
+
| Custom route returns JSON when HTML/bytes expected | The Express adapter defaults responses to `application/json` | Set `res.setHeader('Content-Type', ...)` (or `res.type(...)`) in the handler before sending the body |
|
|
397
|
+
| Custom `auth: true` route always returns `401` | Auth mode has no anonymous fallback and the request carries no valid bearer token | Send a valid `Authorization: Bearer <jwt>`, or use `auth` mode `public`/transparent-anon for open routes |
|
|
210
398
|
|
|
211
399
|
## Examples
|
|
212
400
|
|
|
213
|
-
| Example | Level | Description
|
|
214
|
-
| ------------------------------------------------------------------------------------ | ------------ |
|
|
215
|
-
| [`cors-restricted-origins`](../examples/configure-http/cors-restricted-origins.md) | Basic | Configure CORS to allow only specific frontend origins with credentials.
|
|
216
|
-
| [`
|
|
217
|
-
| [`
|
|
401
|
+
| Example | Level | Description |
|
|
402
|
+
| ------------------------------------------------------------------------------------ | ------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
403
|
+
| [`cors-restricted-origins`](../examples/configure-http/cors-restricted-origins.md) | Basic | Configure CORS to allow only specific frontend origins with credentials. |
|
|
404
|
+
| [`custom-http-routes`](../examples/configure-http/custom-http-routes.md) | Intermediate | Mount first-class custom HTTP routes (download, secret-validation POST, auth-gated webhook) on the MCP listener via http.routes. |
|
|
405
|
+
| [`entry-path-reverse-proxy`](../examples/configure-http/entry-path-reverse-proxy.md) | Intermediate | Mount the MCP server under a URL prefix for reverse proxy or multi-service setups. |
|
|
406
|
+
| [`unix-socket-local`](../examples/configure-http/unix-socket-local.md) | Intermediate | Bind the server to a unix socket instead of a TCP port for local-only communication. |
|
|
218
407
|
|
|
219
408
|
> See all examples in [`examples/configure-http/`](../examples/configure-http/)
|
|
220
409
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: configure-session
|
|
3
|
-
description: Set up session storage with Redis
|
|
3
|
+
description: Set up session storage with Redis, Vercel KV, or SQLite for persistent user state across requests
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Configure Session Management
|
|
@@ -11,7 +11,7 @@ This skill covers setting up session storage in FrontMCP. Sessions track authent
|
|
|
11
11
|
|
|
12
12
|
### Must Use
|
|
13
13
|
|
|
14
|
-
- Deploying to production where sessions must survive process restarts (Redis
|
|
14
|
+
- Deploying to production where sessions must survive process restarts (Redis, Vercel KV, or SQLite required)
|
|
15
15
|
- Running multiple server instances behind a load balancer that need shared session state
|
|
16
16
|
- Using Streamable HTTP transport where sessions must persist across reconnects
|
|
17
17
|
|
|
@@ -31,14 +31,21 @@ This skill covers setting up session storage in FrontMCP. Sessions track authent
|
|
|
31
31
|
|
|
32
32
|
## Storage Providers
|
|
33
33
|
|
|
34
|
-
| Provider | Use Case
|
|
35
|
-
| ----------- |
|
|
36
|
-
| `memory` | Development/testing
|
|
37
|
-
| `redis` | Node.js production
|
|
38
|
-
| `vercel-kv` | Vercel deployments
|
|
34
|
+
| Provider | Use Case | Persistence | Package Required |
|
|
35
|
+
| ----------- | ------------------------------------------ | ----------- | --------------------------------------------- |
|
|
36
|
+
| `memory` | Development/testing | None | None (default) |
|
|
37
|
+
| `redis` | Node.js production | Yes | `ioredis` |
|
|
38
|
+
| `vercel-kv` | Vercel deployments | Yes | `@vercel/kv` |
|
|
39
|
+
| `sqlite` | Single-node persistent (CLI / Docker / VM) | Yes | `@frontmcp/storage-sqlite` + `better-sqlite3` |
|
|
39
40
|
|
|
40
41
|
Never use the memory store in production. Sessions are lost on process restart, which breaks authentication for all connected clients.
|
|
41
42
|
|
|
43
|
+
SQLite is set via the top-level `sqlite` block (not via `redis: { provider: ... }`).
|
|
44
|
+
See the [`setup-sqlite`](../../frontmcp-setup/references/setup-sqlite.md) skill
|
|
45
|
+
for the full walkthrough. The same top-level `sqlite` block is auto-threaded
|
|
46
|
+
into the task store and elicitation store unless they are individually
|
|
47
|
+
configured to use a different backend (issue #401).
|
|
48
|
+
|
|
42
49
|
## Redis (Production)
|
|
43
50
|
|
|
44
51
|
Configure Redis session storage via the `@FrontMcp` decorator:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: frontmcp-deployment
|
|
3
|
-
description: 'Use when
|
|
3
|
+
description: 'Use when deploying, building for production, packaging, or shipping a FrontMCP server. Covers build targets (node, cli SEA binary, browser, embeddable SDK, mcpb archive for Claude Desktop, serverless) and deploying to Vercel (with Vercel KV), AWS Lambda (API Gateway, SAM, CDK), Cloudflare Workers (KV, D1, Durable Objects, v1.3 skills-only), and Node (multi-stage Docker, docker-compose, PM2, nginx). Also the frontmcp.deploy.yaml manifest plus GitHub Action push-resync, and MCP client integration / .mcp.json for Claude Desktop, Claude Code, Cursor, and VS Code over stdio or HTTP. Triggers: deploy, build for production, dockerize, containerize, serverless, edge runtime, go live, ship it.'
|
|
4
4
|
tags: [router, deployment, node, vercel, lambda, cloudflare, cli, browser, sdk, guide]
|
|
5
5
|
category: deployment
|
|
6
6
|
targets: [all]
|
|
@@ -36,7 +36,7 @@ Entry point for deploying and building FrontMCP servers. This skill helps you ch
|
|
|
36
36
|
- You need to configure server settings, not deploy (see `frontmcp-config`)
|
|
37
37
|
- You need to build components, not ship them (see `frontmcp-development`)
|
|
38
38
|
|
|
39
|
-
> **Decision:** Use this skill when you need to figure out WHERE to deploy.
|
|
39
|
+
> **Decision:** Use this skill when you need to figure out WHERE to deploy. Open the matching reference under `references/` directly when you already know.
|
|
40
40
|
|
|
41
41
|
## Prerequisites
|
|
42
42
|
|
|
@@ -48,23 +48,25 @@ Entry point for deploying and building FrontMCP servers. This skill helps you ch
|
|
|
48
48
|
|
|
49
49
|
1. Review the Scenario Routing Table and Target Comparison below to choose a deployment target
|
|
50
50
|
2. Run `frontmcp build --target <target>` to produce the build output
|
|
51
|
-
3. Follow the specific deployment
|
|
51
|
+
3. Follow the specific deployment reference (e.g., `references/deploy-to-node.md`, `references/deploy-to-vercel.md`) for platform instructions
|
|
52
52
|
4. Verify with the Post-Deployment checklist at the end of this skill
|
|
53
53
|
|
|
54
54
|
## Scenario Routing Table
|
|
55
55
|
|
|
56
|
-
| Scenario |
|
|
57
|
-
| ------------------------------------------------- |
|
|
58
|
-
| Long-running server on VPS, Docker, or bare metal | `deploy-to-node`
|
|
59
|
-
| Serverless with zero config and Vercel KV | `deploy-to-vercel`
|
|
60
|
-
| AWS serverless with API Gateway | `deploy-to-lambda`
|
|
61
|
-
| Edge computing with global distribution | `deploy-to-cloudflare`
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
56
|
+
| Scenario | Reference | Description |
|
|
57
|
+
| ------------------------------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
58
|
+
| Long-running server on VPS, Docker, or bare metal | `deploy-to-node` | Node.js with stdio or HTTP transport, PM2/Docker for process management |
|
|
59
|
+
| Serverless with zero config and Vercel KV | `deploy-to-vercel` | Vercel Functions with Streamable HTTP, Vercel KV for storage |
|
|
60
|
+
| AWS serverless with API Gateway | `deploy-to-lambda` | Lambda + API Gateway with Streamable HTTP, DynamoDB or ElastiCache |
|
|
61
|
+
| Edge computing with global distribution | `deploy-to-cloudflare` | Cloudflare Workers with KV or Durable Objects for storage |
|
|
62
|
+
| Hosted FrontMCP (v1.3 skills-only model) | `deploy-to-cloudflare-skills-only` | Cloudflare Worker as the MCP control plane; OpenAPI is capability inventory; agent uses 4 meta-tools + AgentScript; hot-reload via GitHub Action |
|
|
63
|
+
| Author `frontmcp.deploy.yaml` | `deploy-manifest-yaml` | v1 schema reference: runtime, server, specs, skills, tags, classification, bindings, signing, auth, secrets, environments |
|
|
64
|
+
| Standalone executable binary for distribution | `build-for-cli` | Single-binary CLI with stdio transport, embedded storage |
|
|
65
|
+
| Run MCP in a web browser | `build-for-browser` | Browser-compatible bundle with in-memory transport |
|
|
66
|
+
| Embed MCP into an existing Node.js application | `build-for-sdk` | Library build for programmatic usage without standalone server |
|
|
67
|
+
| Write a Dockerfile for Node.js deployment | `deploy-to-node-dockerfile` | Dockerfile configuration for Node.js deployment |
|
|
68
|
+
| Configure Vercel-specific settings (vercel.json) | `deploy-to-vercel-config` | Vercel-specific configuration (vercel.json) |
|
|
69
|
+
| Connect MCP clients (Claude, Cursor, VS Code) | `mcp-client-integration` | Configure .mcp.json for stdio, HTTP, or Unix socket transport |
|
|
68
70
|
|
|
69
71
|
### CLI Commands for Deployment and Operations
|
|
70
72
|
|
|
@@ -93,7 +93,7 @@ dist/mcpb/
|
|
|
93
93
|
| `author` | deployment.author → parsed `package.json.author` string (`"Name <email> (url)"`) |
|
|
94
94
|
| `license`, `homepage`, `repository`, `keywords` | deployment override → package.json fallback |
|
|
95
95
|
| `icon` | deployment.icon → package.json.icon → `icon.png` / `assets/icon.png` in cwd |
|
|
96
|
-
| `tools` | Schema extraction (system tools like `
|
|
96
|
+
| `tools` | Schema extraction (system tools like `execute_job` filtered out) |
|
|
97
97
|
| `prompts` | Schema extraction; emitted with `prompts_generated: true` |
|
|
98
98
|
| `user_config` | Translated from `setup.steps` + deployment.userConfig overrides |
|
|
99
99
|
| `compatibility.runtimes.node` | deployment.compatibility.runtimes.node → frontmcp.config.nodeVersion → `">=22.0.0"` |
|