@frontmcp/skills 0.0.1 → 1.0.0-beta.11

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.
Files changed (104) hide show
  1. package/README.md +2 -2
  2. package/catalog/TEMPLATE.md +58 -13
  3. package/catalog/frontmcp-config/SKILL.md +156 -0
  4. package/catalog/{auth/configure-auth/references/auth-modes.md → frontmcp-config/references/configure-auth-modes.md} +5 -0
  5. package/catalog/frontmcp-config/references/configure-auth.md +243 -0
  6. package/catalog/frontmcp-config/references/configure-elicitation.md +183 -0
  7. package/catalog/frontmcp-config/references/configure-http.md +210 -0
  8. package/catalog/frontmcp-config/references/configure-session.md +210 -0
  9. package/catalog/{config/configure-throttle/references/guard-config.md → frontmcp-config/references/configure-throttle-guard-config.md} +5 -0
  10. package/catalog/frontmcp-config/references/configure-throttle.md +234 -0
  11. package/catalog/{config/configure-transport/references/protocol-presets.md → frontmcp-config/references/configure-transport-protocol-presets.md} +5 -0
  12. package/catalog/frontmcp-config/references/configure-transport.md +200 -0
  13. package/catalog/frontmcp-config/references/setup-redis.md +9 -0
  14. package/catalog/frontmcp-config/references/setup-sqlite.md +9 -0
  15. package/catalog/frontmcp-deployment/SKILL.md +152 -0
  16. package/catalog/frontmcp-deployment/references/build-for-browser.md +143 -0
  17. package/catalog/frontmcp-deployment/references/build-for-cli.md +191 -0
  18. package/catalog/{deployment/build-for-sdk/SKILL.md → frontmcp-deployment/references/build-for-sdk.md} +66 -20
  19. package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +218 -0
  20. package/catalog/{deployment/deploy-to-lambda/SKILL.md → frontmcp-deployment/references/deploy-to-lambda.md} +77 -59
  21. package/catalog/{deployment/deploy-to-node/references/Dockerfile.example → frontmcp-deployment/references/deploy-to-node-dockerfile.md} +18 -4
  22. package/catalog/{deployment/deploy-to-node/SKILL.md → frontmcp-deployment/references/deploy-to-node.md} +69 -36
  23. package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +65 -0
  24. package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +229 -0
  25. package/catalog/frontmcp-development/SKILL.md +126 -0
  26. package/catalog/frontmcp-development/references/create-adapter.md +170 -0
  27. package/catalog/{development/create-agent/references/llm-config.md → frontmcp-development/references/create-agent-llm-config.md} +10 -5
  28. package/catalog/{development/create-agent/SKILL.md → frontmcp-development/references/create-agent.md} +83 -40
  29. package/catalog/{development/create-job/SKILL.md → frontmcp-development/references/create-job.md} +62 -15
  30. package/catalog/{plugins/create-plugin-hooks/SKILL.md → frontmcp-development/references/create-plugin-hooks.md} +100 -7
  31. package/catalog/frontmcp-development/references/create-plugin.md +506 -0
  32. package/catalog/{development/create-prompt/SKILL.md → frontmcp-development/references/create-prompt.md} +65 -22
  33. package/catalog/{development/create-provider/SKILL.md → frontmcp-development/references/create-provider.md} +63 -23
  34. package/catalog/{development/create-resource/SKILL.md → frontmcp-development/references/create-resource.md} +148 -26
  35. package/catalog/{development/create-skill-with-tools/SKILL.md → frontmcp-development/references/create-skill-with-tools.md} +174 -20
  36. package/catalog/{development/create-skill/SKILL.md → frontmcp-development/references/create-skill.md} +114 -28
  37. package/catalog/{development/create-tool/references/tool-annotations.md → frontmcp-development/references/create-tool-annotations.md} +5 -0
  38. package/catalog/{development/create-tool/references/output-schema-types.md → frontmcp-development/references/create-tool-output-schema-types.md} +5 -0
  39. package/catalog/{development/create-tool/SKILL.md → frontmcp-development/references/create-tool.md} +172 -23
  40. package/catalog/{development/create-workflow/SKILL.md → frontmcp-development/references/create-workflow.md} +61 -14
  41. package/catalog/frontmcp-development/references/decorators-guide.md +754 -0
  42. package/catalog/frontmcp-development/references/official-adapters.md +199 -0
  43. package/catalog/{plugins/official-plugins/SKILL.md → frontmcp-development/references/official-plugins.md} +97 -27
  44. package/catalog/frontmcp-extensibility/SKILL.md +103 -0
  45. package/catalog/frontmcp-extensibility/references/vectoriadb.md +289 -0
  46. package/catalog/frontmcp-guides/SKILL.md +420 -0
  47. package/catalog/frontmcp-guides/references/example-knowledge-base.md +641 -0
  48. package/catalog/frontmcp-guides/references/example-task-manager.md +517 -0
  49. package/catalog/frontmcp-guides/references/example-weather-api.md +297 -0
  50. package/catalog/frontmcp-production-readiness/SKILL.md +98 -0
  51. package/catalog/frontmcp-production-readiness/references/common-checklist.md +156 -0
  52. package/catalog/frontmcp-production-readiness/references/production-browser.md +46 -0
  53. package/catalog/frontmcp-production-readiness/references/production-cli-binary.md +62 -0
  54. package/catalog/frontmcp-production-readiness/references/production-cli-daemon.md +61 -0
  55. package/catalog/frontmcp-production-readiness/references/production-cloudflare.md +52 -0
  56. package/catalog/frontmcp-production-readiness/references/production-lambda.md +53 -0
  57. package/catalog/frontmcp-production-readiness/references/production-node-sdk.md +66 -0
  58. package/catalog/frontmcp-production-readiness/references/production-node-server.md +61 -0
  59. package/catalog/frontmcp-production-readiness/references/production-vercel.md +52 -0
  60. package/catalog/frontmcp-setup/SKILL.md +132 -0
  61. package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +280 -0
  62. package/catalog/{setup/multi-app-composition/SKILL.md → frontmcp-setup/references/multi-app-composition.md} +66 -19
  63. package/catalog/{setup/nx-workflow/SKILL.md → frontmcp-setup/references/nx-workflow.md} +79 -17
  64. package/catalog/frontmcp-setup/references/project-structure-nx.md +251 -0
  65. package/catalog/frontmcp-setup/references/project-structure-standalone.md +217 -0
  66. package/catalog/frontmcp-setup/references/readme-guide.md +226 -0
  67. package/catalog/{setup/setup-project/SKILL.md → frontmcp-setup/references/setup-project.md} +63 -58
  68. package/catalog/{setup/setup-redis/SKILL.md → frontmcp-setup/references/setup-redis.md} +60 -82
  69. package/catalog/{setup/setup-sqlite/SKILL.md → frontmcp-setup/references/setup-sqlite.md} +65 -72
  70. package/catalog/frontmcp-testing/SKILL.md +135 -0
  71. package/catalog/{testing/setup-testing/SKILL.md → frontmcp-testing/references/setup-testing.md} +79 -63
  72. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-auth.md +5 -0
  73. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-browser-build.md +5 -0
  74. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-cli-binary.md +5 -0
  75. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-direct-client.md +5 -0
  76. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-e2e-handler.md +5 -0
  77. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-tool-unit.md +6 -0
  78. package/catalog/skills-manifest.json +337 -382
  79. package/package.json +2 -2
  80. package/src/index.d.ts +1 -1
  81. package/src/index.js.map +1 -1
  82. package/src/loader.js +0 -1
  83. package/src/loader.js.map +1 -1
  84. package/src/manifest.d.ts +15 -3
  85. package/src/manifest.js +3 -3
  86. package/src/manifest.js.map +1 -1
  87. package/catalog/adapters/create-adapter/SKILL.md +0 -127
  88. package/catalog/adapters/official-adapters/SKILL.md +0 -136
  89. package/catalog/auth/configure-auth/SKILL.md +0 -250
  90. package/catalog/auth/configure-session/SKILL.md +0 -201
  91. package/catalog/config/configure-elicitation/SKILL.md +0 -136
  92. package/catalog/config/configure-http/SKILL.md +0 -167
  93. package/catalog/config/configure-throttle/SKILL.md +0 -189
  94. package/catalog/config/configure-transport/SKILL.md +0 -151
  95. package/catalog/deployment/build-for-browser/SKILL.md +0 -95
  96. package/catalog/deployment/build-for-cli/SKILL.md +0 -100
  97. package/catalog/deployment/deploy-to-cloudflare/SKILL.md +0 -192
  98. package/catalog/deployment/deploy-to-vercel/SKILL.md +0 -196
  99. package/catalog/deployment/deploy-to-vercel/references/vercel.json.example +0 -60
  100. package/catalog/development/decorators-guide/SKILL.md +0 -598
  101. package/catalog/plugins/create-plugin/SKILL.md +0 -336
  102. package/catalog/setup/frontmcp-skills-usage/SKILL.md +0 -200
  103. package/catalog/setup/project-structure-nx/SKILL.md +0 -186
  104. package/catalog/setup/project-structure-standalone/SKILL.md +0 -153
