@frontmcp/skills 1.0.0-beta.13 → 1.0.0-beta.14
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 +55 -0
- package/catalog/frontmcp-config/SKILL.md +2 -2
- package/catalog/frontmcp-config/examples/configure-auth/multi-app-auth.md +87 -0
- package/catalog/frontmcp-config/examples/configure-auth/public-mode-setup.md +63 -0
- package/catalog/frontmcp-config/examples/configure-auth/remote-oauth-with-vault.md +76 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-self-signed-tokens.md +77 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/remote-enterprise-oauth.md +73 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/transparent-jwt-validation.md +64 -0
- package/catalog/frontmcp-config/examples/configure-elicitation/basic-confirmation-gate.md +83 -0
- package/catalog/frontmcp-config/examples/configure-elicitation/distributed-elicitation-redis.md +87 -0
- package/catalog/frontmcp-config/examples/configure-http/cors-restricted-origins.md +52 -0
- package/catalog/frontmcp-config/examples/configure-http/entry-path-reverse-proxy.md +72 -0
- package/catalog/frontmcp-config/examples/configure-http/unix-socket-local.md +64 -0
- package/catalog/frontmcp-config/examples/configure-session/multi-server-key-prefix.md +68 -0
- package/catalog/frontmcp-config/examples/configure-session/redis-session-store.md +52 -0
- package/catalog/frontmcp-config/examples/configure-session/vercel-kv-session.md +52 -0
- package/catalog/frontmcp-config/examples/configure-throttle/distributed-redis-throttle.md +94 -0
- package/catalog/frontmcp-config/examples/configure-throttle/per-tool-rate-limit.md +92 -0
- package/catalog/frontmcp-config/examples/configure-throttle/server-level-rate-limit.md +83 -0
- package/catalog/frontmcp-config/examples/configure-throttle-guard-config/full-guard-config.md +99 -0
- package/catalog/frontmcp-config/examples/configure-throttle-guard-config/minimal-guard-config.md +55 -0
- package/catalog/frontmcp-config/examples/configure-transport/custom-protocol-flags.md +74 -0
- package/catalog/frontmcp-config/examples/configure-transport/distributed-sessions-redis.md +86 -0
- package/catalog/frontmcp-config/examples/configure-transport/stateless-serverless.md +69 -0
- package/catalog/frontmcp-config/examples/configure-transport-protocol-presets/legacy-preset-nodejs.md +65 -0
- package/catalog/frontmcp-config/examples/configure-transport-protocol-presets/stateless-api-serverless.md +69 -0
- package/catalog/frontmcp-config/references/configure-auth-modes.md +10 -0
- package/catalog/frontmcp-config/references/configure-auth.md +10 -0
- package/catalog/frontmcp-config/references/configure-elicitation.md +9 -0
- package/catalog/frontmcp-config/references/configure-http.md +10 -0
- package/catalog/frontmcp-config/references/configure-session.md +10 -0
- package/catalog/frontmcp-config/references/configure-throttle-guard-config.md +9 -0
- package/catalog/frontmcp-config/references/configure-throttle.md +10 -0
- package/catalog/frontmcp-config/references/configure-transport-protocol-presets.md +9 -0
- package/catalog/frontmcp-config/references/configure-transport.md +10 -0
- package/catalog/frontmcp-config/references/setup-redis.md +5 -0
- package/catalog/frontmcp-config/references/setup-sqlite.md +5 -0
- package/catalog/frontmcp-deployment/SKILL.md +2 -2
- package/catalog/frontmcp-deployment/examples/build-for-browser/browser-build-with-custom-entry.md +43 -0
- package/catalog/frontmcp-deployment/examples/build-for-browser/browser-crypto-and-storage.md +85 -0
- package/catalog/frontmcp-deployment/examples/build-for-browser/react-provider-setup.md +61 -0
- package/catalog/frontmcp-deployment/examples/build-for-cli/cli-binary-build.md +66 -0
- package/catalog/frontmcp-deployment/examples/build-for-cli/unix-socket-daemon.md +76 -0
- package/catalog/frontmcp-deployment/examples/build-for-sdk/connect-openai.md +78 -0
- package/catalog/frontmcp-deployment/examples/build-for-sdk/create-flat-config.md +85 -0
- package/catalog/frontmcp-deployment/examples/build-for-sdk/multi-platform-connect.md +104 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/basic-worker-deploy.md +82 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-custom-domain.md +97 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-with-kv-storage.md +92 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/cdk-deployment.md +92 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/lambda-handler-with-cors.md +113 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/sam-template-basic.md +100 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node/docker-compose-with-redis.md +101 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node/pm2-with-nginx.md +79 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node/resource-limits.md +92 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node-dockerfile/basic-multistage-dockerfile.md +63 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node-dockerfile/secure-nonroot-dockerfile.md +89 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-mcp-endpoint-test.md +69 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-with-kv.md +82 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-with-skills-cache.md +90 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel-config/minimal-vercel-config.md +49 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel-config/vercel-config-with-security-headers.md +92 -0
- package/catalog/frontmcp-deployment/references/build-for-browser.md +10 -0
- package/catalog/frontmcp-deployment/references/build-for-cli.md +9 -0
- package/catalog/frontmcp-deployment/references/build-for-sdk.md +10 -0
- package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +10 -0
- package/catalog/frontmcp-deployment/references/deploy-to-lambda.md +10 -0
- package/catalog/frontmcp-deployment/references/deploy-to-node-dockerfile.md +9 -0
- package/catalog/frontmcp-deployment/references/deploy-to-node.md +10 -0
- package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +9 -0
- package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +10 -0
- package/catalog/frontmcp-development/SKILL.md +2 -2
- package/catalog/frontmcp-development/examples/create-adapter/basic-api-adapter.md +92 -0
- package/catalog/frontmcp-development/examples/create-adapter/namespaced-adapter.md +124 -0
- package/catalog/frontmcp-development/examples/create-agent/basic-agent-with-tools.md +121 -0
- package/catalog/frontmcp-development/examples/create-agent/custom-multi-pass-agent.md +95 -0
- package/catalog/frontmcp-development/examples/create-agent/nested-agents-with-swarm.md +111 -0
- package/catalog/frontmcp-development/examples/create-agent-llm-config/anthropic-config.md +81 -0
- package/catalog/frontmcp-development/examples/create-agent-llm-config/openai-config.md +80 -0
- package/catalog/frontmcp-development/examples/create-job/basic-report-job.md +87 -0
- package/catalog/frontmcp-development/examples/create-job/job-with-permissions.md +117 -0
- package/catalog/frontmcp-development/examples/create-job/job-with-retry.md +88 -0
- package/catalog/frontmcp-development/examples/create-plugin/basic-plugin-with-provider.md +69 -0
- package/catalog/frontmcp-development/examples/create-plugin/configurable-dynamic-plugin.md +178 -0
- package/catalog/frontmcp-development/examples/create-plugin/plugin-with-context-extension.md +107 -0
- package/catalog/frontmcp-development/examples/create-plugin-hooks/basic-logging-plugin.md +69 -0
- package/catalog/frontmcp-development/examples/create-plugin-hooks/caching-with-around.md +80 -0
- package/catalog/frontmcp-development/examples/create-plugin-hooks/tool-level-hooks-and-stage-replacement.md +100 -0
- package/catalog/frontmcp-development/examples/create-prompt/basic-prompt.md +72 -0
- package/catalog/frontmcp-development/examples/create-prompt/dynamic-rag-prompt.md +92 -0
- package/catalog/frontmcp-development/examples/create-prompt/multi-turn-debug-session.md +86 -0
- package/catalog/frontmcp-development/examples/create-provider/basic-database-provider.md +113 -0
- package/catalog/frontmcp-development/examples/create-provider/config-and-api-providers.md +107 -0
- package/catalog/frontmcp-development/examples/create-resource/basic-static-resource.md +72 -0
- package/catalog/frontmcp-development/examples/create-resource/binary-and-multi-content.md +111 -0
- package/catalog/frontmcp-development/examples/create-resource/parameterized-template.md +84 -0
- package/catalog/frontmcp-development/examples/create-skill/basic-inline-skill.md +96 -0
- package/catalog/frontmcp-development/examples/create-skill/directory-based-skill.md +115 -0
- package/catalog/frontmcp-development/examples/create-skill/parameterized-skill.md +96 -0
- package/catalog/frontmcp-development/examples/create-skill-with-tools/basic-tool-orchestration.md +76 -0
- package/catalog/frontmcp-development/examples/create-skill-with-tools/directory-skill-with-tools.md +149 -0
- package/catalog/frontmcp-development/examples/create-skill-with-tools/incident-response-skill.md +92 -0
- package/catalog/frontmcp-development/examples/create-tool/basic-class-tool.md +62 -0
- package/catalog/frontmcp-development/examples/create-tool/tool-with-di-and-errors.md +84 -0
- package/catalog/frontmcp-development/examples/create-tool/tool-with-rate-limiting-and-progress.md +93 -0
- package/catalog/frontmcp-development/examples/create-tool-annotations/destructive-delete-tool.md +94 -0
- package/catalog/frontmcp-development/examples/create-tool-annotations/readonly-query-tool.md +60 -0
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/primitive-and-media-outputs.md +104 -0
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-raw-shape-output.md +63 -0
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-schema-advanced-output.md +103 -0
- package/catalog/frontmcp-development/examples/create-workflow/basic-deploy-pipeline.md +91 -0
- package/catalog/frontmcp-development/examples/create-workflow/parallel-validation-pipeline.md +90 -0
- package/catalog/frontmcp-development/examples/create-workflow/webhook-triggered-workflow.md +136 -0
- package/catalog/frontmcp-development/examples/decorators-guide/agent-skill-job-workflow.md +145 -0
- package/catalog/frontmcp-development/examples/decorators-guide/basic-server-with-app-and-tools.md +124 -0
- package/catalog/frontmcp-development/examples/decorators-guide/multi-app-with-plugins-and-providers.md +149 -0
- package/catalog/frontmcp-development/examples/official-adapters/authenticated-adapter-with-polling.md +84 -0
- package/catalog/frontmcp-development/examples/official-adapters/basic-openapi-adapter.md +54 -0
- package/catalog/frontmcp-development/examples/official-adapters/multi-api-hub-with-inline-spec.md +130 -0
- package/catalog/frontmcp-development/examples/official-plugins/cache-and-feature-flags.md +117 -0
- package/catalog/frontmcp-development/examples/official-plugins/production-multi-plugin-setup.md +147 -0
- package/catalog/frontmcp-development/examples/official-plugins/remember-plugin-session-memory.md +104 -0
- package/catalog/frontmcp-development/references/create-adapter.md +9 -0
- package/catalog/frontmcp-development/references/create-agent-llm-config.md +9 -0
- package/catalog/frontmcp-development/references/create-agent.md +10 -0
- package/catalog/frontmcp-development/references/create-job.md +10 -0
- package/catalog/frontmcp-development/references/create-plugin-hooks.md +10 -0
- package/catalog/frontmcp-development/references/create-plugin.md +10 -0
- package/catalog/frontmcp-development/references/create-prompt.md +10 -0
- package/catalog/frontmcp-development/references/create-provider.md +9 -0
- package/catalog/frontmcp-development/references/create-resource.md +52 -15
- package/catalog/frontmcp-development/references/create-skill-with-tools.md +10 -0
- package/catalog/frontmcp-development/references/create-skill.md +10 -0
- package/catalog/frontmcp-development/references/create-tool-annotations.md +9 -0
- package/catalog/frontmcp-development/references/create-tool-output-schema-types.md +10 -0
- package/catalog/frontmcp-development/references/create-tool.md +10 -0
- package/catalog/frontmcp-development/references/create-workflow.md +10 -0
- package/catalog/frontmcp-development/references/decorators-guide.md +10 -0
- package/catalog/frontmcp-development/references/official-adapters.md +10 -0
- package/catalog/frontmcp-development/references/official-plugins.md +10 -0
- package/catalog/frontmcp-extensibility/SKILL.md +1 -1
- package/catalog/frontmcp-extensibility/examples/vectoriadb/product-catalog-search.md +175 -0
- package/catalog/frontmcp-extensibility/examples/vectoriadb/semantic-search-with-persistence.md +138 -0
- package/catalog/frontmcp-extensibility/examples/vectoriadb/tfidf-keyword-search.md +103 -0
- package/catalog/frontmcp-extensibility/references/vectoriadb.md +10 -0
- package/catalog/frontmcp-guides/SKILL.md +2 -2
- package/catalog/frontmcp-guides/examples/example-knowledge-base/agent-and-plugin.md +160 -0
- package/catalog/frontmcp-guides/examples/example-knowledge-base/multi-app-composition.md +92 -0
- package/catalog/frontmcp-guides/examples/example-knowledge-base/vector-search-and-resources.md +135 -0
- package/catalog/frontmcp-guides/examples/example-task-manager/auth-and-crud-tools.md +135 -0
- package/catalog/frontmcp-guides/examples/example-task-manager/authenticated-e2e-tests.md +148 -0
- package/catalog/frontmcp-guides/examples/example-task-manager/redis-provider-with-di.md +129 -0
- package/catalog/frontmcp-guides/examples/example-weather-api/server-and-app-setup.md +75 -0
- package/catalog/frontmcp-guides/examples/example-weather-api/unit-and-e2e-tests.md +142 -0
- package/catalog/frontmcp-guides/examples/example-weather-api/weather-tool-with-schemas.md +74 -0
- package/catalog/frontmcp-guides/references/example-knowledge-base.md +10 -0
- package/catalog/frontmcp-guides/references/example-task-manager.md +10 -0
- package/catalog/frontmcp-guides/references/example-weather-api.md +10 -0
- package/catalog/frontmcp-production-readiness/SKILL.md +2 -2
- package/catalog/frontmcp-production-readiness/examples/common-checklist/caching-and-performance.md +102 -0
- package/catalog/frontmcp-production-readiness/examples/common-checklist/observability-setup.md +104 -0
- package/catalog/frontmcp-production-readiness/examples/common-checklist/security-hardening.md +95 -0
- package/catalog/frontmcp-production-readiness/examples/production-browser/browser-bundle-config.md +93 -0
- package/catalog/frontmcp-production-readiness/examples/production-browser/cross-platform-crypto.md +116 -0
- package/catalog/frontmcp-production-readiness/examples/production-browser/security-and-performance.md +128 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-binary/binary-build-config.md +109 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-binary/stdio-transport-error-handling.md +132 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/daemon-socket-config.md +82 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/graceful-shutdown-cleanup.md +107 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/security-and-permissions.md +119 -0
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/durable-objects-state.md +124 -0
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/workers-runtime-constraints.md +103 -0
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/wrangler-config.md +89 -0
- package/catalog/frontmcp-production-readiness/examples/production-lambda/cold-start-connection-reuse.md +122 -0
- package/catalog/frontmcp-production-readiness/examples/production-lambda/sam-template.md +107 -0
- package/catalog/frontmcp-production-readiness/examples/production-lambda/scaling-and-monitoring.md +138 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-sdk/basic-sdk-lifecycle.md +85 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-sdk/multi-instance-cleanup.md +110 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-sdk/package-json-config.md +107 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-server/docker-multi-stage.md +103 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-server/graceful-shutdown.md +87 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-server/redis-session-scaling.md +97 -0
- package/catalog/frontmcp-production-readiness/examples/production-vercel/cold-start-optimization.md +104 -0
- package/catalog/frontmcp-production-readiness/examples/production-vercel/stateless-serverless-design.md +91 -0
- package/catalog/frontmcp-production-readiness/examples/production-vercel/vercel-edge-config.md +78 -0
- package/catalog/frontmcp-production-readiness/references/common-checklist.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-browser.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-cli-binary.md +9 -0
- package/catalog/frontmcp-production-readiness/references/production-cli-daemon.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-cloudflare.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-lambda.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-node-sdk.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-node-server.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-vercel.md +10 -0
- package/catalog/frontmcp-setup/examples/frontmcp-skills-usage/bundle-presets-scaffolding.md +61 -0
- package/catalog/frontmcp-setup/examples/frontmcp-skills-usage/install-and-search-skills.md +83 -0
- package/catalog/frontmcp-setup/examples/multi-app-composition/local-apps-with-shared-tools.md +87 -0
- package/catalog/frontmcp-setup/examples/multi-app-composition/per-app-auth-and-isolation.md +88 -0
- package/catalog/frontmcp-setup/examples/multi-app-composition/remote-and-esm-apps.md +81 -0
- package/catalog/frontmcp-setup/examples/nx-workflow/build-test-affected.md +77 -0
- package/catalog/frontmcp-setup/examples/nx-workflow/multi-server-deployment.md +93 -0
- package/catalog/frontmcp-setup/examples/nx-workflow/scaffold-and-generate.md +62 -0
- package/catalog/frontmcp-setup/examples/project-structure-nx/nx-generator-scaffolding.md +73 -0
- package/catalog/frontmcp-setup/examples/project-structure-nx/nx-workspace-with-apps.md +85 -0
- package/catalog/frontmcp-setup/examples/project-structure-nx/shared-library-usage.md +89 -0
- package/catalog/frontmcp-setup/examples/project-structure-standalone/dev-workflow-commands.md +64 -0
- package/catalog/frontmcp-setup/examples/project-structure-standalone/feature-folder-organization.md +111 -0
- package/catalog/frontmcp-setup/examples/project-structure-standalone/minimal-standalone-layout.md +73 -0
- package/catalog/frontmcp-setup/examples/readme-guide/node-server-readme.md +89 -0
- package/catalog/frontmcp-setup/examples/readme-guide/vercel-deployment-readme.md +90 -0
- package/catalog/frontmcp-setup/examples/setup-project/basic-node-server.md +99 -0
- package/catalog/frontmcp-setup/examples/setup-project/cli-scaffold-with-flags.md +77 -0
- package/catalog/frontmcp-setup/examples/setup-project/vercel-serverless-server.md +89 -0
- package/catalog/frontmcp-setup/examples/setup-redis/docker-redis-local-dev.md +88 -0
- package/catalog/frontmcp-setup/examples/setup-redis/hybrid-vercel-kv-with-pubsub.md +78 -0
- package/catalog/frontmcp-setup/examples/setup-redis/vercel-kv-serverless.md +78 -0
- package/catalog/frontmcp-setup/examples/setup-sqlite/basic-sqlite-setup.md +75 -0
- package/catalog/frontmcp-setup/examples/setup-sqlite/encrypted-sqlite-storage.md +55 -0
- package/catalog/frontmcp-setup/examples/setup-sqlite/unix-socket-daemon.md +70 -0
- package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +9 -0
- package/catalog/frontmcp-setup/references/multi-app-composition.md +10 -0
- package/catalog/frontmcp-setup/references/nx-workflow.md +10 -0
- package/catalog/frontmcp-setup/references/project-structure-nx.md +10 -0
- package/catalog/frontmcp-setup/references/project-structure-standalone.md +10 -0
- package/catalog/frontmcp-setup/references/readme-guide.md +9 -0
- package/catalog/frontmcp-setup/references/setup-project.md +10 -0
- package/catalog/frontmcp-setup/references/setup-redis.md +10 -0
- package/catalog/frontmcp-setup/references/setup-sqlite.md +10 -0
- package/catalog/frontmcp-testing/examples/setup-testing/fixture-based-e2e-test.md +70 -0
- package/catalog/frontmcp-testing/examples/setup-testing/jest-config-with-coverage.md +59 -0
- package/catalog/frontmcp-testing/examples/setup-testing/unit-test-tool-resource-prompt.md +115 -0
- package/catalog/frontmcp-testing/examples/test-auth/oauth-flow-test.md +78 -0
- package/catalog/frontmcp-testing/examples/test-auth/role-based-access-test.md +88 -0
- package/catalog/frontmcp-testing/examples/test-auth/token-factory-test.md +71 -0
- package/catalog/frontmcp-testing/examples/test-browser-build/browser-bundle-validation.md +58 -0
- package/catalog/frontmcp-testing/examples/test-browser-build/playwright-browser-test.md +69 -0
- package/catalog/frontmcp-testing/examples/test-cli-binary/binary-startup-test.md +77 -0
- package/catalog/frontmcp-testing/examples/test-cli-binary/js-bundle-import-test.md +56 -0
- package/catalog/frontmcp-testing/examples/test-direct-client/basic-create-test.md +74 -0
- package/catalog/frontmcp-testing/examples/test-direct-client/openai-claude-format-test.md +79 -0
- package/catalog/frontmcp-testing/examples/test-e2e-handler/basic-e2e-test.md +67 -0
- package/catalog/frontmcp-testing/examples/test-e2e-handler/manual-client-with-transport.md +72 -0
- package/catalog/frontmcp-testing/examples/test-e2e-handler/tool-call-and-error-e2e.md +73 -0
- package/catalog/frontmcp-testing/examples/test-tool-unit/basic-tool-test.md +69 -0
- package/catalog/frontmcp-testing/examples/test-tool-unit/schema-validation-test.md +82 -0
- package/catalog/frontmcp-testing/examples/test-tool-unit/tool-error-handling-test.md +92 -0
- package/catalog/frontmcp-testing/references/setup-testing.md +10 -0
- package/catalog/frontmcp-testing/references/test-auth.md +10 -0
- package/catalog/frontmcp-testing/references/test-browser-build.md +9 -0
- package/catalog/frontmcp-testing/references/test-cli-binary.md +9 -0
- package/catalog/frontmcp-testing/references/test-direct-client.md +9 -0
- package/catalog/frontmcp-testing/references/test-e2e-handler.md +10 -0
- package/catalog/frontmcp-testing/references/test-tool-unit.md +10 -0
- package/catalog/skills-manifest.json +2383 -67
- package/package.json +1 -1
- package/src/manifest.d.ts +23 -0
- package/src/manifest.js +3 -1
- package/src/manifest.js.map +1 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: durable-objects-state
|
|
3
|
+
reference: production-cloudflare
|
|
4
|
+
level: advanced
|
|
5
|
+
description: 'Shows how to use Cloudflare Durable Objects for stateful coordination alongside the stateless Workers runtime, with KV for cache and R2 for blob storage.'
|
|
6
|
+
tags: [production, cloudflare, cache, throttle, durable, objects]
|
|
7
|
+
features:
|
|
8
|
+
- 'Using Durable Objects for stateful coordination (rate limiting) in an ephemeral Workers runtime'
|
|
9
|
+
- 'Using R2 for blob/file storage since Workers have no filesystem'
|
|
10
|
+
- 'Combining KV (cache), R2 (files), and Durable Objects (state) in one deployment'
|
|
11
|
+
- 'Wrangler configuration with all three binding types'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Stateful Coordination with Durable Objects
|
|
15
|
+
|
|
16
|
+
Shows how to use Cloudflare Durable Objects for stateful coordination alongside the stateless Workers runtime, with KV for cache and R2 for blob storage.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```toml
|
|
21
|
+
# wrangler.toml — with Durable Objects and R2
|
|
22
|
+
name = "stateful-mcp-worker"
|
|
23
|
+
main = "dist/worker.js"
|
|
24
|
+
compatibility_date = "2024-01-01"
|
|
25
|
+
|
|
26
|
+
# KV for cache
|
|
27
|
+
[[kv_namespaces]]
|
|
28
|
+
binding = "CACHE"
|
|
29
|
+
id = "cache-namespace-id"
|
|
30
|
+
|
|
31
|
+
# R2 for blob/file storage
|
|
32
|
+
[[r2_buckets]]
|
|
33
|
+
binding = "FILES"
|
|
34
|
+
bucket_name = "mcp-files"
|
|
35
|
+
|
|
36
|
+
# Durable Objects for stateful coordination
|
|
37
|
+
[durable_objects]
|
|
38
|
+
bindings = [
|
|
39
|
+
{ name = "RATE_LIMITER", class_name = "RateLimiterDO" }
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[[migrations]]
|
|
43
|
+
tag = "v1"
|
|
44
|
+
new_classes = ["RateLimiterDO"]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// src/tools/rate-limited-action.tool.ts
|
|
49
|
+
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
50
|
+
import { z } from 'zod';
|
|
51
|
+
|
|
52
|
+
@Tool({
|
|
53
|
+
name: 'rate_limited_action',
|
|
54
|
+
description: 'An action that uses Durable Objects for distributed rate limiting',
|
|
55
|
+
inputSchema: {
|
|
56
|
+
userId: z.string().min(1).describe('User identifier'),
|
|
57
|
+
action: z.string().min(1).describe('Action to perform'),
|
|
58
|
+
},
|
|
59
|
+
outputSchema: {
|
|
60
|
+
allowed: z.boolean(),
|
|
61
|
+
remaining: z.number(),
|
|
62
|
+
action: z.string(),
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
export class RateLimitedActionTool extends ToolContext {
|
|
66
|
+
async execute(input: { userId: string; action: string }) {
|
|
67
|
+
// Durable Objects provide stateful rate limiting across Workers instances
|
|
68
|
+
// Each user gets their own Durable Object instance for consistent state
|
|
69
|
+
const result = await this.fetch(`https://internal/rate-check/${input.userId}`, {
|
|
70
|
+
method: 'POST',
|
|
71
|
+
headers: { 'Content-Type': 'application/json' },
|
|
72
|
+
body: JSON.stringify({ action: input.action }),
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const { allowed, remaining } = await result.json();
|
|
76
|
+
|
|
77
|
+
if (!allowed) {
|
|
78
|
+
this.fail(new Error(`Rate limit exceeded for user ${input.userId}`));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return { allowed, remaining, action: input.action };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// src/tools/file-upload.tool.ts
|
|
88
|
+
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
89
|
+
import { z } from 'zod';
|
|
90
|
+
|
|
91
|
+
@Tool({
|
|
92
|
+
name: 'upload_file',
|
|
93
|
+
description: 'Upload a file to R2 object storage',
|
|
94
|
+
inputSchema: {
|
|
95
|
+
filename: z.string().min(1).describe('File name'),
|
|
96
|
+
content: z.string().min(1).describe('File content (base64 encoded)'),
|
|
97
|
+
},
|
|
98
|
+
outputSchema: {
|
|
99
|
+
key: z.string(),
|
|
100
|
+
url: z.string(),
|
|
101
|
+
size: z.number(),
|
|
102
|
+
},
|
|
103
|
+
})
|
|
104
|
+
export class FileUploadTool extends ToolContext {
|
|
105
|
+
async execute(input: { filename: string; content: string }) {
|
|
106
|
+
// R2 for blob/file storage — no filesystem in Workers
|
|
107
|
+
const key = `uploads/${Date.now()}-${input.filename}`;
|
|
108
|
+
const size = input.content.length;
|
|
109
|
+
|
|
110
|
+
return { key, url: `https://files.example.com/${key}`, size };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## What This Demonstrates
|
|
116
|
+
|
|
117
|
+
- Using Durable Objects for stateful coordination (rate limiting) in an ephemeral Workers runtime
|
|
118
|
+
- Using R2 for blob/file storage since Workers have no filesystem
|
|
119
|
+
- Combining KV (cache), R2 (files), and Durable Objects (state) in one deployment
|
|
120
|
+
- Wrangler configuration with all three binding types
|
|
121
|
+
|
|
122
|
+
## Related
|
|
123
|
+
|
|
124
|
+
- See `production-cloudflare` for the full storage and scaling checklist
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workers-runtime-constraints
|
|
3
|
+
reference: production-cloudflare
|
|
4
|
+
level: intermediate
|
|
5
|
+
description: 'Shows how to write tools that are compatible with the Cloudflare Workers runtime: no Node.js APIs, no eval, only async I/O, and using Web APIs.'
|
|
6
|
+
tags: [production, cloudflare, node, workers, runtime, constraints]
|
|
7
|
+
features:
|
|
8
|
+
- 'Using `@frontmcp/utils` for crypto instead of `node:crypto` (Workers use V8 isolates, not Node)'
|
|
9
|
+
- 'All I/O is async (no synchronous blocking operations allowed in Workers)'
|
|
10
|
+
- 'No `eval()` or dynamic `Function()` (prohibited in Workers)'
|
|
11
|
+
- 'No filesystem access (Workers have no filesystem)'
|
|
12
|
+
- 'Using Fetch API via `this.fetch()` instead of Node.js `http`/`https`'
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Workers Runtime Constraints and Compatibility
|
|
16
|
+
|
|
17
|
+
Shows how to write tools that are compatible with the Cloudflare Workers runtime: no Node.js APIs, no eval, only async I/O, and using Web APIs.
|
|
18
|
+
|
|
19
|
+
## Code
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
// src/tools/worker-safe.tool.ts
|
|
23
|
+
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
24
|
+
import { z } from 'zod';
|
|
25
|
+
// Use @frontmcp/utils — wraps Web Crypto API, works in Workers
|
|
26
|
+
import { sha256Hex, randomUUID, base64urlEncode } from '@frontmcp/utils';
|
|
27
|
+
|
|
28
|
+
@Tool({
|
|
29
|
+
name: 'transform_data',
|
|
30
|
+
description: 'Transform and hash data in a Workers-compatible way',
|
|
31
|
+
inputSchema: {
|
|
32
|
+
payload: z.string().min(1).describe('Data to transform'),
|
|
33
|
+
},
|
|
34
|
+
outputSchema: {
|
|
35
|
+
id: z.string(),
|
|
36
|
+
hash: z.string(),
|
|
37
|
+
encoded: z.string(),
|
|
38
|
+
timestamp: z.string(),
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
export class TransformDataTool extends ToolContext {
|
|
42
|
+
async execute(input: { payload: string }) {
|
|
43
|
+
// All operations are async — no synchronous blocking
|
|
44
|
+
|
|
45
|
+
// Cross-platform crypto (Web Crypto under the hood)
|
|
46
|
+
const id = randomUUID();
|
|
47
|
+
const hash = sha256Hex(input.payload);
|
|
48
|
+
const encoded = base64urlEncode(input.payload);
|
|
49
|
+
|
|
50
|
+
// Use this.fetch() — standard Fetch API, not node http
|
|
51
|
+
const response = await this.fetch('https://api.example.com/transform', {
|
|
52
|
+
method: 'POST',
|
|
53
|
+
headers: { 'Content-Type': 'application/json' },
|
|
54
|
+
body: JSON.stringify({ id, payload: input.payload }),
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (!response.ok) {
|
|
58
|
+
this.fail(new Error(`Transform API error: ${response.status}`));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
id,
|
|
63
|
+
hash,
|
|
64
|
+
encoded,
|
|
65
|
+
timestamp: new Date().toISOString(),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
// src/providers/kv-store.provider.ts
|
|
73
|
+
import { Provider, ProviderScope } from '@frontmcp/sdk';
|
|
74
|
+
|
|
75
|
+
export const KV_STORE = Symbol('KvStore');
|
|
76
|
+
|
|
77
|
+
// Workers KV — no filesystem, no eval, no dynamic Function()
|
|
78
|
+
@Provider({ token: KV_STORE, scope: ProviderScope.GLOBAL })
|
|
79
|
+
export class KvStoreProvider {
|
|
80
|
+
// Workers KV is bound via wrangler.toml, accessed from env
|
|
81
|
+
async get(key: string): Promise<string | null> {
|
|
82
|
+
// In Workers, KV is available via the environment binding
|
|
83
|
+
// This is a pattern — actual binding depends on your worker setup
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async put(key: string, value: string, ttlSeconds?: number): Promise<void> {
|
|
88
|
+
// KV put with optional TTL
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## What This Demonstrates
|
|
94
|
+
|
|
95
|
+
- Using `@frontmcp/utils` for crypto instead of `node:crypto` (Workers use V8 isolates, not Node)
|
|
96
|
+
- All I/O is async (no synchronous blocking operations allowed in Workers)
|
|
97
|
+
- No `eval()` or dynamic `Function()` (prohibited in Workers)
|
|
98
|
+
- No filesystem access (Workers have no filesystem)
|
|
99
|
+
- Using Fetch API via `this.fetch()` instead of Node.js `http`/`https`
|
|
100
|
+
|
|
101
|
+
## Related
|
|
102
|
+
|
|
103
|
+
- See `production-cloudflare` for the full Workers runtime and performance checklist
|
package/catalog/frontmcp-production-readiness/examples/production-cloudflare/wrangler-config.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wrangler-config
|
|
3
|
+
reference: production-cloudflare
|
|
4
|
+
level: basic
|
|
5
|
+
description: 'Shows how to configure `wrangler.toml` with correct routes, KV bindings for session storage, and secret management for a FrontMCP Cloudflare Worker.'
|
|
6
|
+
tags: [production, cloudflare, cache, session, wrangler, config]
|
|
7
|
+
features:
|
|
8
|
+
- 'Complete `wrangler.toml` with KV bindings for sessions and cache'
|
|
9
|
+
- 'Separate staging/production environment configs'
|
|
10
|
+
- 'Cloudflare Worker entry point via `createCloudflareHandler`'
|
|
11
|
+
- 'Secrets managed via `wrangler secret put` (not in config files)'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Wrangler Configuration with KV Bindings
|
|
15
|
+
|
|
16
|
+
Shows how to configure `wrangler.toml` with correct routes, KV bindings for session storage, and secret management for a FrontMCP Cloudflare Worker.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```toml
|
|
21
|
+
# wrangler.toml
|
|
22
|
+
name = "my-mcp-worker"
|
|
23
|
+
main = "dist/worker.js"
|
|
24
|
+
compatibility_date = "2024-01-01"
|
|
25
|
+
|
|
26
|
+
# Custom domain routing
|
|
27
|
+
routes = [
|
|
28
|
+
{ pattern = "mcp.example.com/*", zone_name = "example.com" }
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
# KV namespace for session storage
|
|
32
|
+
[[kv_namespaces]]
|
|
33
|
+
binding = "MCP_SESSIONS"
|
|
34
|
+
id = "abc123def456"
|
|
35
|
+
|
|
36
|
+
# KV namespace for cache
|
|
37
|
+
[[kv_namespaces]]
|
|
38
|
+
binding = "MCP_CACHE"
|
|
39
|
+
id = "def456ghi789"
|
|
40
|
+
|
|
41
|
+
# Environment-specific config
|
|
42
|
+
[env.staging]
|
|
43
|
+
name = "my-mcp-worker-staging"
|
|
44
|
+
routes = [
|
|
45
|
+
{ pattern = "mcp-staging.example.com/*", zone_name = "example.com" }
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[env.production]
|
|
49
|
+
name = "my-mcp-worker-production"
|
|
50
|
+
routes = [
|
|
51
|
+
{ pattern = "mcp.example.com/*", zone_name = "example.com" }
|
|
52
|
+
]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
// src/main.ts
|
|
57
|
+
import { FrontMcp } from '@frontmcp/sdk';
|
|
58
|
+
import { MyApp } from './my.app';
|
|
59
|
+
|
|
60
|
+
@FrontMcp({
|
|
61
|
+
info: { name: 'cf-mcp', version: '1.0.0' },
|
|
62
|
+
apps: [MyApp],
|
|
63
|
+
|
|
64
|
+
// CORS: use the workers.dev or custom domain
|
|
65
|
+
cors: {
|
|
66
|
+
origin: ['https://app.example.com'],
|
|
67
|
+
},
|
|
68
|
+
})
|
|
69
|
+
export default class CloudflareMcpServer {}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
// src/worker.ts — Cloudflare Worker entry point
|
|
74
|
+
import { createCloudflareHandler } from '@frontmcp/adapters/cloudflare';
|
|
75
|
+
import Server from './main';
|
|
76
|
+
|
|
77
|
+
export default createCloudflareHandler(Server);
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## What This Demonstrates
|
|
81
|
+
|
|
82
|
+
- Complete `wrangler.toml` with KV bindings for sessions and cache
|
|
83
|
+
- Separate staging/production environment configs
|
|
84
|
+
- Cloudflare Worker entry point via `createCloudflareHandler`
|
|
85
|
+
- Secrets managed via `wrangler secret put` (not in config files)
|
|
86
|
+
|
|
87
|
+
## Related
|
|
88
|
+
|
|
89
|
+
- See `production-cloudflare` for the full Cloudflare Workers checklist
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cold-start-connection-reuse
|
|
3
|
+
reference: production-lambda
|
|
4
|
+
level: intermediate
|
|
5
|
+
description: 'Shows how to minimize Lambda cold starts with lazy initialization, tree-shaking, and the connection reuse pattern for external services.'
|
|
6
|
+
tags: [production, lambda, performance, cold, start, connection]
|
|
7
|
+
features:
|
|
8
|
+
- 'Connection reuse pattern: caching connections in module scope across warm invocations'
|
|
9
|
+
- 'Lazy-loading heavy dependencies (`pg`) via dynamic `import()` to reduce cold start'
|
|
10
|
+
- 'Not closing connections in `onDestroy()` for Lambda (they survive freeze/thaw)'
|
|
11
|
+
- 'Keeping module scope lightweight with no heavy initialization'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Cold Start Optimization and Connection Reuse
|
|
15
|
+
|
|
16
|
+
Shows how to minimize Lambda cold starts with lazy initialization, tree-shaking, and the connection reuse pattern for external services.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// src/providers/db-connection.provider.ts
|
|
22
|
+
import { Provider, ProviderScope } from '@frontmcp/sdk';
|
|
23
|
+
|
|
24
|
+
export const DB_CLIENT = Symbol('DbClient');
|
|
25
|
+
|
|
26
|
+
// Connection reuse pattern: connections survive between warm invocations
|
|
27
|
+
// but must handle cold starts and reconnection gracefully
|
|
28
|
+
let cachedConnection: unknown | undefined;
|
|
29
|
+
|
|
30
|
+
@Provider({ token: DB_CLIENT, scope: ProviderScope.GLOBAL })
|
|
31
|
+
export class DbConnectionProvider {
|
|
32
|
+
private connection: unknown;
|
|
33
|
+
|
|
34
|
+
async onInit(): Promise<void> {
|
|
35
|
+
// Reuse connection across warm invocations
|
|
36
|
+
if (cachedConnection) {
|
|
37
|
+
this.connection = cachedConnection;
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Lazy-load the database driver — reduces cold start time
|
|
42
|
+
const { Client } = await import('pg');
|
|
43
|
+
this.connection = new Client({
|
|
44
|
+
host: process.env.DB_HOST,
|
|
45
|
+
connectionTimeoutMillis: 5000, // Don't hang on connection attempts
|
|
46
|
+
});
|
|
47
|
+
await (this.connection as { connect: () => Promise<void> }).connect();
|
|
48
|
+
|
|
49
|
+
// Cache for warm invocations
|
|
50
|
+
cachedConnection = this.connection;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
getConnection() {
|
|
54
|
+
return this.connection;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Note: Don't close in onDestroy for Lambda — connection survives freeze/thaw
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
// src/tools/optimized-query.tool.ts
|
|
63
|
+
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
64
|
+
import { z } from 'zod';
|
|
65
|
+
import { DB_CLIENT } from '../providers/db-connection.provider';
|
|
66
|
+
|
|
67
|
+
@Tool({
|
|
68
|
+
name: 'query_data',
|
|
69
|
+
description: 'Query data with connection reuse',
|
|
70
|
+
inputSchema: {
|
|
71
|
+
id: z.string().min(1).describe('Record ID'),
|
|
72
|
+
},
|
|
73
|
+
outputSchema: {
|
|
74
|
+
id: z.string(),
|
|
75
|
+
data: z.string(),
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
export class OptimizedQueryTool extends ToolContext {
|
|
79
|
+
async execute(input: { id: string }) {
|
|
80
|
+
const db = this.get(DB_CLIENT);
|
|
81
|
+
|
|
82
|
+
// Parameterized query — prevents SQL injection
|
|
83
|
+
const result = await (db as { getConnection: () => { query: Function } })
|
|
84
|
+
.getConnection()
|
|
85
|
+
.query('SELECT * FROM records WHERE id = $1', [input.id]);
|
|
86
|
+
|
|
87
|
+
if (!result.rows[0]) {
|
|
88
|
+
this.fail(new Error(`Record not found: ${input.id}`));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return { id: input.id, data: JSON.stringify(result.rows[0]) };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
// src/main.ts
|
|
98
|
+
import { FrontMcp } from '@frontmcp/sdk';
|
|
99
|
+
// Only import lightweight modules at the top level
|
|
100
|
+
// Heavy imports happen lazily in providers
|
|
101
|
+
import { MyApp } from './my.app';
|
|
102
|
+
|
|
103
|
+
// No heavy initialization at module scope
|
|
104
|
+
// No network calls, no database connections here
|
|
105
|
+
|
|
106
|
+
@FrontMcp({
|
|
107
|
+
info: { name: 'fast-lambda', version: '1.0.0' },
|
|
108
|
+
apps: [MyApp],
|
|
109
|
+
})
|
|
110
|
+
export default class FastLambdaServer {}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## What This Demonstrates
|
|
114
|
+
|
|
115
|
+
- Connection reuse pattern: caching connections in module scope across warm invocations
|
|
116
|
+
- Lazy-loading heavy dependencies (`pg`) via dynamic `import()` to reduce cold start
|
|
117
|
+
- Not closing connections in `onDestroy()` for Lambda (they survive freeze/thaw)
|
|
118
|
+
- Keeping module scope lightweight with no heavy initialization
|
|
119
|
+
|
|
120
|
+
## Related
|
|
121
|
+
|
|
122
|
+
- See `production-lambda` for the full cold start and scaling checklist
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sam-template
|
|
3
|
+
reference: production-lambda
|
|
4
|
+
level: basic
|
|
5
|
+
description: 'Shows a complete SAM/CloudFormation template for deploying a FrontMCP server to AWS Lambda with API Gateway routing, DynamoDB for session storage, and proper environment configuration.'
|
|
6
|
+
tags: [production, lambda, session, sam, template]
|
|
7
|
+
features:
|
|
8
|
+
- 'Complete SAM template with API Gateway, Lambda function, and DynamoDB table'
|
|
9
|
+
- 'DynamoDB for session storage with TTL-based automatic cleanup'
|
|
10
|
+
- 'Lambda handler entry point via `createLambdaHandler`'
|
|
11
|
+
- 'Pay-per-request billing for cost-effective scaling'
|
|
12
|
+
- 'IAM policies scoped to the specific DynamoDB table'
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# SAM Template with API Gateway and DynamoDB
|
|
16
|
+
|
|
17
|
+
Shows a complete SAM/CloudFormation template for deploying a FrontMCP server to AWS Lambda with API Gateway routing, DynamoDB for session storage, and proper environment configuration.
|
|
18
|
+
|
|
19
|
+
## Code
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
# ci/template.yaml
|
|
23
|
+
AWSTemplateFormatVersion: '2010-09-09'
|
|
24
|
+
Transform: AWS::Serverless-2016-10-31
|
|
25
|
+
Description: FrontMCP Lambda deployment
|
|
26
|
+
|
|
27
|
+
Globals:
|
|
28
|
+
Function:
|
|
29
|
+
Runtime: nodejs20.x
|
|
30
|
+
Timeout: 30
|
|
31
|
+
MemorySize: 256
|
|
32
|
+
Environment:
|
|
33
|
+
Variables:
|
|
34
|
+
NODE_ENV: production
|
|
35
|
+
SESSION_TABLE: !Ref SessionTable
|
|
36
|
+
|
|
37
|
+
Resources:
|
|
38
|
+
McpFunction:
|
|
39
|
+
Type: AWS::Serverless::Function
|
|
40
|
+
Properties:
|
|
41
|
+
Handler: dist/lambda.handler
|
|
42
|
+
CodeUri: .
|
|
43
|
+
Events:
|
|
44
|
+
McpApi:
|
|
45
|
+
Type: Api
|
|
46
|
+
Properties:
|
|
47
|
+
Path: /mcp/{proxy+}
|
|
48
|
+
Method: ANY
|
|
49
|
+
Policies:
|
|
50
|
+
- DynamoDBCrudPolicy:
|
|
51
|
+
TableName: !Ref SessionTable
|
|
52
|
+
|
|
53
|
+
SessionTable:
|
|
54
|
+
Type: AWS::DynamoDB::Table
|
|
55
|
+
Properties:
|
|
56
|
+
TableName: mcp-sessions
|
|
57
|
+
BillingMode: PAY_PER_REQUEST
|
|
58
|
+
AttributeDefinitions:
|
|
59
|
+
- AttributeName: sessionId
|
|
60
|
+
AttributeType: S
|
|
61
|
+
KeySchema:
|
|
62
|
+
- AttributeName: sessionId
|
|
63
|
+
KeyType: HASH
|
|
64
|
+
TimeToLiveSpecification:
|
|
65
|
+
AttributeName: ttl
|
|
66
|
+
Enabled: true
|
|
67
|
+
|
|
68
|
+
Outputs:
|
|
69
|
+
ApiEndpoint:
|
|
70
|
+
Description: API Gateway endpoint URL
|
|
71
|
+
Value: !Sub 'https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/mcp/'
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
// src/lambda.ts — Lambda handler entry point
|
|
76
|
+
import { createLambdaHandler } from '@frontmcp/adapters/lambda';
|
|
77
|
+
import Server from './main';
|
|
78
|
+
|
|
79
|
+
export const handler = createLambdaHandler(Server);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
// src/main.ts
|
|
84
|
+
import { FrontMcp } from '@frontmcp/sdk';
|
|
85
|
+
import { MyApp } from './my.app';
|
|
86
|
+
|
|
87
|
+
@FrontMcp({
|
|
88
|
+
info: { name: 'lambda-mcp', version: '1.0.0' },
|
|
89
|
+
apps: [MyApp],
|
|
90
|
+
cors: {
|
|
91
|
+
origin: ['https://app.example.com'],
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
export default class LambdaMcpServer {}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## What This Demonstrates
|
|
98
|
+
|
|
99
|
+
- Complete SAM template with API Gateway, Lambda function, and DynamoDB table
|
|
100
|
+
- DynamoDB for session storage with TTL-based automatic cleanup
|
|
101
|
+
- Lambda handler entry point via `createLambdaHandler`
|
|
102
|
+
- Pay-per-request billing for cost-effective scaling
|
|
103
|
+
- IAM policies scoped to the specific DynamoDB table
|
|
104
|
+
|
|
105
|
+
## Related
|
|
106
|
+
|
|
107
|
+
- See `production-lambda` for the full SAM/CloudFormation and Lambda runtime checklist
|
package/catalog/frontmcp-production-readiness/examples/production-lambda/scaling-and-monitoring.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scaling-and-monitoring
|
|
3
|
+
reference: production-lambda
|
|
4
|
+
level: advanced
|
|
5
|
+
description: 'Shows how to configure concurrency limits, dead letter queues, provisioned concurrency, and CloudWatch alarms for a production Lambda deployment.'
|
|
6
|
+
tags: [production, lambda, performance, scaling, monitoring]
|
|
7
|
+
features:
|
|
8
|
+
- 'Reserved concurrency to prevent downstream service overload'
|
|
9
|
+
- 'Provisioned concurrency for latency-sensitive endpoints (reduces cold starts)'
|
|
10
|
+
- 'Dead letter queue (DLQ) for capturing failed invocations'
|
|
11
|
+
- 'CloudWatch alarms for error rate and throttling detection'
|
|
12
|
+
- 'Loading secrets from AWS SSM Parameter Store instead of environment variables'
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Lambda Scaling, Concurrency Limits, and CloudWatch Monitoring
|
|
16
|
+
|
|
17
|
+
Shows how to configure concurrency limits, dead letter queues, provisioned concurrency, and CloudWatch alarms for a production Lambda deployment.
|
|
18
|
+
|
|
19
|
+
## Code
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
# ci/template.yaml — scaling and monitoring additions
|
|
23
|
+
AWSTemplateFormatVersion: '2010-09-09'
|
|
24
|
+
Transform: AWS::Serverless-2016-10-31
|
|
25
|
+
|
|
26
|
+
Resources:
|
|
27
|
+
McpFunction:
|
|
28
|
+
Type: AWS::Serverless::Function
|
|
29
|
+
Properties:
|
|
30
|
+
Handler: dist/lambda.handler
|
|
31
|
+
CodeUri: .
|
|
32
|
+
Runtime: nodejs20.x
|
|
33
|
+
Timeout: 30
|
|
34
|
+
MemorySize: 512
|
|
35
|
+
# Reserved concurrency prevents downstream overload
|
|
36
|
+
ReservedConcurrentExecutions: 100
|
|
37
|
+
# Provisioned concurrency for latency-sensitive endpoints
|
|
38
|
+
AutoPublishAlias: live
|
|
39
|
+
ProvisionedConcurrencyConfig:
|
|
40
|
+
ProvisionedConcurrentExecutions: 5
|
|
41
|
+
# Dead letter queue for failed invocations
|
|
42
|
+
DeadLetterQueue:
|
|
43
|
+
Type: SQS
|
|
44
|
+
TargetArn: !GetAtt DeadLetterQueue.Arn
|
|
45
|
+
Environment:
|
|
46
|
+
Variables:
|
|
47
|
+
NODE_ENV: production
|
|
48
|
+
SECRETS_PATH: /mcp/production/
|
|
49
|
+
|
|
50
|
+
DeadLetterQueue:
|
|
51
|
+
Type: AWS::SQS::Queue
|
|
52
|
+
Properties:
|
|
53
|
+
QueueName: mcp-dlq
|
|
54
|
+
MessageRetentionPeriod: 1209600 # 14 days
|
|
55
|
+
|
|
56
|
+
# CloudWatch alarm: error rate
|
|
57
|
+
ErrorAlarm:
|
|
58
|
+
Type: AWS::CloudWatch::Alarm
|
|
59
|
+
Properties:
|
|
60
|
+
AlarmName: mcp-lambda-errors
|
|
61
|
+
MetricName: Errors
|
|
62
|
+
Namespace: AWS/Lambda
|
|
63
|
+
Statistic: Sum
|
|
64
|
+
Period: 300
|
|
65
|
+
EvaluationPeriods: 1
|
|
66
|
+
Threshold: 5
|
|
67
|
+
ComparisonOperator: GreaterThanThreshold
|
|
68
|
+
Dimensions:
|
|
69
|
+
- Name: FunctionName
|
|
70
|
+
Value: !Ref McpFunction
|
|
71
|
+
|
|
72
|
+
# CloudWatch alarm: throttling
|
|
73
|
+
ThrottleAlarm:
|
|
74
|
+
Type: AWS::CloudWatch::Alarm
|
|
75
|
+
Properties:
|
|
76
|
+
AlarmName: mcp-lambda-throttles
|
|
77
|
+
MetricName: Throttles
|
|
78
|
+
Namespace: AWS/Lambda
|
|
79
|
+
Statistic: Sum
|
|
80
|
+
Period: 300
|
|
81
|
+
EvaluationPeriods: 1
|
|
82
|
+
Threshold: 1
|
|
83
|
+
ComparisonOperator: GreaterThanThreshold
|
|
84
|
+
Dimensions:
|
|
85
|
+
- Name: FunctionName
|
|
86
|
+
Value: !Ref McpFunction
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
// src/providers/secrets.provider.ts
|
|
91
|
+
import { Provider, ProviderScope } from '@frontmcp/sdk';
|
|
92
|
+
|
|
93
|
+
export const SECRETS = Symbol('Secrets');
|
|
94
|
+
|
|
95
|
+
@Provider({ token: SECRETS, scope: ProviderScope.GLOBAL })
|
|
96
|
+
export class SecretsProvider {
|
|
97
|
+
private cache = new Map<string, string>();
|
|
98
|
+
|
|
99
|
+
async onInit(): Promise<void> {
|
|
100
|
+
// Load secrets from AWS SSM Parameter Store (not env vars for sensitive data)
|
|
101
|
+
const { SSMClient, GetParametersByPathCommand } = await import('@aws-sdk/client-ssm');
|
|
102
|
+
const ssm = new SSMClient({});
|
|
103
|
+
const path = process.env.SECRETS_PATH ?? '/mcp/production/';
|
|
104
|
+
|
|
105
|
+
const result = await ssm.send(
|
|
106
|
+
new GetParametersByPathCommand({
|
|
107
|
+
Path: path,
|
|
108
|
+
WithDecryption: true,
|
|
109
|
+
}),
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
for (const param of result.Parameters ?? []) {
|
|
113
|
+
const key = param.Name?.replace(path, '') ?? '';
|
|
114
|
+
this.cache.set(key, param.Value ?? '');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
get(key: string): string {
|
|
119
|
+
const value = this.cache.get(key);
|
|
120
|
+
if (!value) {
|
|
121
|
+
throw new Error(`Secret not found: ${key}`);
|
|
122
|
+
}
|
|
123
|
+
return value;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## What This Demonstrates
|
|
129
|
+
|
|
130
|
+
- Reserved concurrency to prevent downstream service overload
|
|
131
|
+
- Provisioned concurrency for latency-sensitive endpoints (reduces cold starts)
|
|
132
|
+
- Dead letter queue (DLQ) for capturing failed invocations
|
|
133
|
+
- CloudWatch alarms for error rate and throttling detection
|
|
134
|
+
- Loading secrets from AWS SSM Parameter Store instead of environment variables
|
|
135
|
+
|
|
136
|
+
## Related
|
|
137
|
+
|
|
138
|
+
- See `production-lambda` for the full CI/CD and scaling checklist
|