@frontmcp/skills 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/catalog/TEMPLATE.md +16 -11
- package/catalog/frontmcp-authorities/SKILL.md +116 -11
- package/catalog/frontmcp-authorities/references/authority-profiles.md +39 -36
- package/catalog/frontmcp-authorities/references/claims-mapping.md +7 -0
- package/catalog/frontmcp-authorities/references/custom-evaluators.md +63 -14
- package/catalog/frontmcp-channels/SKILL.md +36 -0
- package/catalog/frontmcp-channels/examples/channel-sources/file-watcher.md +8 -2
- package/catalog/frontmcp-channels/examples/channel-sources/replay-buffer.md +111 -30
- package/catalog/frontmcp-channels/examples/channel-two-way/whatsapp-bridge.md +45 -3
- package/catalog/frontmcp-channels/references/channel-sources.md +11 -3
- package/catalog/frontmcp-channels/references/channel-two-way.md +60 -89
- package/catalog/frontmcp-config/SKILL.md +111 -8
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-self-signed-tokens.md +4 -4
- package/catalog/frontmcp-config/examples/configure-auth-modes/remote-enterprise-oauth.md +7 -1
- package/catalog/frontmcp-config/examples/configure-deployment-targets/distributed-ha-config.md +1 -1
- package/catalog/frontmcp-config/examples/configure-deployment-targets/json-schema-ide-support.md +1 -1
- package/catalog/frontmcp-config/examples/configure-deployment-targets/multi-target-with-security.md +12 -9
- package/catalog/frontmcp-config/examples/configure-http/cors-restricted-origins.md +2 -2
- package/catalog/frontmcp-config/examples/configure-http/entry-path-reverse-proxy.md +1 -1
- package/catalog/frontmcp-config/examples/configure-security-headers/csp-report-only.md +1 -1
- package/catalog/frontmcp-config/examples/configure-security-headers/full-production-headers.md +1 -1
- package/catalog/frontmcp-config/examples/configure-skills-http/audit-log-basic.md +76 -0
- package/catalog/frontmcp-config/examples/configure-skills-http/audit-log-redis.md +116 -0
- package/catalog/frontmcp-config/examples/configure-skills-http/inject-instructions.md +59 -0
- package/catalog/frontmcp-config/references/configure-auth-modes.md +5 -5
- package/catalog/frontmcp-config/references/configure-deployment-targets.md +27 -24
- package/catalog/frontmcp-config/references/configure-http.md +14 -10
- package/catalog/frontmcp-config/references/configure-security-headers.md +2 -2
- package/catalog/frontmcp-config/references/configure-session.md +25 -25
- package/catalog/frontmcp-config/references/configure-skills-http.md +157 -0
- package/catalog/frontmcp-config/references/configure-throttle.md +1 -1
- package/catalog/frontmcp-config/references/configure-transport.md +2 -2
- package/catalog/frontmcp-deployment/SKILL.md +112 -9
- package/catalog/frontmcp-deployment/examples/build-for-browser/browser-build-with-custom-entry.md +23 -11
- package/catalog/frontmcp-deployment/examples/build-for-browser/browser-crypto-and-storage.md +44 -17
- package/catalog/frontmcp-deployment/examples/build-for-browser/react-provider-setup.md +53 -21
- package/catalog/frontmcp-deployment/examples/build-for-cli/cli-binary-build.md +1 -1
- package/catalog/frontmcp-deployment/examples/build-for-cli/unix-socket-daemon.md +1 -1
- package/catalog/frontmcp-deployment/examples/build-for-mcpb/mcpb-bundle-build.md +1 -1
- package/catalog/frontmcp-deployment/examples/build-for-sdk/connect-openai.md +1 -1
- package/catalog/frontmcp-deployment/examples/build-for-sdk/multi-platform-connect.md +1 -1
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/basic-worker-deploy.md +7 -8
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-custom-domain.md +8 -6
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-with-kv-storage.md +5 -4
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/cdk-deployment.md +8 -5
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/lambda-handler-with-cors.md +20 -18
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/sam-template-basic.md +8 -5
- package/catalog/frontmcp-deployment/examples/deploy-to-node/docker-compose-with-redis.md +3 -3
- package/catalog/frontmcp-deployment/examples/deploy-to-node/pm2-with-nginx.md +1 -1
- package/catalog/frontmcp-deployment/examples/deploy-to-node/resource-limits.md +2 -2
- package/catalog/frontmcp-deployment/examples/deploy-to-node-dockerfile/basic-multistage-dockerfile.md +2 -2
- package/catalog/frontmcp-deployment/examples/deploy-to-node-dockerfile/secure-nonroot-dockerfile.md +1 -1
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-mcp-endpoint-test.md +23 -21
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-with-kv.md +25 -22
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-with-skills-cache.md +23 -30
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel-config/minimal-vercel-config.md +52 -28
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel-config/vercel-config-with-security-headers.md +32 -55
- package/catalog/frontmcp-deployment/examples/mcp-client-integration/http-remote.md +9 -0
- package/catalog/frontmcp-deployment/references/build-for-browser.md +40 -17
- package/catalog/frontmcp-deployment/references/build-for-cli.md +8 -8
- package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +43 -24
- package/catalog/frontmcp-deployment/references/deploy-to-lambda.md +36 -25
- package/catalog/frontmcp-deployment/references/deploy-to-node-dockerfile.md +56 -14
- package/catalog/frontmcp-deployment/references/deploy-to-node.md +9 -6
- package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +57 -58
- package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +49 -59
- package/catalog/frontmcp-deployment/references/mcp-client-integration.md +2 -0
- package/catalog/frontmcp-development/SKILL.md +186 -11
- package/catalog/frontmcp-development/examples/create-agent/custom-multi-pass-agent.md +1 -1
- package/catalog/frontmcp-development/examples/create-agent/nested-agents-with-swarm.md +30 -27
- package/catalog/frontmcp-development/examples/create-job/job-with-permissions.md +13 -8
- package/catalog/frontmcp-development/examples/create-provider/basic-database-provider.md +33 -23
- package/catalog/frontmcp-development/examples/create-provider/config-and-api-providers.md +19 -10
- package/catalog/frontmcp-development/examples/create-tool/tool-with-rate-limiting-and-progress.md +3 -3
- package/catalog/frontmcp-development/examples/create-workflow/webhook-triggered-workflow.md +6 -4
- package/catalog/frontmcp-development/examples/decorators-guide/agent-skill-job-workflow.md +1 -1
- package/catalog/frontmcp-development/examples/decorators-guide/basic-server-with-app-and-tools.md +13 -8
- package/catalog/frontmcp-development/examples/decorators-guide/multi-app-with-plugins-and-providers.md +50 -23
- package/catalog/frontmcp-development/references/create-agent.md +47 -30
- package/catalog/frontmcp-development/references/create-job.md +69 -54
- package/catalog/frontmcp-development/references/create-plugin-hooks.md +45 -28
- package/catalog/frontmcp-development/references/create-plugin.md +10 -8
- package/catalog/frontmcp-development/references/create-prompt.md +3 -3
- package/catalog/frontmcp-development/references/create-provider.md +91 -51
- package/catalog/frontmcp-development/references/create-resource.md +3 -3
- package/catalog/frontmcp-development/references/create-skill.md +2 -2
- package/catalog/frontmcp-development/references/create-tool.md +7 -7
- package/catalog/frontmcp-development/references/create-workflow.md +8 -10
- package/catalog/frontmcp-development/references/decorators-guide.md +92 -56
- package/catalog/frontmcp-development/references/official-plugins.md +4 -3
- package/catalog/frontmcp-development/references/openapi-adapter.md +1 -1
- package/catalog/frontmcp-extensibility/SKILL.md +70 -10
- package/catalog/frontmcp-extensibility/examples/skill-audit-log/custom-store.md +197 -0
- package/catalog/frontmcp-extensibility/examples/skill-audit-log/verify-chain.md +68 -0
- package/catalog/frontmcp-extensibility/examples/vectoriadb/product-catalog-search.md +3 -5
- package/catalog/frontmcp-extensibility/examples/vectoriadb/semantic-search-with-persistence.md +4 -11
- package/catalog/frontmcp-extensibility/examples/vectoriadb/tfidf-keyword-search.md +41 -30
- package/catalog/frontmcp-extensibility/references/skill-audit-log.md +233 -0
- package/catalog/frontmcp-extensibility/references/vectoriadb.md +73 -63
- package/catalog/frontmcp-guides/SKILL.md +84 -27
- package/catalog/frontmcp-guides/examples/example-knowledge-base/agent-and-plugin.md +72 -62
- package/catalog/frontmcp-guides/examples/example-knowledge-base/vector-search-and-resources.md +32 -43
- package/catalog/frontmcp-guides/examples/example-task-manager/auth-and-crud-tools.md +24 -17
- package/catalog/frontmcp-guides/examples/example-task-manager/authenticated-e2e-tests.md +23 -21
- package/catalog/frontmcp-guides/examples/example-task-manager/redis-provider-with-di.md +47 -39
- package/catalog/frontmcp-guides/examples/example-weather-api/server-and-app-setup.md +16 -6
- package/catalog/frontmcp-guides/examples/example-weather-api/unit-and-e2e-tests.md +9 -8
- package/catalog/frontmcp-guides/references/example-knowledge-base.md +192 -265
- package/catalog/frontmcp-guides/references/example-task-manager.md +60 -54
- package/catalog/frontmcp-guides/references/example-weather-api.md +22 -24
- package/catalog/frontmcp-observability/SKILL.md +66 -2
- package/catalog/frontmcp-observability/examples/telemetry-api/skill-counters.md +100 -0
- package/catalog/frontmcp-observability/examples/tracing-setup/production-tracing.md +7 -2
- package/catalog/frontmcp-observability/examples/vendor-integrations/coralogix-setup.md +6 -2
- package/catalog/frontmcp-observability/references/telemetry-api.md +72 -8
- package/catalog/frontmcp-observability/references/testing-observability.md +33 -49
- package/catalog/frontmcp-observability/references/tracing-setup.md +12 -5
- package/catalog/frontmcp-observability/references/vendor-integrations.md +46 -1
- package/catalog/frontmcp-production-readiness/SKILL.md +134 -3
- package/catalog/frontmcp-production-readiness/examples/common-checklist/caching-and-performance.md +57 -36
- package/catalog/frontmcp-production-readiness/examples/common-checklist/observability-setup.md +1 -1
- package/catalog/frontmcp-production-readiness/examples/common-checklist/security-hardening.md +102 -6
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/daemon-socket-config.md +2 -1
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/graceful-shutdown-cleanup.md +66 -58
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/security-and-permissions.md +5 -3
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/durable-objects-state.md +2 -1
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/wrangler-config.md +55 -76
- package/catalog/frontmcp-production-readiness/examples/production-lambda/cold-start-connection-reuse.md +43 -40
- package/catalog/frontmcp-production-readiness/examples/production-lambda/sam-template.md +63 -94
- package/catalog/frontmcp-production-readiness/examples/production-lambda/scaling-and-monitoring.md +28 -18
- package/catalog/frontmcp-production-readiness/examples/production-node-sdk/multi-instance-cleanup.md +29 -14
- package/catalog/frontmcp-production-readiness/examples/production-node-server/graceful-shutdown.md +58 -42
- package/catalog/frontmcp-production-readiness/examples/production-node-server/redis-session-scaling.md +5 -2
- package/catalog/frontmcp-production-readiness/examples/production-vercel/cold-start-optimization.md +41 -24
- package/catalog/frontmcp-production-readiness/examples/production-vercel/vercel-edge-config.md +56 -65
- package/catalog/frontmcp-production-readiness/references/common-checklist.md +17 -5
- package/catalog/frontmcp-production-readiness/references/production-cli-daemon.md +5 -5
- package/catalog/frontmcp-production-readiness/references/production-cloudflare.md +5 -5
- package/catalog/frontmcp-production-readiness/references/production-lambda.md +5 -5
- package/catalog/frontmcp-production-readiness/references/production-node-sdk.md +5 -5
- package/catalog/frontmcp-production-readiness/references/production-node-server.md +1 -1
- package/catalog/frontmcp-production-readiness/references/production-vercel.md +5 -5
- package/catalog/frontmcp-setup/SKILL.md +88 -0
- package/catalog/frontmcp-setup/examples/project-structure-nx/nx-workspace-with-apps.md +10 -4
- package/catalog/frontmcp-setup/examples/project-structure-standalone/dev-workflow-commands.md +21 -8
- package/catalog/frontmcp-setup/examples/readme-guide/node-server-readme.md +3 -3
- package/catalog/frontmcp-setup/references/multi-app-composition.md +4 -3
- package/catalog/frontmcp-setup/references/project-structure-nx.md +15 -6
- package/catalog/frontmcp-setup/references/project-structure-standalone.md +18 -15
- package/catalog/frontmcp-setup/references/readme-guide.md +1 -1
- package/catalog/frontmcp-setup/references/setup-project.md +19 -5
- package/catalog/frontmcp-setup/references/setup-redis.md +27 -39
- package/catalog/frontmcp-setup/references/setup-sqlite.md +25 -18
- package/catalog/frontmcp-testing/SKILL.md +102 -15
- package/catalog/frontmcp-testing/examples/setup-testing/unit-test-tool-resource-prompt.md +3 -3
- package/catalog/frontmcp-testing/examples/test-auth/oauth-flow-test.md +50 -39
- package/catalog/frontmcp-testing/examples/test-auth/role-based-access-test.md +52 -29
- package/catalog/frontmcp-testing/examples/test-auth/token-factory-test.md +37 -20
- package/catalog/frontmcp-testing/examples/test-direct-client/basic-create-test.md +25 -15
- package/catalog/frontmcp-testing/examples/test-direct-client/openai-claude-format-test.md +27 -21
- package/catalog/frontmcp-testing/examples/test-e2e-handler/basic-e2e-test.md +29 -20
- package/catalog/frontmcp-testing/examples/test-e2e-handler/manual-client-with-transport.md +5 -3
- package/catalog/frontmcp-testing/examples/test-e2e-handler/tool-call-and-error-e2e.md +35 -26
- package/catalog/frontmcp-testing/examples/test-tool-unit/basic-tool-test.md +8 -3
- package/catalog/frontmcp-testing/examples/test-tool-unit/schema-validation-test.md +4 -1
- package/catalog/frontmcp-testing/examples/test-tool-unit/tool-error-handling-test.md +6 -3
- package/catalog/frontmcp-testing/references/setup-testing.md +35 -39
- package/catalog/frontmcp-testing/references/test-auth.md +86 -43
- package/catalog/frontmcp-testing/references/test-browser-build.md +1 -1
- package/catalog/frontmcp-testing/references/test-direct-client.md +29 -19
- package/catalog/frontmcp-testing/references/test-e2e-handler.md +31 -19
- package/catalog/frontmcp-testing/references/test-tool-unit.md +6 -2
- package/catalog/skills-manifest.json +428 -339
- package/package.json +1 -1
- package/src/manifest.d.ts +13 -0
- package/src/manifest.js.map +1 -1
|
@@ -126,6 +126,94 @@ Entry point for project setup and scaffolding. This skill helps you find the rig
|
|
|
126
126
|
| Nx generator not found | `@frontmcp/nx` not installed | Run `npm install -D @frontmcp/nx` |
|
|
127
127
|
| Skills not loading | Skills placed in wrong directory | Catalog skills go in top-level `skills/`, app skills in `src/skills/` |
|
|
128
128
|
|
|
129
|
+
## Examples
|
|
130
|
+
|
|
131
|
+
Each reference has matching examples under [`examples/<reference>/`](./examples/):
|
|
132
|
+
|
|
133
|
+
### `frontmcp-skills-usage`
|
|
134
|
+
|
|
135
|
+
| Example | Level | Description |
|
|
136
|
+
| ---------------------------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------- |
|
|
137
|
+
| [`bundle-presets-scaffolding`](./examples/frontmcp-skills-usage/bundle-presets-scaffolding.md) | Intermediate | Use `--skills` flag during project creation to install a skill bundle preset. |
|
|
138
|
+
| [`install-and-search-skills`](./examples/frontmcp-skills-usage/install-and-search-skills.md) | Basic | Install skills statically for Claude Code and use dynamic CLI search for on-demand discovery. |
|
|
139
|
+
|
|
140
|
+
### `multi-app-composition`
|
|
141
|
+
|
|
142
|
+
| Example | Level | Description |
|
|
143
|
+
| -------------------------------------------------------------------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------- |
|
|
144
|
+
| [`local-apps-with-shared-tools`](./examples/multi-app-composition/local-apps-with-shared-tools.md) | Basic | Compose multiple local `@App` classes into a server with shared tools available to all apps. |
|
|
145
|
+
| [`per-app-auth-and-isolation`](./examples/multi-app-composition/per-app-auth-and-isolation.md) | Advanced | Configure mixed authentication modes and scope isolation for different apps in a single server. |
|
|
146
|
+
| [`remote-and-esm-apps`](./examples/multi-app-composition/remote-and-esm-apps.md) | Intermediate | Compose local, ESM (npm package), and remote (external MCP server) apps into a single gateway. |
|
|
147
|
+
|
|
148
|
+
### `nx-workflow`
|
|
149
|
+
|
|
150
|
+
| Example | Level | Description |
|
|
151
|
+
| ------------------------------------------------------------------------------ | ------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
152
|
+
| [`build-test-affected`](./examples/nx-workflow/build-test-affected.md) | Intermediate | Use Nx commands for efficient building, testing, and CI with affected-only execution. |
|
|
153
|
+
| [`multi-server-deployment`](./examples/nx-workflow/multi-server-deployment.md) | Advanced | Generate multiple servers in an Nx workspace, each composing different apps for different deployment targets. |
|
|
154
|
+
| [`scaffold-and-generate`](./examples/nx-workflow/scaffold-and-generate.md) | Basic | Initialize an Nx workspace and use generators to scaffold an app with tools, resources, and a server. |
|
|
155
|
+
|
|
156
|
+
### `project-structure-nx`
|
|
157
|
+
|
|
158
|
+
| Example | Level | Description |
|
|
159
|
+
| ----------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
160
|
+
| [`nx-generator-scaffolding`](./examples/project-structure-nx/nx-generator-scaffolding.md) | Basic | Use `@frontmcp/nx` generators to scaffold tools, resources, and providers within an app, with automatic barrel export updates. |
|
|
161
|
+
| [`nx-workspace-with-apps`](./examples/project-structure-nx/nx-workspace-with-apps.md) | Basic | Scaffold an Nx monorepo with two apps and a server that composes them into a single gateway. |
|
|
162
|
+
| [`shared-library-usage`](./examples/project-structure-nx/shared-library-usage.md) | Intermediate | Create a shared library in an Nx monorepo and use it from multiple apps to avoid cross-app imports. |
|
|
163
|
+
|
|
164
|
+
### `project-structure-standalone`
|
|
165
|
+
|
|
166
|
+
| Example | Level | Description |
|
|
167
|
+
| ------------------------------------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------- |
|
|
168
|
+
| [`dev-workflow-commands`](./examples/project-structure-standalone/dev-workflow-commands.md) | Basic | Run the standard development workflow for a standalone FrontMCP project: dev server, build, and tests. |
|
|
169
|
+
| [`feature-folder-organization`](./examples/project-structure-standalone/feature-folder-organization.md) | Intermediate | Organize a growing standalone project into domain-specific feature folders instead of flat type-based directories. |
|
|
170
|
+
| [`minimal-standalone-layout`](./examples/project-structure-standalone/minimal-standalone-layout.md) | Basic | Set up the canonical file structure for a standalone FrontMCP project with one app, one tool, and the required entry point. |
|
|
171
|
+
|
|
172
|
+
### `readme-guide`
|
|
173
|
+
|
|
174
|
+
| Example | Level | Description |
|
|
175
|
+
| --------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------ |
|
|
176
|
+
| [`node-server-readme`](./examples/readme-guide/node-server-readme.md) | Basic | Generate a README for a FrontMCP server deployed as a Docker/Node.js service with tools and resources. |
|
|
177
|
+
| [`vercel-deployment-readme`](./examples/readme-guide/vercel-deployment-readme.md) | Intermediate | Generate a README for a FrontMCP server deployed to Vercel with Vercel KV storage. |
|
|
178
|
+
|
|
179
|
+
### `setup-project`
|
|
180
|
+
|
|
181
|
+
| Example | Level | Description |
|
|
182
|
+
| ---------------------------------------------------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
183
|
+
| [`basic-node-server`](./examples/setup-project/basic-node-server.md) | Basic | Scaffold a minimal FrontMCP server with one app and one tool, running on Node.js with HTTP transport. |
|
|
184
|
+
| [`cli-scaffold-with-flags`](./examples/setup-project/cli-scaffold-with-flags.md) | Basic | Use the `frontmcp create` CLI to scaffold a complete project non-interactively with explicit flags for deployment target, Redis, and package manager. |
|
|
185
|
+
| [`vercel-serverless-server`](./examples/setup-project/vercel-serverless-server.md) | Intermediate | Configure a FrontMCP server for Vercel deployment with Vercel KV storage and modern transport protocol. |
|
|
186
|
+
|
|
187
|
+
### `setup-redis`
|
|
188
|
+
|
|
189
|
+
| Example | Level | Description |
|
|
190
|
+
| ---------------------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
191
|
+
| [`docker-redis-local-dev`](./examples/setup-redis/docker-redis-local-dev.md) | Basic | Provision Redis with Docker Compose and connect a FrontMCP server for local session storage. |
|
|
192
|
+
| [`hybrid-vercel-kv-with-pubsub`](./examples/setup-redis/hybrid-vercel-kv-with-pubsub.md) | Advanced | Use Vercel KV for session storage and a separate Redis instance for pub/sub resource subscriptions in distributed multi-instance deployments. |
|
|
193
|
+
| [`vercel-kv-serverless`](./examples/setup-redis/vercel-kv-serverless.md) | Intermediate | Configure a FrontMCP server with Vercel KV as the session store for serverless deployment. |
|
|
194
|
+
|
|
195
|
+
### `setup-sqlite`
|
|
196
|
+
|
|
197
|
+
| Example | Level | Description |
|
|
198
|
+
| --------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------- |
|
|
199
|
+
| [`basic-sqlite-setup`](./examples/setup-sqlite/basic-sqlite-setup.md) | Basic | Configure a FrontMCP server with SQLite for local session storage with WAL mode enabled. |
|
|
200
|
+
| [`encrypted-sqlite-storage`](./examples/setup-sqlite/encrypted-sqlite-storage.md) | Intermediate | Enable AES-256-GCM at-rest encryption for sensitive session data stored in SQLite. |
|
|
201
|
+
| [`unix-socket-daemon`](./examples/setup-sqlite/unix-socket-daemon.md) | Advanced | Configure a FrontMCP daemon that listens on a unix socket and uses SQLite for persistent storage. |
|
|
202
|
+
|
|
203
|
+
## Accessing This Skill
|
|
204
|
+
|
|
205
|
+
Skills are distributed as plain SKILL.md files plus a sibling `references/`
|
|
206
|
+
and `examples/` tree, so consumers can pick whichever access mode fits:
|
|
207
|
+
|
|
208
|
+
| Mode | How it works |
|
|
209
|
+
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
210
|
+
| **Filesystem** | Read `libs/skills/catalog/frontmcp-setup/` directly from a clone of the catalog repo, or from a published `@frontmcp/skills` install. SKILL.md is the entry point. |
|
|
211
|
+
| **`frontmcp` CLI** | `frontmcp skills list`, `frontmcp skills read frontmcp-setup`, `frontmcp skills read frontmcp-setup:references/<file>.md`, `frontmcp skills install frontmcp-setup` — no server required. |
|
|
212
|
+
| **MCP `skill://`** | When a developer mounts this skill into their own FrontMCP server (`@FrontMcp({ skills: [...] })`), the SDK exposes it via SEP-2640 resources: `skill://frontmcp-setup/SKILL.md`, `skill://frontmcp-setup/references/{file}.md`, etc. The server’s `skill://index.json` returns the SEP-2640 discovery document for everything mounted on it. |
|
|
213
|
+
|
|
214
|
+
The catalog itself is **not** an MCP server. The `skill://` URIs only resolve
|
|
215
|
+
when a server has been configured to host this skill.
|
|
216
|
+
|
|
129
217
|
## Reference
|
|
130
218
|
|
|
131
219
|
- [Getting Started](https://docs.agentfront.dev/frontmcp/getting-started/quickstart)
|
|
@@ -19,23 +19,26 @@ Scaffold an Nx monorepo with two apps and a server that composes them into a sin
|
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
21
|
# Scaffold the Nx workspace
|
|
22
|
+
# (creates apps/.gitkeep, libs/.gitkeep, servers/.gitkeep, and a sample apps/demo app)
|
|
22
23
|
npx frontmcp create my-workspace --nx
|
|
23
24
|
|
|
24
25
|
cd my-workspace
|
|
25
26
|
|
|
26
|
-
# Generate two apps
|
|
27
|
+
# Generate two apps (billing and crm)
|
|
27
28
|
nx g @frontmcp/nx:app billing
|
|
28
29
|
nx g @frontmcp/nx:app crm
|
|
29
30
|
|
|
30
|
-
# Generate a server
|
|
31
|
+
# Generate a server that composes both apps
|
|
32
|
+
# Servers are NOT created by the workspace generator -- you must add them with this command
|
|
31
33
|
nx g @frontmcp/nx:server gateway --apps=billing,crm
|
|
32
34
|
```
|
|
33
35
|
|
|
34
36
|
```typescript
|
|
35
37
|
// apps/billing/src/billing.app.ts
|
|
36
38
|
import { App } from '@frontmcp/sdk';
|
|
37
|
-
|
|
39
|
+
|
|
38
40
|
import { InvoiceResource } from './resources/invoice.resource';
|
|
41
|
+
import { CreateInvoiceTool } from './tools/create-invoice.tool';
|
|
39
42
|
|
|
40
43
|
@App({
|
|
41
44
|
name: 'billing',
|
|
@@ -48,6 +51,7 @@ export class BillingApp {}
|
|
|
48
51
|
```typescript
|
|
49
52
|
// apps/crm/src/crm.app.ts
|
|
50
53
|
import { App } from '@frontmcp/sdk';
|
|
54
|
+
|
|
51
55
|
import { LookupUserTool } from './tools/lookup-user.tool';
|
|
52
56
|
|
|
53
57
|
@App({
|
|
@@ -60,10 +64,12 @@ export class CrmApp {}
|
|
|
60
64
|
```typescript
|
|
61
65
|
// servers/gateway/src/main.ts
|
|
62
66
|
import 'reflect-metadata';
|
|
63
|
-
|
|
67
|
+
|
|
64
68
|
import { BillingApp } from '@my-workspace/billing';
|
|
65
69
|
import { CrmApp } from '@my-workspace/crm';
|
|
66
70
|
|
|
71
|
+
import { FrontMcp } from '@frontmcp/sdk';
|
|
72
|
+
|
|
67
73
|
@FrontMcp({
|
|
68
74
|
info: { name: 'gateway', version: '1.0.0' },
|
|
69
75
|
apps: [BillingApp, CrmApp],
|
package/catalog/frontmcp-setup/examples/project-structure-standalone/dev-workflow-commands.md
CHANGED
|
@@ -31,22 +31,35 @@ frontmcp build --target cloudflare
|
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
# Run unit tests (
|
|
35
|
-
jest
|
|
34
|
+
# Run unit and E2E tests (auto-discovers *.spec.ts and e2e/*.e2e.spec.ts)
|
|
35
|
+
# Do NOT create a standalone jest.e2e.config.ts -- frontmcp test generates one automatically
|
|
36
|
+
frontmcp test
|
|
36
37
|
```
|
|
37
38
|
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
```typescript
|
|
40
|
+
// To run with HTTP transport, set http: { port } in the @FrontMcp metadata.
|
|
41
|
+
// Setting PORT=3000 alone does NOT switch the server from stdio to HTTP.
|
|
42
|
+
import 'reflect-metadata';
|
|
43
|
+
|
|
44
|
+
import { FrontMcp } from '@frontmcp/sdk';
|
|
45
|
+
|
|
46
|
+
import { CalcApp } from './calc.app';
|
|
47
|
+
|
|
48
|
+
@FrontMcp({
|
|
49
|
+
info: { name: 'demo', version: '0.1.0' },
|
|
50
|
+
apps: [CalcApp],
|
|
51
|
+
http: { port: 3000 }, // <-- enables HTTP transport on port 3000
|
|
52
|
+
})
|
|
53
|
+
export default class Server {}
|
|
41
54
|
```
|
|
42
55
|
|
|
43
56
|
```bash
|
|
44
|
-
#
|
|
45
|
-
|
|
57
|
+
# With http: { port } configured in metadata, start the dev server
|
|
58
|
+
frontmcp dev
|
|
46
59
|
```
|
|
47
60
|
|
|
48
61
|
```bash
|
|
49
|
-
# Test the running server with an MCP initialize request
|
|
62
|
+
# Test the running HTTP server with an MCP initialize request
|
|
50
63
|
curl -X POST http://localhost:3000/mcp \
|
|
51
64
|
-H "Content-Type: application/json" \
|
|
52
65
|
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"0.1.0"}}}'
|
|
@@ -7,7 +7,7 @@ tags: [setup, docker, readme, node]
|
|
|
7
7
|
features:
|
|
8
8
|
- 'Standard README sections: Features, Quick Start, Tools table, Resources table, Environment Variables'
|
|
9
9
|
- 'Docker-specific deployment section with build and run commands'
|
|
10
|
-
- 'Development commands using `frontmcp dev`, `frontmcp test`, `frontmcp
|
|
10
|
+
- 'Development commands using `frontmcp dev`, `frontmcp test`, `frontmcp inspector`'
|
|
11
11
|
- 'Tool and resource tables generated from source code decorators'
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -65,7 +65,7 @@ npm run dev
|
|
|
65
65
|
|
|
66
66
|
frontmcp dev # Start dev server with hot reload
|
|
67
67
|
frontmcp test # Run tests
|
|
68
|
-
frontmcp
|
|
68
|
+
frontmcp inspector # Inspect MCP server capabilities
|
|
69
69
|
|
|
70
70
|
## Docker Deployment
|
|
71
71
|
|
|
@@ -81,7 +81,7 @@ MIT
|
|
|
81
81
|
|
|
82
82
|
- Standard README sections: Features, Quick Start, Tools table, Resources table, Environment Variables
|
|
83
83
|
- Docker-specific deployment section with build and run commands
|
|
84
|
-
- Development commands using `frontmcp dev`, `frontmcp test`, `frontmcp
|
|
84
|
+
- Development commands using `frontmcp dev`, `frontmcp test`, `frontmcp inspector`
|
|
85
85
|
- Tool and resource tables generated from source code decorators
|
|
86
86
|
|
|
87
87
|
## Related
|
|
@@ -72,7 +72,7 @@ export default class Server {}
|
|
|
72
72
|
Load an `@App`-decorated class from an npm package at runtime using `app.esm()`. The package is fetched, cached, and its default export is treated as a local app.
|
|
73
73
|
|
|
74
74
|
```typescript
|
|
75
|
-
import {
|
|
75
|
+
import { app, FrontMcp } from '@frontmcp/sdk';
|
|
76
76
|
|
|
77
77
|
@FrontMcp({
|
|
78
78
|
info: { name: 'gateway', version: '1.0.0' },
|
|
@@ -112,7 +112,7 @@ app.esm('@internal/tools@^2.0.0', {
|
|
|
112
112
|
Proxy tools, resources, and prompts from an external MCP server using `app.remote()`. The gateway connects via Streamable HTTP (with SSE fallback) and exposes the remote primitives as if they were local.
|
|
113
113
|
|
|
114
114
|
```typescript
|
|
115
|
-
import {
|
|
115
|
+
import { app, FrontMcp } from '@frontmcp/sdk';
|
|
116
116
|
|
|
117
117
|
@FrontMcp({
|
|
118
118
|
info: { name: 'gateway', version: '1.0.0' },
|
|
@@ -313,7 +313,8 @@ Combining all patterns into a single server:
|
|
|
313
313
|
|
|
314
314
|
```typescript
|
|
315
315
|
import 'reflect-metadata';
|
|
316
|
-
|
|
316
|
+
|
|
317
|
+
import { App, app, FrontMcp } from '@frontmcp/sdk';
|
|
317
318
|
|
|
318
319
|
// Local app with per-app auth and plugins
|
|
319
320
|
@App({
|
|
@@ -27,12 +27,17 @@ description: Canonical directory layout, generators, and dependency rules for Fr
|
|
|
27
27
|
|
|
28
28
|
> **Decision:** Use this skill when setting up or organizing a FrontMCP Nx monorepo and you need the canonical directory layout, generator commands, and dependency rules.
|
|
29
29
|
|
|
30
|
-
When you scaffold with `frontmcp create --nx` or
|
|
30
|
+
When you scaffold with `frontmcp create --nx` (or run `nx g @frontmcp/nx:workspace` standalone), the generator produces an empty `apps/`, `libs/`, and `servers/` skeleton plus a sample `apps/demo` app. Servers are NOT created automatically -- you must run `nx g @frontmcp/nx:server <name> --apps=<app-list>` separately. Once you add apps, libs, and a server, the recommended layout looks like this:
|
|
31
31
|
|
|
32
32
|
```text
|
|
33
33
|
my-workspace/
|
|
34
34
|
├── apps/ # @App classes (one app per directory)
|
|
35
|
-
│ ├──
|
|
35
|
+
│ ├── demo/ # sample app generated by the workspace generator
|
|
36
|
+
│ │ ├── src/
|
|
37
|
+
│ │ │ └── demo.app.ts
|
|
38
|
+
│ │ ├── project.json
|
|
39
|
+
│ │ └── tsconfig.json
|
|
40
|
+
│ ├── billing/ # added by `nx g @frontmcp/nx:app billing`
|
|
36
41
|
│ │ ├── src/
|
|
37
42
|
│ │ │ ├── billing.app.ts
|
|
38
43
|
│ │ │ ├── tools/
|
|
@@ -54,7 +59,7 @@ my-workspace/
|
|
|
54
59
|
│ ├── project.json
|
|
55
60
|
│ └── tsconfig.json
|
|
56
61
|
├── servers/ # @FrontMcp servers composing apps
|
|
57
|
-
│ └── gateway/
|
|
62
|
+
│ └── gateway/ # generated by `nx g @frontmcp/nx:server gateway --apps=billing,crm`
|
|
58
63
|
│ ├── src/
|
|
59
64
|
│ │ └── main.ts # @FrontMcp default export
|
|
60
65
|
│ ├── project.json
|
|
@@ -67,6 +72,8 @@ my-workspace/
|
|
|
67
72
|
└── .cursorrules
|
|
68
73
|
```
|
|
69
74
|
|
|
75
|
+
> **Out of the box:** The workspace generator only creates `apps/.gitkeep`, `libs/.gitkeep`, `servers/.gitkeep`, the workspace files (`nx.json`, `tsconfig.base.json`, `package.json`, etc.), and a sample `apps/demo` app. Add apps, libs, and servers explicitly with the corresponding generators below.
|
|
76
|
+
|
|
70
77
|
## Directory Roles
|
|
71
78
|
|
|
72
79
|
### apps/ -- Application Modules
|
|
@@ -76,9 +83,10 @@ Each directory under `apps/` contains a single `@App` class with its tools, reso
|
|
|
76
83
|
```typescript
|
|
77
84
|
// apps/billing/src/billing.app.ts
|
|
78
85
|
import { App } from '@frontmcp/sdk';
|
|
79
|
-
|
|
80
|
-
import { InvoiceResource } from './resources/invoice.resource';
|
|
86
|
+
|
|
81
87
|
import { StripeProvider } from './providers/stripe.provider';
|
|
88
|
+
import { InvoiceResource } from './resources/invoice.resource';
|
|
89
|
+
import { CreateInvoiceTool } from './tools/create-invoice.tool';
|
|
82
90
|
|
|
83
91
|
@App({
|
|
84
92
|
name: 'billing',
|
|
@@ -114,10 +122,11 @@ A server composes multiple apps into a single `@FrontMcp` entry point:
|
|
|
114
122
|
|
|
115
123
|
```typescript
|
|
116
124
|
// servers/gateway/src/main.ts
|
|
117
|
-
import { FrontMcp } from '@frontmcp/sdk';
|
|
118
125
|
import { BillingApp } from '@my-workspace/billing';
|
|
119
126
|
import { CrmApp } from '@my-workspace/crm';
|
|
120
127
|
|
|
128
|
+
import { FrontMcp } from '@frontmcp/sdk';
|
|
129
|
+
|
|
121
130
|
@FrontMcp({
|
|
122
131
|
info: { name: 'gateway', version: '1.0.0' },
|
|
123
132
|
apps: [BillingApp, CrmApp],
|
|
@@ -74,6 +74,7 @@ Every entity type uses a consistent `<name>.<type>.ts` pattern:
|
|
|
74
74
|
|
|
75
75
|
```typescript
|
|
76
76
|
import { FrontMcp } from '@frontmcp/sdk';
|
|
77
|
+
|
|
77
78
|
import { MyApp } from './my-app.app';
|
|
78
79
|
|
|
79
80
|
@FrontMcp({
|
|
@@ -91,8 +92,9 @@ The `@App` class groups tools, resources, prompts, plugins, and providers togeth
|
|
|
91
92
|
|
|
92
93
|
```typescript
|
|
93
94
|
import { App } from '@frontmcp/sdk';
|
|
94
|
-
|
|
95
|
+
|
|
95
96
|
import { DatabaseProvider } from './providers/database.provider';
|
|
97
|
+
import { FetchWeatherTool } from './tools/fetch-weather.tool';
|
|
96
98
|
|
|
97
99
|
@App({
|
|
98
100
|
name: 'my-app',
|
|
@@ -121,18 +123,17 @@ frontmcp build --target vercel
|
|
|
121
123
|
frontmcp build --target lambda
|
|
122
124
|
```
|
|
123
125
|
|
|
124
|
-
Valid targets: `cli`, `node`, `sdk`, `browser`, `cloudflare`, `vercel`, `lambda`. The `--target` flag determines the output format and runtime optimizations.
|
|
126
|
+
Valid targets: `cli`, `node`, `sdk`, `browser`, `cloudflare`, `vercel`, `lambda`, `distributed`, `mcpb`. The `--target` flag determines the output format and runtime optimizations.
|
|
125
127
|
|
|
126
128
|
### Run tests
|
|
127
129
|
|
|
128
130
|
```bash
|
|
129
|
-
# Unit tests
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
# E2E tests
|
|
133
|
-
jest --config e2e/jest.config.ts
|
|
131
|
+
# Unit and E2E tests (auto-discovers *.spec.ts and e2e/*.e2e.spec.ts)
|
|
132
|
+
frontmcp test
|
|
134
133
|
```
|
|
135
134
|
|
|
135
|
+
> **Do not** create a standalone `jest.e2e.config.ts` -- `frontmcp test` auto-generates the correct Jest/SWC configuration for both unit and E2E tests. The CLI scaffolder explicitly removes `jest.e2e.config.ts` and `tsconfig.e2e.json` for the same reason.
|
|
136
|
+
|
|
136
137
|
## Organizing by Feature
|
|
137
138
|
|
|
138
139
|
For larger standalone projects, group related entities into feature folders:
|
|
@@ -192,8 +193,9 @@ Skills inside `src/skills/` are `@Skill` classes that are part of your applicati
|
|
|
192
193
|
|
|
193
194
|
- [ ] `frontmcp dev` starts the development server with file watching
|
|
194
195
|
- [ ] `frontmcp build --target node` produces a valid production build
|
|
195
|
-
- [ ] Unit tests pass with `
|
|
196
|
+
- [ ] Unit and E2E tests pass with `frontmcp test`
|
|
196
197
|
- [ ] E2E tests (if any) are in the `e2e/` directory with `*.e2e.spec.ts` naming
|
|
198
|
+
- [ ] No standalone `jest.e2e.config.ts` exists -- the CLI auto-generates the test config
|
|
197
199
|
|
|
198
200
|
### Organization
|
|
199
201
|
|
|
@@ -203,13 +205,14 @@ Skills inside `src/skills/` are `@Skill` classes that are part of your applicati
|
|
|
203
205
|
|
|
204
206
|
## Troubleshooting
|
|
205
207
|
|
|
206
|
-
| Problem
|
|
207
|
-
|
|
|
208
|
-
| `frontmcp dev` fails to start
|
|
209
|
-
| Tool not discovered at runtime
|
|
210
|
-
| Tests not found by Jest
|
|
211
|
-
|
|
|
212
|
-
|
|
|
208
|
+
| Problem | Cause | Solution |
|
|
209
|
+
| ---------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
210
|
+
| `frontmcp dev` fails to start | `main.ts` does not default-export the `@FrontMcp` class | Add `export default MyServer` to `main.ts` |
|
|
211
|
+
| Tool not discovered at runtime | Tool class not added to the `tools` array in `@App` | Register the tool in the `@App` decorator's `tools` array |
|
|
212
|
+
| Tests not found by Jest | Test file uses `.test.ts` instead of `.spec.ts` | Rename to `.spec.ts` to match the FrontMCP test file convention |
|
|
213
|
+
| `frontmcp test` fails to find E2E config | Custom `jest.e2e.config.ts` overrides the auto-generated config | Delete the standalone `jest.e2e.config.ts`; `frontmcp test` generates the correct config automatically |
|
|
214
|
+
| Build target error | Invalid `--target` flag value | Use one of `cli`, `node`, `sdk`, `browser`, `cloudflare`, `vercel`, `lambda`, `distributed`, `mcpb` |
|
|
215
|
+
| Catalog skills not loaded | Skills placed in `src/skills/` instead of top-level `skills/` | Move catalog `SKILL.md` directories to the top-level `skills/` directory |
|
|
213
216
|
|
|
214
217
|
## Examples
|
|
215
218
|
|
|
@@ -217,7 +217,7 @@ Only update:
|
|
|
217
217
|
- [ ] README includes all resources and their URIs
|
|
218
218
|
- [ ] Installation instructions match the deployment target
|
|
219
219
|
- [ ] Environment variables match `.env.example`
|
|
220
|
-
- [ ] Development section includes `frontmcp dev`, `frontmcp test`, `frontmcp
|
|
220
|
+
- [ ] Development section includes `frontmcp dev`, `frontmcp test`, `frontmcp inspector`
|
|
221
221
|
- [ ] License matches `package.json`
|
|
222
222
|
|
|
223
223
|
## Examples
|
|
@@ -35,7 +35,7 @@ The `frontmcp` CLI generates a complete project structure. Run it with `npx`:
|
|
|
35
35
|
npx frontmcp create <projectName>
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
The CLI
|
|
38
|
+
The CLI interactively prompts for project type (standalone vs Nx), deployment target, Redis setup, package manager, and CI/CD. The skills bundle is **not** prompted -- it defaults to `recommended` unless you pass the `--skills` flag explicitly. To skip the prompts entirely, pass flags directly:
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
41
|
npx frontmcp create <projectName> \
|
|
@@ -93,10 +93,10 @@ Create `package.json`:
|
|
|
93
93
|
"frontmcp": "latest",
|
|
94
94
|
"@frontmcp/sdk": "latest",
|
|
95
95
|
"reflect-metadata": "^0.2.0",
|
|
96
|
-
"zod": "^
|
|
96
|
+
"zod": "^4.0.0"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
|
-
"typescript": "^5.
|
|
99
|
+
"typescript": "^5.5.3",
|
|
100
100
|
"@types/node": "^22.0.0"
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -358,10 +358,21 @@ Or if using package.json scripts:
|
|
|
358
358
|
yarn dev
|
|
359
359
|
```
|
|
360
360
|
|
|
361
|
-
The server starts in stdio mode by default. To
|
|
361
|
+
The server starts in stdio mode by default. To enable HTTP transport, add an `http: { port }` block to the `@FrontMcp` metadata (setting the `PORT` environment variable alone does **not** switch from stdio to HTTP):
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
@FrontMcp({
|
|
365
|
+
info: { name: '<projectName>', version: '0.1.0' },
|
|
366
|
+
apps: [CalcApp],
|
|
367
|
+
http: { port: 3000 },
|
|
368
|
+
})
|
|
369
|
+
export default class Server {}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Then start the server normally:
|
|
362
373
|
|
|
363
374
|
```bash
|
|
364
|
-
|
|
375
|
+
frontmcp dev
|
|
365
376
|
```
|
|
366
377
|
|
|
367
378
|
Test with curl:
|
|
@@ -382,6 +393,9 @@ frontmcp build --target cloudflare # Cloudflare Workers
|
|
|
382
393
|
frontmcp build --target cli # CLI with SEA binary
|
|
383
394
|
frontmcp build --target cli --js # CLI without SEA
|
|
384
395
|
frontmcp build --target sdk # Library (CJS+ESM+types)
|
|
396
|
+
frontmcp build --target browser # Browser bundle
|
|
397
|
+
frontmcp build --target distributed # Distributed runtime bundle
|
|
398
|
+
frontmcp build --target mcpb # MCPB archive (use --sea for SEA binary)
|
|
385
399
|
```
|
|
386
400
|
|
|
387
401
|
## Step 7 -- Nx Workspace Setup (optional)
|
|
@@ -94,6 +94,7 @@ Update the `@FrontMcp` decorator in `src/main.ts`:
|
|
|
94
94
|
|
|
95
95
|
```typescript
|
|
96
96
|
import 'reflect-metadata';
|
|
97
|
+
|
|
97
98
|
import { FrontMcp } from '@frontmcp/sdk';
|
|
98
99
|
|
|
99
100
|
@FrontMcp({
|
|
@@ -141,6 +142,7 @@ redis: {
|
|
|
141
142
|
|
|
142
143
|
```typescript
|
|
143
144
|
import 'reflect-metadata';
|
|
145
|
+
|
|
144
146
|
import { FrontMcp } from '@frontmcp/sdk';
|
|
145
147
|
|
|
146
148
|
@FrontMcp({
|
|
@@ -169,53 +171,39 @@ redis: {
|
|
|
169
171
|
},
|
|
170
172
|
```
|
|
171
173
|
|
|
172
|
-
## Step 3 -- Session Store
|
|
174
|
+
## Step 3 -- How the SDK Builds the Session Store
|
|
173
175
|
|
|
174
|
-
The SDK
|
|
175
|
-
|
|
176
|
-
```typescript
|
|
177
|
-
import { createSessionStore } from '@frontmcp/sdk';
|
|
176
|
+
You do not call any factory yourself. The SDK constructs the session store internally from the `redis` field on the `@FrontMcp` decorator. The framework handles:
|
|
178
177
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
port: 6379,
|
|
184
|
-
keyPrefix: 'mcp:',
|
|
185
|
-
});
|
|
178
|
+
- Lazy-loading `ioredis` or `@vercel/kv` to avoid bundling unused dependencies
|
|
179
|
+
- Automatic key prefix namespacing (appends `session:` to the base prefix you supply)
|
|
180
|
+
- Pre-connection for Vercel KV
|
|
181
|
+
- Falling back to an in-memory store when no `redis` (or `sqlite`) config is provided (single-instance dev only)
|
|
186
182
|
|
|
187
|
-
|
|
188
|
-
const sessionStore = await createSessionStore({
|
|
189
|
-
provider: 'vercel-kv',
|
|
190
|
-
keyPrefix: 'mcp:',
|
|
191
|
-
});
|
|
192
|
-
```
|
|
183
|
+
In other words, the only public API you interact with is the `redis: { ... }` block in the decorator config from Step 2. There is no `createSessionStore` helper exported from `@frontmcp/sdk` -- session store wiring is an internal concern of the framework.
|
|
193
184
|
|
|
194
|
-
|
|
185
|
+
If you need to share the same Redis config in another part of your code, declare it once and reuse it:
|
|
195
186
|
|
|
196
187
|
```typescript
|
|
197
|
-
|
|
198
|
-
options: RedisOptions, // RedisProviderOptions | VercelKvProviderOptions | legacy format
|
|
199
|
-
logger?: FrontMcpLogger,
|
|
200
|
-
): Promise<SessionStore>;
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
The factory function handles:
|
|
204
|
-
|
|
205
|
-
- Lazy-loading `ioredis` or `@vercel/kv` to avoid bundling unused dependencies
|
|
206
|
-
- Automatic key prefix namespacing (appends `session:` to the base prefix)
|
|
207
|
-
- Pre-connection for Vercel KV (the `await` is required)
|
|
208
|
-
|
|
209
|
-
There is also a synchronous variant for Redis-only (does not support Vercel KV):
|
|
188
|
+
import 'reflect-metadata';
|
|
210
189
|
|
|
211
|
-
|
|
212
|
-
import { createSessionStoreSync } from '@frontmcp/sdk';
|
|
190
|
+
import { FrontMcp, type RedisOptionsInput } from '@frontmcp/sdk';
|
|
213
191
|
|
|
214
|
-
const
|
|
192
|
+
const redis: RedisOptionsInput = {
|
|
215
193
|
provider: 'redis',
|
|
216
|
-
host: 'localhost',
|
|
217
|
-
port: 6379,
|
|
218
|
-
|
|
194
|
+
host: process.env['REDIS_HOST'] ?? 'localhost',
|
|
195
|
+
port: parseInt(process.env['REDIS_PORT'] ?? '6379', 10),
|
|
196
|
+
keyPrefix: 'mcp:',
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
@FrontMcp({
|
|
200
|
+
info: { name: 'my-server', version: '0.1.0' },
|
|
201
|
+
apps: [
|
|
202
|
+
/* ... */
|
|
203
|
+
],
|
|
204
|
+
redis,
|
|
205
|
+
})
|
|
206
|
+
export default class Server {}
|
|
219
207
|
```
|
|
220
208
|
|
|
221
209
|
## Step 4 -- Pub/Sub for Resource Subscriptions (Multi-Instance Only)
|
|
@@ -321,7 +309,7 @@ You should see session keys like `mcp:session:<session-id>`.
|
|
|
321
309
|
|
|
322
310
|
## Common Patterns
|
|
323
311
|
|
|
324
|
-
| Pattern |
|
|
312
|
+
| Pattern | Recommended | Less explicit | Why |
|
|
325
313
|
| ---------------------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
326
314
|
| Redis provider field | `redis: { provider: 'redis', host: '...', port: 6379 }` | `redis: { host: '...', port: 6379 }` without `provider` | Both forms are type-safe (the SDK's `RedisOptions` union accepts both shapes), but explicit `provider: 'redis'` improves clarity and intent |
|
|
327
315
|
| Environment variables | `host: process.env['REDIS_HOST'] ?? 'localhost'` | Hardcoding `host: 'redis.internal'` in source | Hardcoded values break across environments (dev, staging, prod); always read from env with a sensible fallback |
|
|
@@ -80,6 +80,7 @@ Update the `@FrontMcp` decorator in `src/main.ts`:
|
|
|
80
80
|
|
|
81
81
|
```typescript
|
|
82
82
|
import 'reflect-metadata';
|
|
83
|
+
|
|
83
84
|
import { FrontMcp } from '@frontmcp/sdk';
|
|
84
85
|
|
|
85
86
|
@FrontMcp({
|
|
@@ -188,34 +189,40 @@ sqlite: {
|
|
|
188
189
|
},
|
|
189
190
|
```
|
|
190
191
|
|
|
191
|
-
## Step 4 -- Session Store
|
|
192
|
+
## Step 4 -- How the SDK Builds the SQLite Session Store
|
|
193
|
+
|
|
194
|
+
You do not call any factory yourself. The SDK constructs the SQLite session store internally from the `sqlite` field on the `@FrontMcp` decorator. The framework handles:
|
|
195
|
+
|
|
196
|
+
- Lazy-loading `@frontmcp/storage-sqlite` to avoid bundling native modules when not used
|
|
197
|
+
- WAL mode pragma configuration
|
|
198
|
+
- TTL cleanup interval setup for automatic key expiration
|
|
199
|
+
- Creating the database file and parent directories if they do not exist
|
|
192
200
|
|
|
193
|
-
|
|
201
|
+
In other words, the only public API you interact with is the `sqlite: { ... }` block in the decorator config from Step 2. There is no `createSqliteSessionStore` helper exported from `@frontmcp/sdk` -- session store wiring is an internal concern of the framework.
|
|
202
|
+
|
|
203
|
+
If you need to share the same SQLite config in another part of your code, declare it once and reuse it:
|
|
194
204
|
|
|
195
205
|
```typescript
|
|
196
|
-
import
|
|
206
|
+
import 'reflect-metadata';
|
|
197
207
|
|
|
198
|
-
|
|
208
|
+
import { FrontMcp, type SqliteOptionsInput } from '@frontmcp/sdk';
|
|
209
|
+
|
|
210
|
+
const sqlite: SqliteOptionsInput = {
|
|
199
211
|
path: '~/.frontmcp/data/sessions.sqlite',
|
|
200
212
|
walMode: true,
|
|
201
213
|
encryption: { secret: process.env['SQLITE_ENCRYPTION_SECRET']! },
|
|
202
|
-
}
|
|
203
|
-
```
|
|
214
|
+
};
|
|
204
215
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
216
|
+
@FrontMcp({
|
|
217
|
+
info: { name: 'my-server', version: '0.1.0' },
|
|
218
|
+
apps: [
|
|
219
|
+
/* ... */
|
|
220
|
+
],
|
|
221
|
+
sqlite,
|
|
222
|
+
})
|
|
223
|
+
export default class Server {}
|
|
209
224
|
```
|
|
210
225
|
|
|
211
|
-
The factory function:
|
|
212
|
-
|
|
213
|
-
- Lazy-loads `@frontmcp/storage-sqlite` to avoid bundling native modules when not used
|
|
214
|
-
- Handles WAL mode pragma configuration internally
|
|
215
|
-
- Sets up the TTL cleanup interval for automatic key expiration
|
|
216
|
-
- Creates the database file and parent directories if they do not exist
|
|
217
|
-
- Returns synchronously (unlike the Redis `createSessionStore` which is async)
|
|
218
|
-
|
|
219
226
|
## Step 5 -- Environment Variables
|
|
220
227
|
|
|
221
228
|
Add to your `.env` file:
|