@@ -1,66 +1,40 @@
1
1
  ---
2
2
  name: deploy-to-lambda
3
- description: Deploy a FrontMCP server to AWS Lambda with API Gateway. Use when deploying to AWS, setting up SAM or CDK, or configuring Lambda handlers.
4
- tags:
5
- - deployment
6
- - lambda
7
- - aws
8
- - serverless
9
- parameters:
10
- - name: runtime
11
- description: AWS Lambda runtime version
12
- type: string
13
- required: false
14
- default: nodejs22.x
15
- - name: memory
16
- description: Lambda function memory in MB
17
- type: number
18
- required: false
19
- default: 512
20
- - name: timeout
21
- description: Lambda function timeout in seconds
22
- type: number
23
- required: false
24
- default: 30
25
- - name: region
26
- description: AWS region for deployment
27
- type: string
28
- required: false
29
- default: us-east-1
30
- examples:
31
- - scenario: Deploy with SAM
32
- parameters:
33
- memory: 512
34
- timeout: 30
35
- region: us-east-1
36
- expected-outcome: A FrontMCP server deployed as an AWS Lambda function behind API Gateway, managed by SAM.
37
- - scenario: Deploy with CDK
38
- parameters:
39
- memory: 1024
40
- timeout: 60
41
- region: eu-west-1
42
- expected-outcome: A FrontMCP server deployed via AWS CDK with API Gateway and Lambda.
43
- compatibility: AWS CLI and SAM CLI required
44
- license: Apache-2.0
45
- visibility: both
46
- priority: 10
47
- metadata:
48
- category: deployment
49
- difficulty: advanced
50
- platform: aws
51
- docs: https://docs.agentfront.dev/frontmcp/deployment/serverless
3
+ description: Deploy a FrontMCP server to AWS Lambda with API Gateway using SAM or CDK
52
4
  ---
