@frontmcp/skills 0.0.1 → 1.0.0-beta.10
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 +2 -2
- package/catalog/TEMPLATE.md +58 -13
- package/catalog/frontmcp-config/SKILL.md +143 -0
- package/catalog/frontmcp-config/references/configure-auth.md +238 -0
- package/catalog/frontmcp-config/references/configure-elicitation.md +178 -0
- package/catalog/frontmcp-config/references/configure-http.md +205 -0
- package/catalog/frontmcp-config/references/configure-session.md +205 -0
- package/catalog/frontmcp-config/references/configure-throttle.md +229 -0
- package/catalog/frontmcp-config/references/configure-transport.md +195 -0
- package/catalog/frontmcp-config/references/setup-redis.md +4 -0
- package/catalog/frontmcp-config/references/setup-sqlite.md +4 -0
- package/catalog/frontmcp-deployment/SKILL.md +127 -0
- package/catalog/frontmcp-deployment/references/build-for-browser.md +138 -0
- package/catalog/frontmcp-deployment/references/build-for-cli.md +138 -0
- package/catalog/{deployment/build-for-sdk/SKILL.md → frontmcp-deployment/references/build-for-sdk.md} +65 -24
- package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +213 -0
- package/catalog/{deployment/deploy-to-lambda/SKILL.md → frontmcp-deployment/references/deploy-to-lambda.md} +76 -63
- package/catalog/{deployment/deploy-to-node/references/Dockerfile.example → frontmcp-deployment/references/deploy-to-node-dockerfile.md} +13 -4
- package/catalog/{deployment/deploy-to-node/SKILL.md → frontmcp-deployment/references/deploy-to-node.md} +68 -40
- package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +60 -0
- package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +224 -0
- package/catalog/frontmcp-development/SKILL.md +121 -0
- package/catalog/frontmcp-development/references/create-adapter.md +165 -0
- package/catalog/{development/create-agent/references/llm-config.md → frontmcp-development/references/create-agent-llm-config.md} +5 -5
- package/catalog/{development/create-agent/SKILL.md → frontmcp-development/references/create-agent.md} +82 -44
- package/catalog/{development/create-job/SKILL.md → frontmcp-development/references/create-job.md} +61 -19
- package/catalog/{plugins/create-plugin-hooks/SKILL.md → frontmcp-development/references/create-plugin-hooks.md} +63 -11
- package/catalog/{plugins/create-plugin/SKILL.md → frontmcp-development/references/create-plugin.md} +65 -60
- package/catalog/{development/create-prompt/SKILL.md → frontmcp-development/references/create-prompt.md} +62 -26
- package/catalog/{development/create-provider/SKILL.md → frontmcp-development/references/create-provider.md} +62 -27
- package/catalog/{development/create-resource/SKILL.md → frontmcp-development/references/create-resource.md} +62 -30
- package/catalog/{development/create-skill-with-tools/SKILL.md → frontmcp-development/references/create-skill-with-tools.md} +69 -24
- package/catalog/{development/create-skill/SKILL.md → frontmcp-development/references/create-skill.md} +96 -22
- package/catalog/{development/create-tool/SKILL.md → frontmcp-development/references/create-tool.md} +62 -26
- package/catalog/{development/create-workflow/SKILL.md → frontmcp-development/references/create-workflow.md} +60 -18
- package/catalog/{development/decorators-guide/SKILL.md → frontmcp-development/references/decorators-guide.md} +123 -34
- package/catalog/frontmcp-development/references/official-adapters.md +194 -0
- package/catalog/{plugins/official-plugins/SKILL.md → frontmcp-development/references/official-plugins.md} +96 -31
- package/catalog/frontmcp-guides/SKILL.md +420 -0
- package/catalog/frontmcp-guides/references/example-knowledge-base.md +636 -0
- package/catalog/frontmcp-guides/references/example-task-manager.md +512 -0
- package/catalog/frontmcp-guides/references/example-weather-api.md +292 -0
- package/catalog/frontmcp-production-readiness/SKILL.md +253 -0
- package/catalog/frontmcp-setup/SKILL.md +130 -0
- package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +265 -0
- package/catalog/{setup/multi-app-composition/SKILL.md → frontmcp-setup/references/multi-app-composition.md} +65 -23
- package/catalog/{setup/nx-workflow/SKILL.md → frontmcp-setup/references/nx-workflow.md} +78 -21
- package/catalog/frontmcp-setup/references/project-structure-nx.md +246 -0
- package/catalog/frontmcp-setup/references/project-structure-standalone.md +212 -0
- package/catalog/{setup/setup-project/SKILL.md → frontmcp-setup/references/setup-project.md} +62 -62
- package/catalog/{setup/setup-redis/SKILL.md → frontmcp-setup/references/setup-redis.md} +59 -86
- package/catalog/{setup/setup-sqlite/SKILL.md → frontmcp-setup/references/setup-sqlite.md} +64 -76
- package/catalog/frontmcp-testing/SKILL.md +127 -0
- package/catalog/{testing/setup-testing/SKILL.md → frontmcp-testing/references/setup-testing.md} +78 -67
- package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-tool-unit.md +1 -0
- package/catalog/skills-manifest.json +39 -378
- package/package.json +2 -2
- package/src/loader.js +0 -1
- package/src/loader.js.map +1 -1
- package/src/manifest.d.ts +3 -3
- package/src/manifest.js +2 -3
- package/src/manifest.js.map +1 -1
- package/catalog/adapters/create-adapter/SKILL.md +0 -127
- package/catalog/adapters/official-adapters/SKILL.md +0 -136
- package/catalog/auth/configure-auth/SKILL.md +0 -250
- package/catalog/auth/configure-session/SKILL.md +0 -201
- package/catalog/config/configure-elicitation/SKILL.md +0 -136
- package/catalog/config/configure-http/SKILL.md +0 -167
- package/catalog/config/configure-throttle/SKILL.md +0 -189
- package/catalog/config/configure-transport/SKILL.md +0 -151
- package/catalog/deployment/build-for-browser/SKILL.md +0 -95
- package/catalog/deployment/build-for-cli/SKILL.md +0 -100
- package/catalog/deployment/deploy-to-cloudflare/SKILL.md +0 -192
- package/catalog/deployment/deploy-to-vercel/SKILL.md +0 -196
- package/catalog/deployment/deploy-to-vercel/references/vercel.json.example +0 -60
- package/catalog/setup/frontmcp-skills-usage/SKILL.md +0 -200
- package/catalog/setup/project-structure-nx/SKILL.md +0 -186
- package/catalog/setup/project-structure-standalone/SKILL.md +0 -153
- /package/catalog/{auth/configure-auth/references/auth-modes.md → frontmcp-config/references/configure-auth-modes.md} +0 -0
- /package/catalog/{config/configure-throttle/references/guard-config.md → frontmcp-config/references/configure-throttle-guard-config.md} +0 -0
- /package/catalog/{config/configure-transport/references/protocol-presets.md → frontmcp-config/references/configure-transport-protocol-presets.md} +0 -0
- /package/catalog/{development/create-tool/references/tool-annotations.md → frontmcp-development/references/create-tool-annotations.md} +0 -0
- /package/catalog/{development/create-tool/references/output-schema-types.md → frontmcp-development/references/create-tool-output-schema-types.md} +0 -0
- /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-auth.md +0 -0
- /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-browser-build.md +0 -0
- /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-cli-binary.md +0 -0
- /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-direct-client.md +0 -0
- /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-e2e-handler.md +0 -0
|
@@ -1,43 +1,32 @@
|
|
|
1
|
-
---
|
|
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
|
|
32
|
-
---
|
|
33
|
-
|
|
34
1
|
# Deploy a FrontMCP Server to Node.js
|
|
35
2
|
|
|
36
3
|
This skill walks you through deploying a FrontMCP server as a standalone Node.js application, optionally containerized with Docker for production use.
|
|
37
4
|
|
|
5
|
+
## When to Use This Skill
|
|
6
|
+
|
|
7
|
+
### Must Use
|
|
8
|
+
|
|
9
|
+
- Deploying a FrontMCP server to a VPS, dedicated server, or bare-metal infrastructure
|
|
10
|
+
- Running a long-lived Node.js process that needs full control over the runtime environment
|
|
11
|
+
- Containerizing a FrontMCP server with Docker or Docker Compose for self-hosted production
|
|
12
|
+
|
|
13
|
+
### Recommended
|
|
14
|
+
|
|
15
|
+
- Using PM2 or systemd to manage a FrontMCP process with automatic restarts
|
|
16
|
+
- Deploying behind NGINX or another reverse proxy for TLS termination and load balancing
|
|
17
|
+
- Running in environments where serverless cold starts are unacceptable
|
|
18
|
+
|
|
19
|
+
### Skip When
|
|
20
|
+
|
|
21
|
+
- Deploying to Vercel -- use `deploy-to-vercel` instead
|
|
22
|
+
- Deploying to AWS Lambda -- use `deploy-to-lambda` instead
|
|
23
|
+
- You need zero-ops serverless scaling and do not require persistent connections or long-running processes
|
|
24
|
+
|
|
25
|
+
> **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.
|
|
26
|
+
|
|
38
27
|
## Prerequisites
|
|
39
28
|
|
|
40
|
-
- Node.js
|
|
29
|
+
- Node.js 24 or later
|
|
41
30
|
- Docker and Docker Compose (recommended for production)
|
|
42
31
|
- A FrontMCP project ready to build
|
|
43
32
|
|
|
@@ -55,7 +44,7 @@ Create a multi-stage `Dockerfile` in your project root:
|
|
|
55
44
|
|
|
56
45
|
```dockerfile
|
|
57
46
|
# Stage 1: Build
|
|
58
|
-
FROM node:
|
|
47
|
+
FROM node:24-alpine AS builder
|
|
59
48
|
WORKDIR /app
|
|
60
49
|
COPY package.json yarn.lock ./
|
|
61
50
|
RUN yarn install --frozen-lockfile
|
|
@@ -63,7 +52,7 @@ COPY . .
|
|
|
63
52
|
RUN npx frontmcp build --target node
|
|
64
53
|
|
|
65
54
|
# Stage 2: Production
|
|
66
|
-
FROM node:
|
|
55
|
+
FROM node:24-alpine AS production
|
|
67
56
|
WORKDIR /app
|
|
68
57
|
ENV NODE_ENV=production
|
|
69
58
|
COPY --from=builder /app/dist ./dist
|
|
@@ -221,9 +210,48 @@ services:
|
|
|
221
210
|
cpus: '0.5'
|
|
222
211
|
```
|
|
223
212
|
|
|
213
|
+
## Common Patterns
|
|
214
|
+
|
|
215
|
+
| Pattern | Correct | Incorrect | Why |
|
|
216
|
+
| ------------------------- | ------------------------------------ | ------------------------------------------------ | ------------------------------------------------------------------- |
|
|
217
|
+
| Build command | `frontmcp build --target node` | `tsc && node dist/main.js` | The FrontMCP build bundles deps and produces an optimized output |
|
|
218
|
+
| Docker base image | `node:24-alpine` (multi-stage) | `node:24` (single stage with dev deps) | Multi-stage keeps the production image small and secure |
|
|
219
|
+
| Process manager | PM2 with `-i max` cluster mode | Running `node dist/main.js` directly via `nohup` | PM2 handles restarts, logging, and multi-core clustering |
|
|
220
|
+
| Redis hostname in Compose | Service name `redis` | `localhost` or `127.0.0.1` | Containers communicate via Docker's internal DNS, not localhost |
|
|
221
|
+
| Environment config | `.env` file or orchestrator env vars | Hardcoded values in source code | Keeps secrets out of the codebase and allows per-environment config |
|
|
222
|
+
|
|
223
|
+
## Verification Checklist
|
|
224
|
+
|
|
225
|
+
**Build**
|
|
226
|
+
|
|
227
|
+
- [ ] `frontmcp build --target node` completes without errors
|
|
228
|
+
- [ ] `dist/main.js` exists and is runnable with `node dist/main.js`
|
|
229
|
+
|
|
230
|
+
**Docker**
|
|
231
|
+
|
|
232
|
+
- [ ] `docker compose up -d` starts all services without errors
|
|
233
|
+
- [ ] `docker compose ps` shows all containers as healthy
|
|
234
|
+
- [ ] `curl http://localhost:3000/health` returns `{"status":"ok"}`
|
|
235
|
+
|
|
236
|
+
**Production Readiness**
|
|
237
|
+
|
|
238
|
+
- [ ] `NODE_ENV` is set to `production`
|
|
239
|
+
- [ ] Redis is reachable and `REDIS_URL` is configured
|
|
240
|
+
- [ ] Resource limits (memory, CPU) are defined in Compose or the orchestrator
|
|
241
|
+
- [ ] NGINX or another reverse proxy handles TLS termination
|
|
242
|
+
- [ ] Logs are collected and rotated (Docker log driver or PM2 log rotation)
|
|
243
|
+
|
|
224
244
|
## Troubleshooting
|
|
225
245
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
246
|
+
| Problem | Cause | Solution |
|
|
247
|
+
| ---------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
248
|
+
| 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` |
|
|
249
|
+
| 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 |
|
|
250
|
+
| Health check failing | Server has not finished starting | Increase `start_period` in the Docker health check to give the server more startup time |
|
|
251
|
+
| 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"` |
|
|
252
|
+
| PM2 not restarting on reboot | Startup hook was not saved | Run `pm2 save && pm2 startup` to persist the process list across reboots |
|
|
253
|
+
|
|
254
|
+
## Reference
|
|
255
|
+
|
|
256
|
+
- **Docs:** https://docs.agentfront.dev/frontmcp/deployment/production-build
|
|
257
|
+
- **Related skills:** `deploy-to-vercel`, `deploy-to-lambda`
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://openapi.vercel.sh/vercel.json",
|
|
3
|
+
"framework": null,
|
|
4
|
+
"buildCommand": "frontmcp build --target vercel",
|
|
5
|
+
"outputDirectory": "dist",
|
|
6
|
+
"rewrites": [
|
|
7
|
+
{
|
|
8
|
+
"source": "/(.*)",
|
|
9
|
+
"destination": "/api/frontmcp"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"functions": {
|
|
13
|
+
"api/frontmcp.js": {
|
|
14
|
+
"memory": 512,
|
|
15
|
+
"maxDuration": 30
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"regions": ["iad1"],
|
|
19
|
+
"headers": [
|
|
20
|
+
{
|
|
21
|
+
"source": "/health",
|
|
22
|
+
"headers": [
|
|
23
|
+
{
|
|
24
|
+
"key": "Cache-Control",
|
|
25
|
+
"value": "no-store"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"source": "/mcp",
|
|
31
|
+
"headers": [
|
|
32
|
+
{
|
|
33
|
+
"key": "Cache-Control",
|
|
34
|
+
"value": "no-store"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"key": "X-Content-Type-Options",
|
|
38
|
+
"value": "nosniff"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"source": "/(.\*)",
|
|
44
|
+
"headers": [
|
|
45
|
+
{
|
|
46
|
+
"key": "X-Frame-Options",
|
|
47
|
+
"value": "DENY"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"key": "X-Content-Type-Options",
|
|
51
|
+
"value": "nosniff"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"key": "Referrer-Policy",
|
|
55
|
+
"value": "strict-origin-when-cross-origin"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Deploy a FrontMCP Server to Vercel
|
|
2
|
+
|
|
3
|
+
This skill guides you through deploying a FrontMCP server to Vercel serverless functions with Vercel KV for persistent storage.
|
|
4
|
+
|
|
5
|
+
## When to Use This Skill
|
|
6
|
+
|
|
7
|
+
### Must Use
|
|
8
|
+
|
|
9
|
+
- Deploying a FrontMCP server to Vercel serverless functions
|
|
10
|
+
- Configuring Vercel KV as the persistence layer for sessions and skill cache
|
|
11
|
+
- Setting up a serverless MCP endpoint with automatic TLS and global CDN
|
|
12
|
+
|
|
13
|
+
### Recommended
|
|
14
|
+
|
|
15
|
+
- You already use Vercel for your frontend and want a unified deployment pipeline
|
|
16
|
+
- You need zero-ops scaling without managing Docker containers or servers
|
|
17
|
+
- Deploying preview environments per pull request for MCP server testing
|
|
18
|
+
|
|
19
|
+
### Skip When
|
|
20
|
+
|
|
21
|
+
- You need persistent connections, WebSockets, or long-running processes -- use `deploy-to-node` instead
|
|
22
|
+
- Deploying to AWS infrastructure or need AWS-specific services -- use `deploy-to-lambda` instead
|
|
23
|
+
- Your MCP operations routinely exceed the Vercel function timeout for your plan
|
|
24
|
+
|
|
25
|
+
> **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.
|
|
26
|
+
|
|
27
|
+
## Prerequisites
|
|
28
|
+
|
|
29
|
+
- A Vercel account (https://vercel.com)
|
|
30
|
+
- Vercel CLI installed: `npm install -g vercel`
|
|
31
|
+
- A built FrontMCP project
|
|
32
|
+
|
|
33
|
+
## Step 1: Build for Vercel
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
frontmcp build --target vercel
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
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.
|
|
40
|
+
|
|
41
|
+
## Step 2: Configure vercel.json
|
|
42
|
+
|
|
43
|
+
Create or update `vercel.json` in your project root:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"rewrites": [{ "source": "/(.*)", "destination": "/api/frontmcp" }],
|
|
48
|
+
"functions": {
|
|
49
|
+
"api/frontmcp.ts": {
|
|
50
|
+
"memory": 1024,
|
|
51
|
+
"maxDuration": 60
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"regions": ["iad1"],
|
|
55
|
+
"headers": [
|
|
56
|
+
{
|
|
57
|
+
"source": "/(.*)",
|
|
58
|
+
"headers": [
|
|
59
|
+
{ "key": "X-Content-Type-Options", "value": "nosniff" },
|
|
60
|
+
{ "key": "X-Frame-Options", "value": "DENY" }
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The rewrite rule sends all requests to the single FrontMCP API handler, which internally routes MCP and HTTP requests.
|
|
68
|
+
|
|
69
|
+
## Step 3: Configure Vercel KV Storage
|
|
70
|
+
|
|
71
|
+
Use the `vercel-kv` provider so FrontMCP stores sessions, skill cache, and plugin state in Vercel KV (powered by Upstash Redis):
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { FrontMcp, App } from '@frontmcp/sdk';
|
|
75
|
+
|
|
76
|
+
@App({ name: 'MyApp' })
|
|
77
|
+
class MyApp {}
|
|
78
|
+
|
|
79
|
+
@FrontMcp({
|
|
80
|
+
info: { name: 'my-server', version: '1.0.0' },
|
|
81
|
+
apps: [MyApp],
|
|
82
|
+
redis: { provider: 'vercel-kv' },
|
|
83
|
+
skillsConfig: {
|
|
84
|
+
enabled: true,
|
|
85
|
+
cache: {
|
|
86
|
+
enabled: true,
|
|
87
|
+
redis: { provider: 'vercel-kv' },
|
|
88
|
+
ttlMs: 60000,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
class MyServer {}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
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.
|
|
96
|
+
|
|
97
|
+
## Step 4: Environment Variables
|
|
98
|
+
|
|
99
|
+
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:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
vercel env add KV_REST_API_URL "https://your-kv-store.kv.vercel-storage.com"
|
|
103
|
+
vercel env add KV_REST_API_TOKEN "your-token"
|
|
104
|
+
vercel env add NODE_ENV production
|
|
105
|
+
vercel env add LOG_LEVEL info
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
| Variable | Description | Required |
|
|
109
|
+
| ------------------- | ------------------------------ | ----------- |
|
|
110
|
+
| `KV_REST_API_URL` | Vercel KV REST endpoint | If using KV |
|
|
111
|
+
| `KV_REST_API_TOKEN` | Vercel KV authentication token | If using KV |
|
|
112
|
+
| `NODE_ENV` | Runtime environment | Yes |
|
|
113
|
+
| `LOG_LEVEL` | Logging verbosity | No |
|
|
114
|
+
|
|
115
|
+
## Step 5: Deploy
|
|
116
|
+
|
|
117
|
+
### Preview Deployment
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
vercel
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Creates a preview deployment with a unique URL for validation.
|
|
124
|
+
|
|
125
|
+
### Production Deployment
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
vercel --prod
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Deploys to your production domain.
|
|
132
|
+
|
|
133
|
+
### Custom Domain
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
vercel domains add mcp.example.com
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Configure your DNS provider to point the domain to Vercel. TLS certificates are provisioned automatically.
|
|
140
|
+
|
|
141
|
+
## Step 6: Verify
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Health check
|
|
145
|
+
curl https://your-project.vercel.app/health
|
|
146
|
+
|
|
147
|
+
# Test MCP endpoint
|
|
148
|
+
curl -X POST https://your-project.vercel.app/mcp \
|
|
149
|
+
-H "Content-Type: application/json" \
|
|
150
|
+
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Cold Start Notes
|
|
154
|
+
|
|
155
|
+
Vercel serverless functions experience cold starts after periods of inactivity. To minimize impact:
|
|
156
|
+
|
|
157
|
+
- The `frontmcp build --target vercel` output is optimized for bundle size. Avoid adding unnecessary dependencies.
|
|
158
|
+
- Consider Vercel's **Fluid Compute** for latency-sensitive workloads.
|
|
159
|
+
- Keep function memory at 1024 MB for faster initialization.
|
|
160
|
+
|
|
161
|
+
### Execution Limits
|
|
162
|
+
|
|
163
|
+
| Plan | Max Duration |
|
|
164
|
+
| ---------- | ------------ |
|
|
165
|
+
| Hobby | 10 seconds |
|
|
166
|
+
| Pro | 60 seconds |
|
|
167
|
+
| Enterprise | 900 seconds |
|
|
168
|
+
|
|
169
|
+
Long-running MCP operations should complete within these limits or use streaming responses.
|
|
170
|
+
|
|
171
|
+
### Statelessness
|
|
172
|
+
|
|
173
|
+
Serverless functions are stateless between invocations. All persistent state must go through Vercel KV. FrontMCP handles this automatically when `{ provider: 'vercel-kv' }` is configured.
|
|
174
|
+
|
|
175
|
+
## Common Patterns
|
|
176
|
+
|
|
177
|
+
| Pattern | Correct | Incorrect | Why |
|
|
178
|
+
| --------------------- | ------------------------------------------ | ------------------------------------ | ------------------------------------------------------------------------------- |
|
|
179
|
+
| Build command | `frontmcp build --target vercel` | `tsc` or generic `npm run build` | The Vercel target produces optimized bundles and the `api/` directory structure |
|
|
180
|
+
| KV provider config | `{ provider: 'vercel-kv' }` | `{ provider: 'redis', host: '...' }` | Vercel KV uses its own REST API; a raw Redis provider will not connect |
|
|
181
|
+
| 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 |
|
|
182
|
+
| 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 |
|
|
183
|
+
| Function memory | 1024 MB for faster cold starts | 128 MB default | CPU scales with memory on Vercel; higher memory reduces initialization time |
|
|
184
|
+
|
|
185
|
+
## Verification Checklist
|
|
186
|
+
|
|
187
|
+
**Build**
|
|
188
|
+
|
|
189
|
+
- [ ] `frontmcp build --target vercel` completes without errors
|
|
190
|
+
- [ ] `api/frontmcp.ts` (or `.js`) exists in the build output
|
|
191
|
+
|
|
192
|
+
**Deployment**
|
|
193
|
+
|
|
194
|
+
- [ ] `vercel` creates a preview deployment without errors
|
|
195
|
+
- [ ] `vercel --prod` deploys to the production domain
|
|
196
|
+
- [ ] `curl https://your-project.vercel.app/health` returns `{"status":"ok"}`
|
|
197
|
+
|
|
198
|
+
**Storage and Configuration**
|
|
199
|
+
|
|
200
|
+
- [ ] Vercel KV store is created and linked to the project
|
|
201
|
+
- [ ] `KV_REST_API_URL` and `KV_REST_API_TOKEN` are present in environment variables
|
|
202
|
+
- [ ] `NODE_ENV` is set to `production`
|
|
203
|
+
- [ ] `vercel.json` has correct rewrite, function config, and region settings
|
|
204
|
+
|
|
205
|
+
**Production Readiness**
|
|
206
|
+
|
|
207
|
+
- [ ] Custom domain is configured with DNS pointing to Vercel
|
|
208
|
+
- [ ] TLS certificate is provisioned (automatic on Vercel)
|
|
209
|
+
- [ ] `maxDuration` in `vercel.json` matches your Vercel plan limits
|
|
210
|
+
|
|
211
|
+
## Troubleshooting
|
|
212
|
+
|
|
213
|
+
| Problem | Cause | Solution |
|
|
214
|
+
| -------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
215
|
+
| Function timeout | Operation exceeds `maxDuration` or plan limit | Increase `maxDuration` in `vercel.json`; check plan limits (Hobby: 10s, Pro: 60s) |
|
|
216
|
+
| 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` |
|
|
217
|
+
| 404 on API routes | Rewrite rule missing or misconfigured | Confirm `vercel.json` has `"source": "/(.*)"` rewriting to `/api/frontmcp` |
|
|
218
|
+
| Bundle too large | Unnecessary dependencies included | Review dependencies and remove unused packages to reduce bundle size |
|
|
219
|
+
| Cold starts too slow | Low function memory or large bundle | Increase memory to 1024 MB; audit dependencies; consider Vercel Fluid Compute |
|
|
220
|
+
|
|
221
|
+
## Reference
|
|
222
|
+
|
|
223
|
+
- **Docs:** https://docs.agentfront.dev/frontmcp/deployment/serverless
|
|
224
|
+
- **Related skills:** `deploy-to-node`, `deploy-to-lambda`
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontmcp-development
|
|
3
|
+
description: 'Use when you want to create a tool, add a resource, build a prompt, write a provider, implement an adapter, add OpenAPI integration, create a plugin, agent, job, or workflow. The skill for BUILDING any FrontMCP component.'
|
|
4
|
+
tags: [router, development, tools, resources, prompts, agents, skills, guide]
|
|
5
|
+
category: development
|
|
6
|
+
targets: [all]
|
|
7
|
+
bundle: [recommended, minimal, full]
|
|
8
|
+
priority: 10
|
|
9
|
+
visibility: both
|
|
10
|
+
license: Apache-2.0
|
|
11
|
+
metadata:
|
|
12
|
+
docs: https://docs.agentfront.dev/frontmcp/servers/overview
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# FrontMCP Development Router
|
|
16
|
+
|
|
17
|
+
Entry point for building MCP server components. This skill helps you find the right development skill based on what you want to build. It does not teach implementation details itself — it routes you to the specific skill that does.
|
|
18
|
+
|
|
19
|
+
## When to Use This Skill
|
|
20
|
+
|
|
21
|
+
### Must Use
|
|
22
|
+
|
|
23
|
+
- Starting a FrontMCP development task and unsure which component type to build (tool vs resource vs prompt vs agent)
|
|
24
|
+
- Onboarding to the FrontMCP development model and need an overview of all building blocks
|
|
25
|
+
- Planning a feature that may require multiple component types working together
|
|
26
|
+
|
|
27
|
+
### Recommended
|
|
28
|
+
|
|
29
|
+
- Looking up the canonical name of a development skill to install or search
|
|
30
|
+
- Comparing component types to decide which fits your use case
|
|
31
|
+
- Understanding how tools, resources, prompts, agents, and skills relate to each other
|
|
32
|
+
|
|
33
|
+
### Skip When
|
|
34
|
+
|
|
35
|
+
- You already know which component to build (go directly to `create-tool`, `create-resource`, etc.)
|
|
36
|
+
- You need to configure server settings, not build components (see `frontmcp-config`)
|
|
37
|
+
- You need to deploy or build, not develop (see `frontmcp-deployment`)
|
|
38
|
+
|
|
39
|
+
> **Decision:** Use this skill when you need to figure out WHAT to build. Use the specific skill when you already know.
|
|
40
|
+
|
|
41
|
+
## Scenario Routing Table
|
|
42
|
+
|
|
43
|
+
| Scenario | Skill | Description |
|
|
44
|
+
| -------------------------------------------------------- | ------------------------- | --------------------------------------------------------------------------------------------- |
|
|
45
|
+
| Expose an executable action that AI clients can call | `create-tool` | Class-based or function-style tools with Zod input/output validation |
|
|
46
|
+
| Expose read-only data via a URI | `create-resource` | Static resources or URI template resources for dynamic data |
|
|
47
|
+
| Create a reusable conversation template or system prompt | `create-prompt` | Prompt entries with arguments and multi-turn message sequences |
|
|
48
|
+
| Build an autonomous AI loop that orchestrates tools | `create-agent` | Agent entries with LLM config, inner tools, and swarm handoff |
|
|
49
|
+
| Register shared services or configuration via DI | `create-provider` | Dependency injection tokens, lifecycle hooks, factory providers |
|
|
50
|
+
| Run a background task with progress and retries | `create-job` | Job entries with attempt tracking, retry config, and progress |
|
|
51
|
+
| Chain multiple jobs into a sequential pipeline | `create-workflow` | Workflow entries that compose jobs with data passing |
|
|
52
|
+
| Write instruction-only AI guidance (no code execution) | `create-skill` | Skill entries with markdown instructions from files, strings, or URLs |
|
|
53
|
+
| Write AI guidance that also orchestrates tools | `create-skill-with-tools` | Skill entries that combine instructions with registered tools |
|
|
54
|
+
| Look up any decorator signature or option | `decorators-guide` | Complete reference for @Tool, @Resource, @Prompt, @Agent, @App, @FrontMcp, and more |
|
|
55
|
+
| Integrate an external API via OpenAPI spec | `official-adapters` | OpenapiAdapter with auth, polling, inline specs, and multiple API composition |
|
|
56
|
+
| Use official plugins (caching, remember, feature flags) | `official-plugins` | Built-in plugins for caching, session memory, approval, and feature flags (dashboard is beta) |
|
|
57
|
+
|
|
58
|
+
## Recommended Reading Order
|
|
59
|
+
|
|
60
|
+
1. **`decorators-guide`** — Start here to understand the full decorator landscape
|
|
61
|
+
2. **`create-tool`** — The most common building block; learn tools first
|
|
62
|
+
3. **`create-resource`** — Expose data alongside tools
|
|
63
|
+
4. **`create-prompt`** — Add reusable conversation templates
|
|
64
|
+
5. **`create-provider`** — Share services across tools and resources via DI
|
|
65
|
+
6. **`create-agent`** — Build autonomous AI loops (advanced)
|
|
66
|
+
7. **`create-job`** / **`create-workflow`** — Background processing (advanced)
|
|
67
|
+
8. **`create-skill`** / **`create-skill-with-tools`** — Author your own skills (meta)
|
|
68
|
+
9. **`official-adapters`** — Integrate external APIs via OpenAPI specs
|
|
69
|
+
10. **`official-plugins`** — Add caching, session memory, feature flags, and more
|
|
70
|
+
|
|
71
|
+
## Cross-Cutting Patterns
|
|
72
|
+
|
|
73
|
+
| Pattern | Applies To | Rule |
|
|
74
|
+
| ----------------- | --------------------------------- | -------------------------------------------------------------------------------------- |
|
|
75
|
+
| Naming convention | Tools | Use `snake_case` for tool names (`get_weather`, not `getWeather`) |
|
|
76
|
+
| Naming convention | Skills, resources | Use `kebab-case` for skill and resource names |
|
|
77
|
+
| File naming | All components | Use `<name>.<type>.ts` pattern (e.g., `fetch-weather.tool.ts`) |
|
|
78
|
+
| DI access | Tools, resources, prompts, agents | Use `this.get(TOKEN)` (throws) or `this.tryGet(TOKEN)` (returns undefined) |
|
|
79
|
+
| Error handling | All components | Use `this.fail(err)` with MCP error classes, not raw `throw` |
|
|
80
|
+
| Input validation | Tools | Always use Zod raw shapes (not `z.object()`) for `inputSchema` |
|
|
81
|
+
| Output validation | Tools | Always define `outputSchema` to prevent data leaks |
|
|
82
|
+
| Registration | All components | Add to `tools`, `resources`, `prompts`, `agents`, etc. arrays in `@App` or `@FrontMcp` |
|
|
83
|
+
| Test files | All components | Use `.spec.ts` extension, never `.test.ts` |
|
|
84
|
+
|
|
85
|
+
## Common Patterns
|
|
86
|
+
|
|
87
|
+
| Pattern | Correct | Incorrect | Why |
|
|
88
|
+
| ----------------------- | --------------------------------------------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
|
|
89
|
+
| Choosing component type | Tool for actions, Resource for data, Prompt for templates | Using a tool to return static data | Each type has protocol-level semantics; misuse confuses AI clients |
|
|
90
|
+
| Component registration | Register in `@App` arrays, compose apps in `@FrontMcp` | Register tools directly in `@FrontMcp` without an `@App` | Apps provide modularity; direct registration bypasses app-level hooks |
|
|
91
|
+
| Shared logic | Extract to a `@Provider` and inject via DI | Duplicate code across multiple tools | Providers are testable, lifecycle-managed, and scoped |
|
|
92
|
+
| Complex orchestration | Use `@Agent` with inner tools | Chain tool calls manually in a single tool | Agents handle LLM loops, retries, and tool selection automatically |
|
|
93
|
+
| Background work | Use `@Job` with retry config | Run long tasks inside a tool's `execute()` | Jobs have progress tracking, attempt awareness, and timeout handling |
|
|
94
|
+
|
|
95
|
+
## Verification Checklist
|
|
96
|
+
|
|
97
|
+
### Architecture
|
|
98
|
+
|
|
99
|
+
- [ ] Each component type matches its semantic purpose (action=tool, data=resource, template=prompt)
|
|
100
|
+
- [ ] Shared services use `@Provider` with DI tokens, not module-level singletons
|
|
101
|
+
- [ ] Components are registered in `@App` arrays, apps composed in `@FrontMcp`
|
|
102
|
+
|
|
103
|
+
### Development Workflow
|
|
104
|
+
|
|
105
|
+
- [ ] Files follow `<name>.<type>.ts` naming convention
|
|
106
|
+
- [ ] Each component has a corresponding `.spec.ts` test file
|
|
107
|
+
- [ ] `decorators-guide` consulted for unfamiliar decorator options
|
|
108
|
+
|
|
109
|
+
## Troubleshooting
|
|
110
|
+
|
|
111
|
+
| Problem | Cause | Solution |
|
|
112
|
+
| ---------------------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
113
|
+
| Unsure which component type to use | Requirements are ambiguous | Check the Scenario Routing Table above; if the action modifies state, use a tool; if it returns data by URI, use a resource |
|
|
114
|
+
| Component not discovered at runtime | Not registered in `@App` or `@FrontMcp` arrays | Add to the appropriate array (`tools`, `resources`, `prompts`, etc.) |
|
|
115
|
+
| DI token not resolving | Provider not registered in scope | Register the provider in the `providers` array of the same `@App` |
|
|
116
|
+
| Need both AI guidance and tool execution | Used `create-skill` but need tools too | Switch to `create-skill-with-tools` which combines instructions with registered tools |
|
|
117
|
+
|
|
118
|
+
## Reference
|
|
119
|
+
|
|
120
|
+
- [Server Overview](https://docs.agentfront.dev/frontmcp/servers/overview)
|
|
121
|
+
- Related skills: `create-tool`, `create-resource`, `create-prompt`, `create-agent`, `create-provider`, `create-job`, `create-workflow`, `create-skill`, `create-skill-with-tools`, `decorators-guide`, `official-adapters`, `official-plugins`
|