@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
@@ -0,0 +1,234 @@
1
+ ---
2
+ name: configure-throttle
3
+ description: Protect servers with rate limiting, concurrency control, execution timeouts, and IP filtering
4
+ ---
5
+
6
+ # Configuring Throttle, Rate Limits, and IP Filtering
7
+
8
+ Protect your FrontMCP server with rate limiting, concurrency control, execution timeouts, and IP filtering — at both server and per-tool levels.
9
+
10
+ ## When to Use This Skill
11
+
12
+ ### Must Use
13
+
14
+ - Deploying a server to production where abuse protection and rate limiting are required
15
+ - Exposing expensive or destructive tools that need concurrency caps and execution timeouts
16
+ - Restricting access by IP address with allow/deny lists for compliance or security
17
+
18
+ ### Recommended
19
+
20
+ - Enforcing per-session or per-IP request quotas to ensure fair resource distribution
21
+ - Adding global concurrency limits to prevent server overload under burst traffic
22
+ - Configuring distributed rate limiting across multiple server instances with Redis
23
+
24
+ ### Skip When
25
+
26
+ - Running a local development server with stdio transport only -- throttle adds unnecessary overhead
27
+ - Only need CORS or port configuration without rate limiting -- use `configure-http`
28
+ - Need authentication or session management rather than rate limiting -- use `configure-session` or `configure-auth`
29
+
30
+ > **Decision:** Use this skill when your server needs protection against abuse, rate limiting, concurrency control, IP filtering, or execution timeouts at either the server or per-tool level.
31
+
32
+ ## Server-Level Throttle (GuardConfig)
33
+
34
+ ```typescript
35
+ @FrontMcp({
36
+ info: { name: 'my-server', version: '1.0.0' },
37
+ apps: [MyApp],
38
+ throttle: {
39
+ enabled: true,
40
+
41
+ // Global rate limit (all requests combined)
42
+ global: {
43
+ maxRequests: 1000,
44
+ windowMs: 60000, // 1 minute window
45
+ partitionBy: 'global', // shared across all clients
46
+ },
47
+
48
+ // Global concurrency limit
49
+ globalConcurrency: {
50
+ maxConcurrent: 50,
51
+ partitionBy: 'global',
52
+ },
53
+
54
+ // Default limits for individual tools (applied unless tool overrides)
55
+ defaultRateLimit: {
56
+ maxRequests: 100,
57
+ windowMs: 60000,
58
+ },
59
+ defaultConcurrency: {
60
+ maxConcurrent: 10,
61
+ },
62
+ defaultTimeout: {
63
+ executeMs: 30000, // 30 second timeout
64
+ },
65
+
66
+ // IP filtering
67
+ ipFilter: {
68
+ allowList: ['10.0.0.0/8', '172.16.0.0/12'], // CIDR ranges
69
+ denyList: ['192.168.1.100'],
70
+ defaultAction: 'allow', // 'allow' | 'deny'
71
+ trustProxy: true, // trust X-Forwarded-For
72
+ trustedProxyDepth: 1, // proxy depth to trust
73
+ },
74
+ },
75
+ })
76
+ class Server {}
77
+ ```
78
+
79
+ ## Per-Tool Rate Limiting
80
+
81
+ Override server defaults on individual tools:
82
+
83
+ ```typescript
84
+ @Tool({
85
+ name: 'expensive_query',
86
+ description: 'Run an expensive database query',
87
+ inputSchema: {
88
+ query: z.string(),
89
+ },
90
+ outputSchema: { rows: z.array(z.record(z.unknown())) },
91
+
92
+ // Per-tool limits
93
+ rateLimit: {
94
+ maxRequests: 10,
95
+ windowMs: 60000,
96
+ partitionBy: 'session', // per-session rate limit
97
+ },
98
+ concurrency: {
99
+ maxConcurrent: 3,
100
+ queueTimeoutMs: 5000, // wait up to 5s for a slot
101
+ partitionBy: 'session',
102
+ },
103
+ timeout: {
104
+ executeMs: 60000, // 60 second timeout for this tool
105
+ },
106
+ })
107
+ class ExpensiveQueryTool extends ToolContext {
108
+ async execute(input: { query: string }) {
109
+ const db = this.get(DB_TOKEN);
110
+ return { rows: await db.query(input.query) };
111
+ }
112
+ }
113
+ ```
114
+
115
+ ## Configuration Types
116
+
117
+ ### RateLimitConfig
118
+
119
+ | Field | Type | Default | Description |
120
+ | ------------- | ------------------------------- | ---------- | ------------------------- |
121
+ | `maxRequests` | `number` | — | Max requests per window |
122
+ | `windowMs` | `number` | `60000` | Window duration in ms |
123
+ | `partitionBy` | `'global' \| 'ip' \| 'session'` | `'global'` | How to partition counters |
124
+
125
+ ### ConcurrencyConfig
126
+
127
+ | Field | Type | Default | Description |
128
+ | ---------------- | ------------------------------- | ---------- | -------------------------------------------------- |
129
+ | `maxConcurrent` | `number` | — | Max simultaneous executions |
130
+ | `queueTimeoutMs` | `number` | `0` | How long to wait for a slot (0 = fail immediately) |
131
+ | `partitionBy` | `'global' \| 'ip' \| 'session'` | `'global'` | How to partition counters |
132
+
133
+ ### TimeoutConfig
134
+
135
+ | Field | Type | Default | Description |
136
+ | ----------- | -------- | ------- | ------------------------ |
137
+ | `executeMs` | `number` | — | Max execution time in ms |
138
+
139
+ ### IpFilterConfig
140
+
141
+ | Field | Type | Default | Description |
142
+ | ------------------- | ------------------- | --------- | ----------------------------------- |
143
+ | `allowList` | `string[]` | — | Allowed IPs or CIDR ranges |
144
+ | `denyList` | `string[]` | — | Blocked IPs or CIDR ranges |
145
+ | `defaultAction` | `'allow' \| 'deny'` | `'allow'` | Action when IP matches neither list |
146
+ | `trustProxy` | `boolean` | `false` | Trust X-Forwarded-For header |
147
+ | `trustedProxyDepth` | `number` | `1` | How many proxy hops to trust |
148
+
149
+ ## Partition Strategies
150
+
151
+ - **`'global'`** — Single shared counter for all clients. Use for global capacity limits.
152
+ - **`'ip'`** — Separate counter per client IP. Use for per-client rate limiting.
153
+ - **`'session'`** — Separate counter per MCP session. Use for per-session fairness.
154
+
155
+ ## Distributed Rate Limiting
156
+
157
+ For multi-instance deployments, configure Redis storage in the guard:
158
+
159
+ ```typescript
160
+ throttle: {
161
+ enabled: true,
162
+ storage: {
163
+ type: 'redis',
164
+ redis: { config: { host: 'redis.internal', port: 6379 } },
165
+ },
166
+ global: { maxRequests: 1000, windowMs: 60000 },
167
+ }
168
+ ```
169
+
170
+ ## Verification
171
+
172
+ ```bash
173
+ # Start server
174
+ frontmcp dev
175
+
176
+ # Test rate limiting (send 101 requests rapidly)
177
+ for i in $(seq 1 101); do
178
+ curl -s -o /dev/null -w "%{http_code}\n" -X POST http://localhost:3001/ \
179
+ -H 'Content-Type: application/json' \
180
+ -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
181
+ done
182
+ # Should see 429 responses after limit is exceeded
183
+ ```
184
+
185
+ ## Common Patterns
186
+
187
+ | Pattern | Correct | Incorrect | Why |
188
+ | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
189
+ | Per-tool override | Set `rateLimit` on the `@Tool` decorator to override server defaults | Duplicating the full server-level `throttle` config inside each tool | Per-tool config merges with server defaults; only specify the fields you want to override |
190
+ | Partition strategy | Use `partitionBy: 'session'` for per-user fairness on shared tools | Using `partitionBy: 'global'` for all limits | Global partitioning means one abusive client can exhaust the quota for everyone |
191
+ | Distributed rate limiting | Configure `storage: { type: 'redis', redis: { config: { host, port } } }` in the throttle block for multi-instance deployments | Relying on in-memory counters with multiple server instances | In-memory counters are per-process; each instance tracks limits independently, allowing N times the intended rate |
192
+ | IP filter ordering | Set `defaultAction: 'deny'` with an explicit `allowList` for strict environments | Setting `defaultAction: 'allow'` with only a `denyList` | A deny-by-default posture is safer; new unknown IPs are blocked until explicitly allowed |
193
+ | Concurrency queue timeout | Set `queueTimeoutMs` on concurrency config to queue excess requests briefly | Setting `queueTimeoutMs: 0` on expensive tools | Zero timeout immediately rejects excess requests instead of briefly queuing them, causing unnecessary failures during short bursts |
194
+
195
+ ## Verification Checklist
196
+
197
+ ### Configuration
198
+
199
+ - [ ] `throttle.enabled` is set to `true` in the `@FrontMcp` decorator
200
+ - [ ] `global.maxRequests` and `global.windowMs` are set to reasonable production values
201
+ - [ ] `defaultTimeout.executeMs` is configured to prevent runaway tool executions
202
+ - [ ] IP filter `defaultAction` matches your security posture (`allow` for open, `deny` for restricted)
203
+
204
+ ### Per-Tool
205
+
206
+ - [ ] Expensive or destructive tools have explicit `rateLimit` and `concurrency` overrides
207
+ - [ ] `partitionBy` is set to `'session'` or `'ip'` for tools that need per-client fairness
208
+ - [ ] `queueTimeoutMs` is set on concurrency-limited tools to handle brief bursts
209
+
210
+ ### Distributed
211
+
212
+ - [ ] Redis storage is configured in the throttle block for multi-instance deployments
213
+ - [ ] Redis connection is verified before deploying (see `setup-redis`)
214
+
215
+ ### Runtime
216
+
217
+ - [ ] Sending requests beyond the rate limit returns HTTP 429
218
+ - [ ] Blocked IPs receive HTTP 403
219
+ - [ ] Tool executions that exceed `executeMs` are terminated and return a timeout error
220
+
221
+ ## Troubleshooting
222
+
223
+ | Problem | Cause | Solution |
224
+ | ----------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
225
+ | Rate limits not enforced across instances | In-memory storage used with multiple server replicas | Configure `storage: { type: 'redis' }` in the throttle block to share counters |
226
+ | All requests rejected with 403 | `ipFilter.defaultAction` set to `'deny'` without any `allowList` entries | Add the allowed IP ranges to `allowList` or change `defaultAction` to `'allow'` |
227
+ | Tools timing out unexpectedly | `defaultTimeout.executeMs` too low for the tool's normal execution time | Increase the global default or set a per-tool `timeout.executeMs` override |
228
+ | `X-Forwarded-For` header ignored | `ipFilter.trustProxy` not enabled or `trustedProxyDepth` too low | Set `trustProxy: true` and adjust `trustedProxyDepth` to match your proxy chain |
229
+ | Rate limit resets not aligned with expectations | `windowMs` misunderstood as a sliding window when it is a fixed window | The window is fixed; all counters reset at the end of each `windowMs` interval |
230
+
231
+ ## Reference
232
+
233
+ - [Guard Configuration Docs](https://docs.agentfront.dev/frontmcp/servers/guard)
234
+ - Related skills: `configure-http`, `configure-transport`, `setup-redis`, `configure-auth`
@@ -1,3 +1,8 @@
1
+ ---
2
+ name: configure-transport-protocol-presets
3
+ description: Reference for legacy, modern, stateless, and minimal transport protocol presets
4
+ ---
5
+
1
6
  # Transport Protocol Presets Reference
2
7
 
3
8
  ## Preset Configurations
@@ -0,0 +1,200 @@
1
+ ---
2
+ name: configure-transport
3
+ description: Configure client transport protocols including SSE, Streamable HTTP, and stateless API modes
4
+ ---
5
+
6
+ # Configuring Transport
7
+
8
+ Configure how clients connect to your FrontMCP server — SSE, Streamable HTTP, stateless API, or a combination.
9
+
10
+ ## When to Use This Skill
11
+
12
+ ### Must Use
13
+
14
+ - Setting up a new FrontMCP server and need to decide on a transport protocol (SSE, Streamable HTTP, or stateless)
15
+ - Deploying to serverless targets (Vercel, Lambda, Cloudflare) that require stateless transport mode
16
+ - Running multiple server instances behind a load balancer that require distributed sessions via Redis
17
+
18
+ ### Recommended
19
+
20
+ - Migrating an existing server from legacy SSE to modern Streamable HTTP
21
+ - Enabling SSE event resumability so clients can reconnect after network interruptions
22
+ - Fine-tuning protocol flags beyond what the built-in presets provide
23
+
24
+ ### Skip When
25
+
26
+ - You are configuring authentication or session tokens (use `configure-auth` instead)
27
+ - You need to set up plugin middleware without changing the transport layer (use `create-plugin` reference instead)
28
+
29
+ > **Decision:** Use this skill whenever you need to choose, combine, or customize the protocol(s) your MCP server exposes to clients.
30
+
31
+ ## TransportOptionsInput
32
+
33
+ ```typescript
34
+ @FrontMcp({
35
+ info: { name: 'my-server', version: '1.0.0' },
36
+ apps: [MyApp],
37
+ transport: {
38
+ sessionMode: 'stateful', // 'stateful' | 'stateless'
39
+ protocol: 'legacy', // preset or custom ProtocolConfig
40
+ persistence: {
41
+ // false to disable
42
+ redis: { provider: 'redis', host: 'localhost', port: 6379 },
43
+ defaultTtlMs: 3600000,
44
+ },
45
+ distributedMode: 'auto', // boolean | 'auto'
46
+ eventStore: {
47
+ enabled: true,
48
+ provider: 'redis', // 'memory' | 'redis'
49
+ maxEvents: 10000,
50
+ ttlMs: 300000,
51
+ },
52
+ },
53
+ })
54
+ class Server {}
55
+ ```
56
+
57
+ ## Protocol Presets
58
+
59
+ Choose a preset that matches your deployment:
60
+
61
+ | Preset | SSE | Streamable HTTP | JSON | Stateless | Legacy SSE | Strict Session |
62
+ | -------------------- | --- | --------------- | ---- | --------- | ---------- | -------------- |
63
+ | `'legacy'` (default) | Yes | Yes | No | No | Yes | Yes |
64
+ | `'modern'` | Yes | Yes | No | No | No | Yes |
65
+ | `'stateless-api'` | No | No | No | Yes | No | No |
66
+ | `'full'` | Yes | Yes | Yes | Yes | Yes | No |
67
+
68
+ ### When to Use Each
69
+
70
+ - **`'legacy'`** — Default. Maximum compatibility with all MCP clients (Claude Desktop, etc.). Best for Node.js deployments.
71
+ - **`'modern'`** — Drop legacy SSE support. Use when all clients support modern MCP protocol.
72
+ - **`'stateless-api'`** — No sessions, pure request/response. Use for **Vercel**, **Lambda**, and other serverless targets.
73
+ - **`'full'`** — All protocols enabled. Use for development or when you need every transport option.
74
+
75
+ ### Custom Protocol Config
76
+
77
+ Override individual protocol flags:
78
+
79
+ ```typescript
80
+ transport: {
81
+ protocol: {
82
+ sse: true, // SSE listener endpoint
83
+ streamable: true, // Streamable HTTP POST
84
+ json: false, // JSON-only responses (no streaming)
85
+ stateless: false, // Stateless HTTP (no sessions)
86
+ legacy: false, // Legacy SSE transport
87
+ strictSession: true, // Require session ID for streamable HTTP
88
+ },
89
+ }
90
+ ```
91
+
92
+ ## Distributed Sessions
93
+
94
+ For multi-instance deployments (load balanced), enable persistence with Redis:
95
+
96
+ ```typescript
97
+ transport: {
98
+ distributedMode: true,
99
+ persistence: {
100
+ redis: { provider: 'redis', host: 'redis.internal', port: 6379 },
101
+ defaultTtlMs: 3600000, // 1 hour session TTL
102
+ },
103
+ }
104
+ ```
105
+
106
+ - `distributedMode: 'auto'` — auto-detect based on whether Redis is configured
107
+ - `distributedMode: true` — force distributed mode (requires Redis)
108
+ - `distributedMode: false` — single-instance mode (in-memory sessions)
109
+
110
+ ## Event Store (SSE Resumability)
111
+
112
+ Enable event store so clients can resume SSE connections after disconnects:
113
+
114
+ ```typescript
115
+ transport: {
116
+ eventStore: {
117
+ enabled: true,
118
+ provider: 'redis', // 'memory' for single instance, 'redis' for distributed
119
+ maxEvents: 10000, // max events to store
120
+ ttlMs: 300000, // 5 minute TTL
121
+ redis: { provider: 'redis', host: 'localhost' },
122
+ },
123
+ }
124
+ ```
125
+
126
+ ## Target-Specific Recommendations
127
+
128
+ | Target | Recommended Preset | Persistence | Event Store |
129
+ | ------------------------ | ------------------ | ----------- | ----------- |
130
+ | Node.js (single) | `'legacy'` | `false` | Memory |
131
+ | Node.js (multi-instance) | `'modern'` | Redis | Redis |
132
+ | Vercel | `'stateless-api'` | `false` | Disabled |
133
+ | Lambda | `'stateless-api'` | `false` | Disabled |
134
+ | Cloudflare | `'stateless-api'` | `false` | Disabled |
135
+
136
+ ## Verification
137
+
138
+ ```bash
139
+ # Start server and test SSE
140
+ frontmcp dev
141
+
142
+ # Test SSE endpoint
143
+ curl -N http://localhost:3001/sse
144
+
145
+ # Test streamable HTTP
146
+ curl -X POST http://localhost:3001/ -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
147
+ ```
148
+
149
+ ## Common Patterns
150
+
151
+ | Pattern | Correct | Incorrect | Why |
152
+ | -------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------- |
153
+ | Choosing a preset | `protocol: 'modern'` | `protocol: { sse: true, streamable: true, legacy: false }` | Use a preset when it matches your needs; custom config is for overrides only |
154
+ | Serverless transport | `protocol: 'stateless-api'` with `sessionMode: 'stateless'` | `protocol: 'legacy'` on Lambda | Legacy preset creates sessions that serverless cannot maintain between invocations |
155
+ | Distributed sessions | `distributedMode: true` with Redis `persistence` configured | `distributedMode: true` without Redis | Distributed mode requires Redis; omitting it causes a startup error |
156
+ | Event store provider | `provider: 'redis'` for multi-instance, `provider: 'memory'` for single instance | `provider: 'memory'` behind a load balancer | In-memory event store is not shared across instances, breaking SSE resumability |
157
+ | Session TTL | Set `defaultTtlMs` to match your expected session duration | Omitting `defaultTtlMs` when using Redis persistence | Missing TTL can cause sessions to accumulate indefinitely in Redis |
158
+
159
+ ## Verification Checklist
160
+
161
+ ### Transport Protocol
162
+
163
+ - [ ] Correct preset is chosen for the deployment target (see Target-Specific Recommendations table)
164
+ - [ ] Custom protocol flags, if used, do not conflict with the selected `sessionMode`
165
+ - [ ] Legacy SSE is disabled when all clients support modern MCP protocol
166
+
167
+ ### Session and Persistence
168
+
169
+ - [ ] `sessionMode` is `'stateless'` for serverless deployments
170
+ - [ ] `distributedMode` is enabled and Redis is configured for multi-instance deployments
171
+ - [ ] `defaultTtlMs` is set to a reasonable value when persistence is enabled
172
+
173
+ ### Event Store
174
+
175
+ - [ ] Event store provider matches the deployment topology (memory for single, Redis for distributed)
176
+ - [ ] `maxEvents` and `ttlMs` are tuned for expected traffic volume
177
+ - [ ] Event store is disabled for stateless-api deployments
178
+
179
+ ### Runtime Validation
180
+
181
+ - [ ] Server starts without transport-related errors
182
+ - [ ] SSE endpoint (`/sse`) responds with `text/event-stream` when SSE is enabled
183
+ - [ ] Streamable HTTP endpoint (`/`) accepts JSON-RPC POST requests when streamable is enabled
184
+ - [ ] Clients can reconnect and resume SSE streams when event store is enabled
185
+
186
+ ## Troubleshooting
187
+
188
+ | Problem | Cause | Solution |
189
+ | -------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
190
+ | Server rejects SSE connections | SSE is disabled in the protocol config or preset | Switch to `'legacy'`, `'modern'`, or `'full'` preset, or set `sse: true` in custom config |
191
+ | `distributedMode` startup error | Redis persistence is not configured | Add a `persistence.redis` block with valid connection details |
192
+ | Clients lose state after reconnect | Event store is disabled or using in-memory provider behind a load balancer | Enable event store with `provider: 'redis'` for distributed deployments |
193
+ | Serverless function times out on SSE | Using a stateful preset on a serverless target | Switch to `'stateless-api'` preset and set `sessionMode: 'stateless'` |
194
+ | Session not found after server restart | In-memory sessions do not survive restarts | Enable Redis persistence with `distributedMode: true` |
195
+ | Streamable HTTP returns 404 | Streamable HTTP is not enabled in the current preset | Use `'modern'`, `'legacy'`, or `'full'` preset, or set `streamable: true` in custom config |
196
+
197
+ ## Reference
198
+
199
+ - **Docs:** [Runtime Modes and Transport Configuration](https://docs.agentfront.dev/frontmcp/deployment/runtime-modes)
200
+ - **Related skills:** `configure-auth`, `create-plugin`
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: setup-redis
3
+ description: Cross-reference to the full Redis configuration guide in frontmcp-setup
4
+ ---
5
+
6
+ # Redis Setup Reference
7
+
8
+ > This reference is maintained in `frontmcp-setup/references/setup-redis.md`.
9
+ > See that file for the full Redis configuration guide including connection options, Vercel KV setup, Docker Compose examples, and troubleshooting.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: setup-sqlite
3
+ description: Cross-reference to the full SQLite configuration guide in frontmcp-setup
4
+ ---
5
+
6
+ # SQLite Setup Reference
7
+
8
+ > This reference is maintained in `frontmcp-setup/references/setup-sqlite.md`.
9
+ > See that file for the full SQLite configuration guide including WAL mode, encryption, daemon mode, and troubleshooting.
@@ -0,0 +1,152 @@
1
+ ---
2
+ name: frontmcp-deployment
3
+ description: 'Use when you need to deploy, build for production, containerize, or ship a FrontMCP server. Covers Vercel, Lambda, Cloudflare, Docker, edge runtime, serverless, bundle for CLI, and Node targets. Triggers: deploy, build for production, dockerize, serverless, go live.'
4
+ tags: [router, deployment, node, vercel, lambda, cloudflare, cli, browser, sdk, guide]
5
+ category: deployment
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/deployment/overview
13
+ ---
14
+
15
+ # FrontMCP Deployment Router
16
+
17
+ Entry point for deploying and building FrontMCP servers. This skill helps you choose the right deployment target or build format based on your infrastructure requirements.
18
+
19
+ ## When to Use This Skill
20
+
21
+ ### Must Use
22
+
23
+ - Choosing between deployment targets (Node vs Vercel vs Lambda vs Cloudflare) for a new project
24
+ - Deciding on a build format (server vs CLI vs browser vs SDK) for distribution
25
+ - Planning infrastructure and need to understand trade-offs between deployment options
26
+
27
+ ### Recommended
28
+
29
+ - Comparing serverless platforms for cost, cold-start, and feature support
30
+ - Understanding which transport protocol and storage provider each target requires
31
+ - Migrating from one deployment target to another
32
+
33
+ ### Skip When
34
+
35
+ - You already know your deployment target (go directly to `deploy-to-node`, `deploy-to-vercel`, etc.)
36
+ - You need to configure server settings, not deploy (see `frontmcp-config`)
37
+ - You need to build components, not ship them (see `frontmcp-development`)
38
+
39
+ > **Decision:** Use this skill when you need to figure out WHERE to deploy. Use the specific skill when you already know.
40
+
41
+ ## Prerequisites
42
+
43
+ - A working FrontMCP server with at least one `@App` and one `@Tool` (see `frontmcp-development`)
44
+ - Server configuration completed (see `frontmcp-config`)
45
+ - Tests passing locally (see `frontmcp-testing`)
46
+
47
+ ## Steps
48
+
49
+ 1. Review the Scenario Routing Table and Target Comparison below to choose a deployment target
50
+ 2. Run `frontmcp build --target <target>` to produce the build output
51
+ 3. Follow the specific deployment skill (e.g., `deploy-to-node`, `deploy-to-vercel`) for platform instructions
52
+ 4. Verify with the Post-Deployment checklist at the end of this skill
53
+
54
+ ## Scenario Routing Table
55
+
56
+ | Scenario | Skill | 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
+ | Standalone executable binary for distribution | `build-for-cli` | Single-binary CLI with stdio transport, embedded storage |
63
+ | Run MCP in a web browser | `build-for-browser` | Browser-compatible bundle with in-memory transport |
64
+ | Embed MCP into an existing Node.js application | `build-for-sdk` | Library build for programmatic usage without standalone server |
65
+ | Write a Dockerfile for Node.js deployment | `deploy-to-node-dockerfile` | Dockerfile configuration for Node.js deployment |
66
+ | Configure Vercel-specific settings (vercel.json) | `deploy-to-vercel-config` | Vercel-specific configuration (vercel.json) |
67
+
68
+ ### CLI Commands for Deployment and Operations
69
+
70
+ Beyond `frontmcp build`, the CLI provides commands for the full deployment lifecycle:
71
+
72
+ | Command | Description |
73
+ | ---------------------------- | ----------------------------------------------------------------------------------- |
74
+ | `frontmcp build -t <target>` | Build for target: `node`, `vercel`, `lambda`, `cloudflare`, `cli`, `browser`, `sdk` |
75
+ | `frontmcp build -t cli --js` | Build CLI as JS bundle (instead of native binary via SEA) |
76
+ | `frontmcp start <name>` | Start a named MCP server with supervisor (process management) |
77
+ | `frontmcp stop <name>` | Stop managed server (`-f` for force kill) |
78
+ | `frontmcp restart <name>` | Restart managed server |
79
+ | `frontmcp status [name]` | Show process status (detail if name given, table if omitted) |
80
+ | `frontmcp list` | List all managed processes |
81
+ | `frontmcp logs <name>` | Tail log output (`-F` follow, `-n` lines) |
82
+ | `frontmcp socket <entry>` | Start Unix socket daemon for local MCP server |
83
+ | `frontmcp service <action>` | Install/uninstall systemd (Linux) or launchd (macOS) service |
84
+ | `frontmcp install <source>` | Install MCP app from npm, local path, or git |
85
+ | `frontmcp uninstall <name>` | Remove installed MCP app |
86
+ | `frontmcp configure <name>` | Re-run setup questionnaire for installed app |
87
+ | `frontmcp doctor` | Check Node.js/npm versions and tsconfig requirements |
88
+ | `frontmcp inspector` | Launch MCP Inspector for debugging |
89
+ | `frontmcp init` | Create or fix tsconfig.json for FrontMCP |
90
+
91
+ ## Target Comparison
92
+
93
+ | Target | Transport | Storage | Cold Start | Stateful | Best For |
94
+ | ---------- | --------------------------- | --------------------- | ---------- | -------- | -------------------------------- |
95
+ | Node | stdio, SSE, Streamable HTTP | Redis, SQLite, memory | None | Yes | Full-featured production servers |
96
+ | Vercel | Streamable HTTP (stateless) | Vercel KV | ~250ms | No | Rapid deployment, hobby/startup |
97
+ | Lambda | Streamable HTTP (stateless) | DynamoDB, ElastiCache | ~500ms | No | AWS ecosystem, event-driven |
98
+ | Cloudflare | Streamable HTTP (stateless) | KV, Durable Objects | ~5ms | Limited | Edge-first, global latency |
99
+ | CLI | stdio | SQLite, memory | None | Yes | Desktop tools, local agents |
100
+ | Browser | In-memory | memory | None | Yes | Client-side AI, demos |
101
+ | SDK | Programmatic | Configurable | None | Yes | Embedding in existing apps |
102
+
103
+ > **Note on storage:** The FrontMCP SDK's `StorageProvider` type supports `'redis'` and `'vercel-kv'` as built-in providers. References to DynamoDB, Cloudflare KV, D1, and Durable Objects in the table above refer to platform-native storage that you configure outside the SDK (e.g., via AWS SDK, Cloudflare bindings). The SDK does not provide a built-in adapter for these — use them directly in your tools/providers.
104
+
105
+ ## Cross-Cutting Patterns
106
+
107
+ | Pattern | Rule |
108
+ | --------------------- | -------------------------------------------------------------------------------------------------------- |
109
+ | Transport selection | Stateful servers (Node, CLI) can use stdio or SSE; serverless must use Streamable HTTP (stateless) |
110
+ | Storage mapping | Node: Redis or SQLite; Vercel: Vercel KV; Lambda: DynamoDB; Cloudflare: KV; CLI: SQLite; Browser: memory |
111
+ | Environment variables | Never hardcode secrets; use `.env` locally, platform secrets in production |
112
+ | Build command | All targets: `frontmcp build --target <target>` produces optimized output |
113
+ | Entry point | All targets require `export default` of the `@FrontMcp` class from `main.ts` |
114
+
115
+ ## Common Patterns
116
+
117
+ | Pattern | Correct | Incorrect | Why |
118
+ | ------------------ | ------------------------------------------------------- | --------------------------- | ---------------------------------------------------------------------------- |
119
+ | Target selection | Choose based on infrastructure constraints | Choose based on familiarity | Each target has different transport, storage, and cold-start characteristics |
120
+ | Serverless storage | Use platform-native storage (Vercel KV, DynamoDB) | Use Redis on serverless | Platform-native storage avoids VPC/connection overhead on cold starts |
121
+ | Environment config | Platform secrets (Vercel env, AWS SSM) | `.env` files in production | Platform secrets are encrypted, rotatable, and not committed to git |
122
+ | Build verification | Run `frontmcp build --target <target>` before deploying | Deploy source code directly | Build step validates config, bundles dependencies, and optimizes output |
123
+
124
+ ## Verification Checklist
125
+
126
+ ### Pre-Deployment
127
+
128
+ - [ ] `frontmcp build --target <target>` completes without errors
129
+ - [ ] Environment variables configured for the target platform
130
+ - [ ] Storage provider configured and accessible (Redis, KV, DynamoDB, etc.)
131
+ - [ ] Transport protocol matches target requirements (stateless for serverless)
132
+
133
+ ### Post-Deployment
134
+
135
+ - [ ] Health check endpoint responds
136
+ - [ ] `tools/list` returns expected tools
137
+ - [ ] Tool execution works end-to-end
138
+ - [ ] Storage persistence verified (create, read, restart, read again)
139
+
140
+ ## Troubleshooting
141
+
142
+ | Problem | Cause | Solution |
143
+ | ---------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------- |
144
+ | Cold start timeout on serverless | Bundle too large or heavy initialization | Lazy-load providers; reduce bundle with tree shaking; increase function timeout |
145
+ | Session lost between requests | Using memory storage on stateless serverless | Switch to platform-native storage (Vercel KV, DynamoDB, etc.) |
146
+ | CORS errors on browser/web clients | HTTP CORS not configured | Add CORS config via `configure-http` skill |
147
+ | Build fails with missing module | Node-only module in browser/edge build | Use conditional imports or `@frontmcp/utils` cross-platform utilities |
148
+
149
+ ## Reference
150
+
151
+ - [Deployment Overview](https://docs.agentfront.dev/frontmcp/deployment/overview)
152
+ - Related skills: `deploy-to-node`, `deploy-to-vercel`, `deploy-to-lambda`, `deploy-to-cloudflare`, `build-for-cli`, `build-for-browser`, `build-for-sdk`, `configure-transport`