53
5
 
54
6
  # Deploy a FrontMCP Server to AWS Lambda
55
7
 
56
8
  This skill walks you through deploying a FrontMCP server to AWS Lambda with API Gateway using SAM or CDK.
57
9
 
10
+ ## When to Use This Skill
11
+
12
+ ### Must Use
13
+
14
+ - Deploying a FrontMCP server to AWS Lambda behind API Gateway
15
+ - Setting up a SAM or CDK stack for a serverless MCP endpoint on AWS
16
+ - Integrating with AWS-native services like ElastiCache, Secrets Manager, or CloudWatch
17
+
18
+ ### Recommended
19
+
20
+ - Your organization standardizes on AWS and you need IAM-based access control
21
+ - You want provisioned concurrency for predictable latency on critical MCP endpoints
22
+ - Deploying across multiple AWS regions with infrastructure-as-code (SAM or CDK)
23
+
24
+ ### Skip When
25
+
26
+ - Deploying to Vercel or you prefer a simpler serverless DX -- use `deploy-to-vercel` instead
27
+ - You need a long-lived process with WebSockets or persistent connections -- use `deploy-to-node` instead
28
+ - You do not use AWS and want to avoid managing IAM roles, VPCs, and CloudFormation stacks
29
+
30
+ > **Decision:** Choose this skill when you need serverless deployment within the AWS ecosystem; choose a different target when you want simpler ops or a non-AWS platform.
31
+
58
32
  ## Prerequisites
59
33
 
60
34
  - AWS account with appropriate IAM permissions
61
35
  - AWS CLI configured: `aws configure`
62
36
  - SAM CLI installed: `brew install aws-sam-cli` (macOS) or see AWS docs
63
- - Node.js 22 or later
37
+ - Node.js 24 or later
64
38
  - A FrontMCP project ready to build
65
39
 
66
40
  ## Step 1: Build for Lambda
@@ -83,7 +57,7 @@ Description: FrontMCP server on AWS Lambda
83
57
  Globals:
84
58
  Function:
85
59
  Timeout: 30
86
- Runtime: nodejs22.x
60
+ Runtime: nodejs24.x
87
61
  MemorySize: 512
88
62
  Environment:
89
63
  Variables:
@@ -94,7 +68,7 @@ Resources:
94
68
  FrontMcpFunction:
95
69
  Type: AWS::Serverless::Function
96
70
  Properties:
97
- Handler: dist/lambda.handler
71
+ Handler: handler.handler
98
72
  CodeUri: .
99
73
  Description: FrontMCP MCP server
100
74
  Architectures:
@@ -169,7 +143,7 @@ Resources:
169
143
 
170
144
  ## Step 4: Handler Configuration
171
145
 
172
- FrontMCP generates a Lambda handler at `dist/lambda.handler` during the build step. To customize the handler, create a `lambda.ts` entry point:
146
+ FrontMCP generates a Lambda handler file (`handler.cjs` with a `handler` export) during the build step. In SAM/CDK, reference it as `handler.handler`. To customize the handler, create a `lambda.ts` entry point:
173
147
 
174
148
  ```typescript
175
149
  import { createLambdaHandler } from '@frontmcp/adapters/lambda';
@@ -233,8 +207,8 @@ import * as apigw from 'aws-cdk-lib/aws-apigatewayv2';
233
207
  import * as integrations from 'aws-cdk-lib/aws-apigatewayv2-integrations';
234
208
 
235
209
  const fn = new lambda.Function(this, 'FrontMcpHandler', {
236
- runtime: lambda.Runtime.NODEJS_22_X,
237
- handler: 'dist/lambda.handler',
210
+ runtime: lambda.Runtime.NODEJS_24_X,
211
+ handler: 'handler.handler',
238
212
  code: lambda.Code.fromAsset('.'),
239
213
  memorySize: 512,
240
214
  timeout: cdk.Duration.seconds(30),
@@ -296,9 +270,53 @@ Lambda cold starts occur when a new execution environment is initialized. Strate
296
270
  | 512 MB | ~500ms | ~700ms |
297
271
  | 1024 MB | ~350ms | ~500ms |
298
272
 
273
+ ## Common Patterns
274
+
275
+ | Pattern | Correct | Incorrect | Why |
276
+ | ------------------ | -------------------------------------------------------------- | --------------------------------------- | -------------------------------------------------------------------------------------------------- |
277
+ | Build command | `frontmcp build --target lambda` | `tsc` or generic bundler | The Lambda target produces a single optimized handler with tree-shaking for cold-start performance |
278
+ | Architecture | `arm64` (Graviton) | `x86_64` | ARM64 functions initialize faster and cost less per ms of compute |
279
+ | Handler path | `handler.handler` in SAM template | `index.handler` or `src/lambda.handler` | The FrontMCP build outputs to `dist/`; mismatched paths cause 502 errors |
280
+ | Secrets management | SSM Parameter Store or Secrets Manager (`{{resolve:ssm:...}}`) | Plaintext env vars in `template.yaml` | SSM/Secrets Manager encrypts values at rest and supports rotation |
281
+ | Redis connectivity | Lambda in same VPC as ElastiCache with security groups | Public Redis endpoint from Lambda | VPC peering ensures low latency and keeps traffic off the public internet |
282
+
283
+ ## Verification Checklist
284
+
285
+ **Build**
286
+
287
+ - [ ] `frontmcp build --target lambda` completes without errors
288
+ - [ ] `handler.handler` exists and exports a `handler` function
289
+
290
+ **SAM / CDK**
291
+
292
+ - [ ] `sam build` succeeds without errors
293
+ - [ ] `sam deploy --guided` creates the CloudFormation stack
294
+ - [ ] Stack outputs include the API Gateway endpoint URL
295
+
296
+ **Runtime**
297
+
298
+ - [ ] `curl https://<api-id>.execute-api.<region>.amazonaws.com/health` returns `{"status":"ok"}`
299
+ - [ ] CloudWatch Logs show successful invocations without errors
300
+ - [ ] `NODE_ENV` is set to `production` in the function configuration
301
+
302
+ **Production Readiness**
303
+
304
+ - [ ] Sensitive values use SSM Parameter Store or Secrets Manager
305
+ - [ ] Log retention is configured (e.g., 14 days)
306
+ - [ ] If using Redis, Lambda is in the same VPC as ElastiCache with correct security groups
307
+ - [ ] Provisioned concurrency is enabled for latency-sensitive endpoints (if applicable)
308
+
299
309
  ## Troubleshooting
300
310
 
301
- - **Timeout errors**: Increase `Timeout` in the SAM template. Check if the function is waiting on an unreachable resource.
302
- - **502 Bad Gateway**: Check CloudWatch logs. Common causes: handler path mismatch, missing environment variables, unhandled exceptions.
303
- - **Cold starts too slow**: Increase memory allocation, use ARM64, or enable provisioned concurrency.
304
- - **Redis from Lambda**: Place the Lambda function in the same VPC as your ElastiCache cluster with appropriate security groups.
311
+ | Problem | Cause | Solution |
312
+ | ------------------------------------ | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
313
+ | Timeout errors | Function timeout too low or waiting on unreachable resource | Increase `Timeout` in the SAM template; verify network connectivity to dependencies |
314
+ | 502 Bad Gateway | Handler path mismatch, missing env vars, or unhandled exception | Check CloudWatch Logs; confirm `Handler` matches `handler.handler` |
315
+ | Cold starts too slow | Low memory, x86 architecture, or large bundle | Increase memory to 512+ MB, use `arm64`, or enable provisioned concurrency |
316
+ | Redis connection refused from Lambda | Lambda not in the same VPC as ElastiCache | Place the Lambda in the ElastiCache VPC with appropriate security group rules |
317
+ | `sam deploy` fails with IAM error | Insufficient permissions for CloudFormation stack creation | Ensure the deploying IAM user/role has `cloudformation:*`, `lambda:*`, `apigateway:*`, and `iam:PassRole` |
318
+
319
+ ## Reference
320
+
321
+ - **Docs:** https://docs.agentfront.dev/frontmcp/deployment/serverless
322
+ - **Related skills:** `deploy-to-node`, `deploy-to-vercel`
@@ -1,45 +1,59 @@
1
+ ---
2
+ name: deploy-to-node-dockerfile
3
+ description: Multi-stage Dockerfile for building and running a FrontMCP server in production
4
+ ---
5
+
1
6
  # ---- Build Stage ----
2
- FROM node:22-alpine AS builder
7
+
8
+ FROM node:24-alpine AS builder
3
9
 
4
10
  WORKDIR /app
5
11
 
6
12
  # Install dependencies first for better layer caching
13
+
7
14
  COPY package.json yarn.lock ./
8
15
  RUN yarn install --frozen-lockfile
9
16
 
10
17
  # Copy source and build
18
+
11
19
  COPY . .
12
20
  RUN yarn frontmcp build --target node
13
21
 
14
22
  # ---- Production Stage ----
15
- FROM node:22-alpine AS production
23
+
24
+ FROM node:24-alpine AS production
16
25
 
17
26
  WORKDIR /app
18
27
 
19
28
  # Create non-root user for security
29
+
20
30
  RUN addgroup -S frontmcp && adduser -S frontmcp -G frontmcp
21
31
 
22
32
  # Copy only production artifacts
33
+
23
34
  COPY --from=builder /app/dist ./dist
24
35
  COPY --from=builder /app/package.json ./
25
36
  COPY --from=builder /app/yarn.lock ./
26
37
 
27
38
  # Install production dependencies only
39
+
28
40
  RUN yarn install --frozen-lockfile --production && \
29
- yarn cache clean
41
+ yarn cache clean
30
42
 
31
43
  # Set ownership
44
+
32
45
  RUN chown -R frontmcp:frontmcp /app
33
46
 
34
47
  USER frontmcp
35
48
 
36
49
  # Environment defaults
50
+
37
51
  ENV NODE_ENV=production
38
52
  ENV PORT=3000
39
53
 
40
54
  EXPOSE 3000
41
55
 
42
56
  HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
43
- CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
57
+ CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
44
58
 
45
59
  CMD ["node", "dist/main.js"]
@@ -1,43 +1,37 @@
1
1
  ---
2
2
  name: deploy-to-node
3
- description: Deploy a FrontMCP server as a standalone Node.js application with Docker. Use when deploying to a VPS, Docker, or bare metal server.
4
- tags:
5
- - deployment
6
- - node
7
- - docker
8
- - production
9
- parameters:
10
- - name: port
11
- description: The port number the server will listen on
12
- type: number
13
- required: false
14
- default: 3000
15
- examples:
16
- - scenario: Deploy with Docker Compose
17
- parameters:
18
- port: 3000
19
- expected-outcome: A FrontMCP server running inside a Docker container orchestrated by Docker Compose, with Redis for session storage and automatic restarts on failure.
20
- - scenario: Deploy to bare metal with PM2
21
- parameters:
22
- port: 8080
23
- expected-outcome: A FrontMCP server running directly on the host machine under PM2, listening on port 8080 with NGINX as a reverse proxy.
24
- compatibility: Node.js 22+, Docker recommended
25
- license: Apache-2.0
26
- visibility: both
27
- priority: 10
28
- metadata:
29
- category: deployment
30
- difficulty: intermediate
31
- docs: https://docs.agentfront.dev/frontmcp/deployment/production-build
3
+ description: Deploy a FrontMCP server as a standalone Node.js app with Docker and process managers
32
4
  ---
33
5
 
34
6
  # Deploy a FrontMCP Server to Node.js
35
7
 
36
8
  This skill walks you through deploying a FrontMCP server as a standalone Node.js application, optionally containerized with Docker for production use.
37
9
 
10
+ ## When to Use This Skill
11
+
12
+ ### Must Use
13
+
14
+ - Deploying a FrontMCP server to a VPS, dedicated server, or bare-metal infrastructure
15
+ - Running a long-lived Node.js process that needs full control over the runtime environment
16
+ - Containerizing a FrontMCP server with Docker or Docker Compose for self-hosted production
17
+
18
+ ### Recommended
19
+
20
+ - Using PM2 or systemd to manage a FrontMCP process with automatic restarts
21
+ - Deploying behind NGINX or another reverse proxy for TLS termination and load balancing
22
+ - Running in environments where serverless cold starts are unacceptable
23
+
24
+ ### Skip When
25
+
26
+ - Deploying to Vercel -- use `deploy-to-vercel` instead
27
+ - Deploying to AWS Lambda -- use `deploy-to-lambda` instead
28
+ - You need zero-ops serverless scaling and do not require persistent connections or long-running processes
29
+
30
+ > **Decision:** Choose this skill when you need a persistent Node.js process with full infrastructure control; choose a serverless skill when you want managed scaling.
31
+
38
32
  ## Prerequisites
39
33
 
40
- - Node.js 22 or later
34
+ - Node.js 24 or later
41
35
  - Docker and Docker Compose (recommended for production)
42
36
  - A FrontMCP project ready to build
43
37
 
@@ -55,7 +49,7 @@ Create a multi-stage `Dockerfile` in your project root:
55
49
 
56
50
  ```dockerfile
57
51
  # Stage 1: Build
58
- FROM node:22-alpine AS builder
52
+ FROM node:24-alpine AS builder
59
53
  WORKDIR /app
60
54
  COPY package.json yarn.lock ./
61
55
  RUN yarn install --frozen-lockfile
@@ -63,7 +57,7 @@ COPY . .
63
57
  RUN npx frontmcp build --target node
64
58
 
65
59
  # Stage 2: Production
66
- FROM node:22-alpine AS production
60
+ FROM node:24-alpine AS production
67
61
  WORKDIR /app
68
62
  ENV NODE_ENV=production
69
63
  COPY --from=builder /app/dist ./dist
@@ -221,9 +215,48 @@ services:
221
215
  cpus: '0.5'
222
216
  ```
223
217
 
218
+ ## Common Patterns
219
+
220
+ | Pattern | Correct | Incorrect | Why |
221
+ | ------------------------- | ------------------------------------ | ------------------------------------------------ | ------------------------------------------------------------------- |
222
+ | Build command | `frontmcp build --target node` | `tsc && node dist/main.js` | The FrontMCP build bundles deps and produces an optimized output |
223
+ | Docker base image | `node:24-alpine` (multi-stage) | `node:24` (single stage with dev deps) | Multi-stage keeps the production image small and secure |
224
+ | Process manager | PM2 with `-i max` cluster mode | Running `node dist/main.js` directly via `nohup` | PM2 handles restarts, logging, and multi-core clustering |
225
+ | Redis hostname in Compose | Service name `redis` | `localhost` or `127.0.0.1` | Containers communicate via Docker's internal DNS, not localhost |
226
+ | Environment config | `.env` file or orchestrator env vars | Hardcoded values in source code | Keeps secrets out of the codebase and allows per-environment config |
227
+
228
+ ## Verification Checklist
229
+
230
+ **Build**
231
+
232
+ - [ ] `frontmcp build --target node` completes without errors
233
+ - [ ] `dist/main.js` exists and is runnable with `node dist/main.js`
234
+
235
+ **Docker**
236
+
237
+ - [ ] `docker compose up -d` starts all services without errors
238
+ - [ ] `docker compose ps` shows all containers as healthy
239
+ - [ ] `curl http://localhost:3000/health` returns `{"status":"ok"}`
240
+
241
+ **Production Readiness**
242
+
243
+ - [ ] `NODE_ENV` is set to `production`
244
+ - [ ] Redis is reachable and `REDIS_URL` is configured
245
+ - [ ] Resource limits (memory, CPU) are defined in Compose or the orchestrator
246
+ - [ ] NGINX or another reverse proxy handles TLS termination
247
+ - [ ] Logs are collected and rotated (Docker log driver or PM2 log rotation)
248
+
224
249
  ## Troubleshooting
225
250
 
226
- - **Port already in use**: Change the `PORT` environment variable or stop the conflicting process.
227
- - **Redis connection refused**: Verify Redis is running and `REDIS_URL` is correct. In Docker Compose, use the service name (`redis`) as the hostname.
228
- - **Health check failing**: Increase `start_period` in the health check configuration to give the server more startup time.
229
- - **Out of memory**: Increase the memory limit in Docker or use `NODE_OPTIONS="--max-old-space-size=1024" node dist/main.js`.
251
+ | Problem | Cause | Solution |
252
+ | ---------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------- |
253
+ | Port already in use | Another process is bound to the same port | Change the `PORT` environment variable or stop the conflicting process with `lsof -i :3000` |
254
+ | Redis connection refused | Redis is not running or `REDIS_URL` is wrong | Verify Redis is running; in Docker Compose use the service name (`redis`) as the hostname |
255
+ | Health check failing | Server has not finished starting | Increase `start_period` in the Docker health check to give the server more startup time |
256
+ | Out of memory (OOM kill) | Container memory limit is too low | Increase the memory limit in Docker or set `NODE_OPTIONS="--max-old-space-size=1024"` |
257
+ | PM2 not restarting on reboot | Startup hook was not saved | Run `pm2 save && pm2 startup` to persist the process list across reboots |
258
+
259
+ ## Reference
260
+
261
+ - **Docs:** https://docs.agentfront.dev/frontmcp/deployment/production-build
262
+ - **Related skills:** `deploy-to-vercel`, `deploy-to-lambda`
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: deploy-to-vercel-config
3
+ description: Reference vercel.json configuration for deploying a FrontMCP server to Vercel
4
+ ---
5
+
6
+ {
7
+ "$schema": "https://openapi.vercel.sh/vercel.json",
8
+ "framework": null,
9
+ "buildCommand": "frontmcp build --target vercel",
10
+ "outputDirectory": "dist",
11
+ "rewrites": [
12
+ {
13
+ "source": "/(.*)",
14
+ "destination": "/api/frontmcp"
15
+ }
16
+ ],
17
+ "functions": {
18
+ "api/frontmcp.js": {
19
+ "memory": 512,
20
+ "maxDuration": 30
21
+ }
22
+ },
23
+ "regions": ["iad1"],
24
+ "headers": [
25
+ {
26
+ "source": "/health",
27
+ "headers": [
28
+ {
29
+ "key": "Cache-Control",
30
+ "value": "no-store"
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ "source": "/mcp",
36
+ "headers": [
37
+ {
38
+ "key": "Cache-Control",
39
+ "value": "no-store"
40
+ },
41
+ {
42
+ "key": "X-Content-Type-Options",
43
+ "value": "nosniff"
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "source": "/(.\*)",
49
+ "headers": [
50
+ {
51
+ "key": "X-Frame-Options",
52
+ "value": "DENY"
53
+ },
54
+ {
55
+ "key": "X-Content-Type-Options",
56
+ "value": "nosniff"
57
+ },
58
+ {
59
+ "key": "Referrer-Policy",
60
+ "value": "strict-origin-when-cross-origin"
61
+ }
62
+ ]
63
+ }
64
+ ]
65
+ }
@@ -0,0 +1,229 @@
1
+ ---
2
+ name: deploy-to-vercel
3
+ description: Deploy a FrontMCP server to Vercel serverless functions with Vercel KV storage
4
+ ---
5
+
6
+ # Deploy a FrontMCP Server to Vercel
7
+
8
+ This skill guides you through deploying a FrontMCP server to Vercel serverless functions with Vercel KV for persistent storage.
9
+
10
+ ## When to Use This Skill
11
+
12
+ ### Must Use
13
+
14
+ - Deploying a FrontMCP server to Vercel serverless functions
15
+ - Configuring Vercel KV as the persistence layer for sessions and skill cache
16
+ - Setting up a serverless MCP endpoint with automatic TLS and global CDN
17
+
18
+ ### Recommended
19
+
20
+ - You already use Vercel for your frontend and want a unified deployment pipeline
21
+ - You need zero-ops scaling without managing Docker containers or servers
22
+ - Deploying preview environments per pull request for MCP server testing
23
+
24
+ ### Skip When
25
+
26
+ - You need persistent connections, WebSockets, or long-running processes -- use `deploy-to-node` instead
27
+ - Deploying to AWS infrastructure or need AWS-specific services -- use `deploy-to-lambda` instead
28
+ - Your MCP operations routinely exceed the Vercel function timeout for your plan
29
+
30
+ > **Decision:** Choose this skill when you want serverless deployment on Vercel with minimal infrastructure management; choose a different target when you need persistent processes or AWS-native services.
31
+
32
+ ## Prerequisites
33
+
34
+ - A Vercel account (https://vercel.com)
35
+ - Vercel CLI installed: `npm install -g vercel`
36
+ - A built FrontMCP project
37
+
38
+ ## Step 1: Build for Vercel
39
+
40
+ ```bash
41
+ frontmcp build --target vercel
42
+ ```
43
+
44
+ This produces a Vercel-compatible output structure with an `api/` directory containing the serverless function entry points, optimized bundles for cold-start performance, and a `vercel.json` configuration file.
45
+
46
+ ## Step 2: Configure vercel.json
47
+
48
+ Create or update `vercel.json` in your project root:
49
+
50
+ ```json
51
+ {
52
+ "rewrites": [{ "source": "/(.*)", "destination": "/api/frontmcp" }],
53
+ "functions": {
54
+ "api/frontmcp.ts": {
55
+ "memory": 1024,
56
+ "maxDuration": 60
57
+ }
58
+ },
59
+ "regions": ["iad1"],
60
+ "headers": [
61
+ {
62
+ "source": "/(.*)",
63
+ "headers": [
64
+ { "key": "X-Content-Type-Options", "value": "nosniff" },
65
+ { "key": "X-Frame-Options", "value": "DENY" }
66
+ ]
67
+ }
68
+ ]
69
+ }
70
+ ```
71
+
72
+ The rewrite rule sends all requests to the single FrontMCP API handler, which internally routes MCP and HTTP requests.
73
+
74
+ ## Step 3: Configure Vercel KV Storage
75
+
76
+ Use the `vercel-kv` provider so FrontMCP stores sessions, skill cache, and plugin state in Vercel KV (powered by Upstash Redis):
77
+
78
+ ```typescript
79
+ import { FrontMcp, App } from '@frontmcp/sdk';
80
+
81
+ @App({ name: 'MyApp' })
82
+ class MyApp {}
83
+
84
+ @FrontMcp({
85
+ info: { name: 'my-server', version: '1.0.0' },
86
+ apps: [MyApp],
87
+ redis: { provider: 'vercel-kv' },
88
+ skillsConfig: {
89
+ enabled: true,
90
+ cache: {
91
+ enabled: true,
92
+ redis: { provider: 'vercel-kv' },
93
+ ttlMs: 60000,
94
+ },
95
+ },
96
+ })
97
+ class MyServer {}
98
+ ```
99
+
100
+ Provision the KV store in the Vercel dashboard under **Storage > Create Database > KV (Redis)**, then link it to your project. Vercel automatically injects the required environment variables.
101
+
102
+ ## Step 4: Environment Variables
103
+
104
+ Vercel KV variables are injected automatically when the store is linked. For manual setup or additional configuration, set them in the Vercel dashboard (**Settings > Environment Variables**) or via the CLI:
105
+
106
+ ```bash
107
+ vercel env add KV_REST_API_URL "https://your-kv-store.kv.vercel-storage.com"
108
+ vercel env add KV_REST_API_TOKEN "your-token"
109
+ vercel env add NODE_ENV production
110
+ vercel env add LOG_LEVEL info
111
+ ```
112
+
113
+ | Variable | Description | Required |
114
+ | ------------------- | ------------------------------ | ----------- |
115
+ | `KV_REST_API_URL` | Vercel KV REST endpoint | If using KV |
116
+ | `KV_REST_API_TOKEN` | Vercel KV authentication token | If using KV |
117
+ | `NODE_ENV` | Runtime environment | Yes |
118
+ | `LOG_LEVEL` | Logging verbosity | No |
119
+
120
+ ## Step 5: Deploy
121
+
122
+ ### Preview Deployment
123
+
124
+ ```bash
125
+ vercel
126
+ ```
127
+
128
+ Creates a preview deployment with a unique URL for validation.
129
+
130
+ ### Production Deployment
131
+
132
+ ```bash
133
+ vercel --prod
134
+ ```
135
+
136
+ Deploys to your production domain.
137
+
138
+ ### Custom Domain
139
+
140
+ ```bash
141
+ vercel domains add mcp.example.com
142
+ ```
143
+
144
+ Configure your DNS provider to point the domain to Vercel. TLS certificates are provisioned automatically.
145
+
146
+ ## Step 6: Verify
147
+
148
+ ```bash
149
+ # Health check
150
+ curl https://your-project.vercel.app/health
151
+
152
+ # Test MCP endpoint
153
+ curl -X POST https://your-project.vercel.app/mcp \
154
+ -H "Content-Type: application/json" \
155
+ -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
156
+ ```
157
+
158
+ ## Cold Start Notes
159
+
160
+ Vercel serverless functions experience cold starts after periods of inactivity. To minimize impact:
161
+
162
+ - The `frontmcp build --target vercel` output is optimized for bundle size. Avoid adding unnecessary dependencies.
163
+ - Consider Vercel's **Fluid Compute** for latency-sensitive workloads.
164
+ - Keep function memory at 1024 MB for faster initialization.
165
+
166
+ ### Execution Limits
167
+
168
+ | Plan | Max Duration |
169
+ | ---------- | ------------ |
170
+ | Hobby | 10 seconds |
171
+ | Pro | 60 seconds |
172
+ | Enterprise | 900 seconds |
173
+
174
+ Long-running MCP operations should complete within these limits or use streaming responses.
175
+
176
+ ### Statelessness
177
+
178
+ Serverless functions are stateless between invocations. All persistent state must go through Vercel KV. FrontMCP handles this automatically when `{ provider: 'vercel-kv' }` is configured.
179
+
180
+ ## Common Patterns
181
+
182
+ | Pattern | Correct | Incorrect | Why |
183
+ | --------------------- | ------------------------------------------ | ------------------------------------ | ------------------------------------------------------------------------------- |
184
+ | Build command | `frontmcp build --target vercel` | `tsc` or generic `npm run build` | The Vercel target produces optimized bundles and the `api/` directory structure |
185
+ | KV provider config | `{ provider: 'vercel-kv' }` | `{ provider: 'redis', host: '...' }` | Vercel KV uses its own REST API; a raw Redis provider will not connect |
186
+ | Rewrite rule | `"source": "/(.*)"` to `/api/frontmcp` | No rewrite or per-route entries | A single catch-all rewrite lets FrontMCP's internal router handle all paths |
187
+ | Environment variables | Link KV store in dashboard (auto-injected) | Hardcode `KV_REST_API_URL` in source | Linked stores inject vars automatically and rotate tokens safely |
188
+ | Function memory | 1024 MB for faster cold starts | 128 MB default | CPU scales with memory on Vercel; higher memory reduces initialization time |
189
+
190
+ ## Verification Checklist
191
+
192
+ **Build**
193
+
194
+ - [ ] `frontmcp build --target vercel` completes without errors
195
+ - [ ] `api/frontmcp.ts` (or `.js`) exists in the build output
196
+
197
+ **Deployment**
198
+
199
+ - [ ] `vercel` creates a preview deployment without errors
200
+ - [ ] `vercel --prod` deploys to the production domain
201
+ - [ ] `curl https://your-project.vercel.app/health` returns `{"status":"ok"}`
202
+
203
+ **Storage and Configuration**
204
+
205
+ - [ ] Vercel KV store is created and linked to the project
206
+ - [ ] `KV_REST_API_URL` and `KV_REST_API_TOKEN` are present in environment variables
207
+ - [ ] `NODE_ENV` is set to `production`
208
+ - [ ] `vercel.json` has correct rewrite, function config, and region settings
209
+
210
+ **Production Readiness**
211
+
212
+ - [ ] Custom domain is configured with DNS pointing to Vercel
213
+ - [ ] TLS certificate is provisioned (automatic on Vercel)
214
+ - [ ] `maxDuration` in `vercel.json` matches your Vercel plan limits
215
+
216
+ ## Troubleshooting
217
+
218
+ | Problem | Cause | Solution |
219
+ | -------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------- |
220
+ | Function timeout | Operation exceeds `maxDuration` or plan limit | Increase `maxDuration` in `vercel.json`; check plan limits (Hobby: 10s, Pro: 60s) |
221
+ | KV connection errors | KV store not linked or env vars missing | Re-link the KV store in the Vercel dashboard; verify `KV_REST_API_URL` and `KV_REST_API_TOKEN` |
222
+ | 404 on API routes | Rewrite rule missing or misconfigured | Confirm `vercel.json` has `"source": "/(.*)"` rewriting to `/api/frontmcp` |
223
+ | Bundle too large | Unnecessary dependencies included | Review dependencies and remove unused packages to reduce bundle size |
224
+ | Cold starts too slow | Low function memory or large bundle | Increase memory to 1024 MB; audit dependencies; consider Vercel Fluid Compute |
225
+
226
+ ## Reference
227
+
228
+ - **Docs:** https://docs.agentfront.dev/frontmcp/deployment/serverless
229
+ - **Related skills:** `deploy-to-node`, `deploy-to-lambda`