@frontmcp/skills 1.0.0-beta.9 → 1.0.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/README.md +2 -2
- package/catalog/TEMPLATE.md +69 -0
- package/catalog/frontmcp-config/SKILL.md +38 -22
- 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 +15 -0
- package/catalog/frontmcp-config/references/configure-auth.md +15 -0
- package/catalog/frontmcp-config/references/configure-elicitation.md +14 -0
- package/catalog/frontmcp-config/references/configure-http.md +15 -0
- package/catalog/frontmcp-config/references/configure-session.md +15 -0
- package/catalog/frontmcp-config/references/configure-throttle-guard-config.md +14 -0
- package/catalog/frontmcp-config/references/configure-throttle.md +15 -0
- package/catalog/frontmcp-config/references/configure-transport-protocol-presets.md +14 -0
- package/catalog/frontmcp-config/references/configure-transport.md +15 -0
- package/catalog/frontmcp-config/references/setup-redis.md +10 -0
- package/catalog/frontmcp-config/references/setup-sqlite.md +10 -0
- package/catalog/frontmcp-deployment/SKILL.md +40 -12
- 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 +15 -0
- package/catalog/frontmcp-deployment/references/build-for-cli.md +65 -3
- package/catalog/frontmcp-deployment/references/build-for-sdk.md +15 -0
- package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +15 -0
- package/catalog/frontmcp-deployment/references/deploy-to-lambda.md +18 -3
- package/catalog/frontmcp-deployment/references/deploy-to-node-dockerfile.md +16 -2
- package/catalog/frontmcp-deployment/references/deploy-to-node.md +19 -4
- package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +14 -0
- package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +15 -0
- package/catalog/frontmcp-development/SKILL.md +25 -17
- 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 +14 -0
- package/catalog/frontmcp-development/references/create-agent-llm-config.md +14 -0
- package/catalog/frontmcp-development/references/create-agent.md +15 -0
- package/catalog/frontmcp-development/references/create-job.md +15 -0
- package/catalog/frontmcp-development/references/create-plugin-hooks.md +51 -0
- package/catalog/frontmcp-development/references/create-plugin.md +186 -11
- package/catalog/frontmcp-development/references/create-prompt.md +17 -0
- package/catalog/frontmcp-development/references/create-provider.md +14 -0
- package/catalog/frontmcp-development/references/create-resource.md +127 -0
- package/catalog/frontmcp-development/references/create-skill-with-tools.md +126 -7
- package/catalog/frontmcp-development/references/create-skill.md +57 -12
- package/catalog/frontmcp-development/references/create-tool-annotations.md +14 -0
- package/catalog/frontmcp-development/references/create-tool-output-schema-types.md +15 -0
- package/catalog/frontmcp-development/references/create-tool.md +205 -1
- package/catalog/frontmcp-development/references/create-workflow.md +15 -0
- package/catalog/frontmcp-development/references/decorators-guide.md +155 -78
- package/catalog/frontmcp-development/references/official-adapters.md +31 -16
- package/catalog/frontmcp-development/references/official-plugins.md +62 -28
- package/catalog/frontmcp-extensibility/SKILL.md +103 -0
- 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 +299 -0
- package/catalog/frontmcp-guides/SKILL.md +7 -4
- 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 +15 -0
- package/catalog/frontmcp-guides/references/example-task-manager.md +30 -21
- package/catalog/frontmcp-guides/references/example-weather-api.md +18 -6
- package/catalog/frontmcp-observability/SKILL.md +144 -0
- package/catalog/frontmcp-observability/examples/structured-logging/stdout-logging.md +71 -0
- package/catalog/frontmcp-observability/examples/structured-logging/winston-integration.md +70 -0
- package/catalog/frontmcp-observability/examples/telemetry-api/agent-nested-tracing.md +86 -0
- package/catalog/frontmcp-observability/examples/telemetry-api/plugin-telemetry.md +93 -0
- package/catalog/frontmcp-observability/examples/telemetry-api/tool-custom-spans.md +72 -0
- package/catalog/frontmcp-observability/examples/testing-observability/test-custom-spans.md +90 -0
- package/catalog/frontmcp-observability/examples/testing-observability/test-log-correlation.md +104 -0
- package/catalog/frontmcp-observability/examples/tracing-setup/basic-tracing.md +82 -0
- package/catalog/frontmcp-observability/examples/tracing-setup/production-tracing.md +73 -0
- package/catalog/frontmcp-observability/examples/vendor-integrations/coralogix-setup.md +74 -0
- package/catalog/frontmcp-observability/references/structured-logging.md +114 -0
- package/catalog/frontmcp-observability/references/telemetry-api.md +155 -0
- package/catalog/frontmcp-observability/references/testing-observability.md +169 -0
- package/catalog/frontmcp-observability/references/tracing-setup.md +146 -0
- package/catalog/frontmcp-observability/references/vendor-integrations.md +164 -0
- package/catalog/frontmcp-production-readiness/SKILL.md +99 -0
- 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/health-readiness-endpoints/basic-health-setup.md +81 -0
- package/catalog/frontmcp-production-readiness/examples/health-readiness-endpoints/custom-probes.md +136 -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 +175 -0
- package/catalog/frontmcp-production-readiness/references/health-readiness-endpoints.md +198 -0
- package/catalog/frontmcp-production-readiness/references/production-browser.md +56 -0
- package/catalog/frontmcp-production-readiness/references/production-cli-binary.md +71 -0
- package/catalog/frontmcp-production-readiness/references/production-cli-daemon.md +71 -0
- package/catalog/frontmcp-production-readiness/references/production-cloudflare.md +62 -0
- package/catalog/frontmcp-production-readiness/references/production-lambda.md +63 -0
- package/catalog/frontmcp-production-readiness/references/production-node-sdk.md +76 -0
- package/catalog/frontmcp-production-readiness/references/production-node-server.md +71 -0
- package/catalog/frontmcp-production-readiness/references/production-vercel.md +62 -0
- package/catalog/frontmcp-setup/SKILL.md +19 -14
- 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 +33 -9
- package/catalog/frontmcp-setup/references/multi-app-composition.md +15 -0
- package/catalog/frontmcp-setup/references/nx-workflow.md +15 -0
- package/catalog/frontmcp-setup/references/project-structure-nx.md +15 -0
- package/catalog/frontmcp-setup/references/project-structure-standalone.md +15 -0
- package/catalog/frontmcp-setup/references/readme-guide.md +235 -0
- package/catalog/frontmcp-setup/references/setup-project.md +16 -1
- package/catalog/frontmcp-setup/references/setup-redis.md +15 -0
- package/catalog/frontmcp-setup/references/setup-sqlite.md +15 -0
- package/catalog/frontmcp-testing/SKILL.md +41 -27
- 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 +17 -0
- package/catalog/frontmcp-testing/references/test-auth.md +15 -0
- package/catalog/frontmcp-testing/references/test-browser-build.md +14 -0
- package/catalog/frontmcp-testing/references/test-cli-binary.md +14 -0
- package/catalog/frontmcp-testing/references/test-direct-client.md +14 -0
- package/catalog/frontmcp-testing/references/test-e2e-handler.md +15 -0
- package/catalog/frontmcp-testing/references/test-tool-unit.md +15 -0
- package/catalog/skills-manifest.json +2849 -32
- package/package.json +2 -2
- package/src/index.d.ts +1 -1
- package/src/index.js.map +1 -1
- package/src/loader.js +0 -1
- package/src/loader.js.map +1 -1
- package/src/manifest.d.ts +36 -1
- package/src/manifest.js +6 -1
- package/src/manifest.js.map +1 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tfidf-keyword-search
|
|
3
|
+
reference: vectoriadb
|
|
4
|
+
level: basic
|
|
5
|
+
description: 'Shows how to use `TFIDFVectoria` for zero-dependency keyword search in a FrontMCP provider, with field weights and index building.'
|
|
6
|
+
tags: [extensibility, vectoriadb, keyword-search, tfidf, keyword, search]
|
|
7
|
+
features:
|
|
8
|
+
- 'Using `TFIDFVectoria` for zero-dependency keyword search (no model downloads)'
|
|
9
|
+
- 'Configuring field weights to control scoring influence'
|
|
10
|
+
- 'Calling `buildIndex()` after adding documents (required for TFIDFVectoria)'
|
|
11
|
+
- 'Wrapping the search engine in a FrontMCP provider with `ProviderScope.GLOBAL`'
|
|
12
|
+
- 'Injecting the provider into tools via `this.get(FAQSearch)`'
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# TFIDFVectoria: Lightweight Keyword Search Provider
|
|
16
|
+
|
|
17
|
+
Shows how to use `TFIDFVectoria` for zero-dependency keyword search in a FrontMCP provider, with field weights and index building.
|
|
18
|
+
|
|
19
|
+
## Code
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
// src/providers/faq-search.provider.ts
|
|
23
|
+
import { Provider, ProviderScope } from '@frontmcp/sdk';
|
|
24
|
+
import { TFIDFVectoria } from 'vectoriadb';
|
|
25
|
+
|
|
26
|
+
export const FAQSearch = Symbol('FAQSearch');
|
|
27
|
+
|
|
28
|
+
@Provider({ name: 'faq-search', provide: FAQSearch, scope: ProviderScope.GLOBAL })
|
|
29
|
+
export class FAQSearchProvider {
|
|
30
|
+
private db = new TFIDFVectoria({
|
|
31
|
+
fields: {
|
|
32
|
+
question: { weight: 3 }, // Question matches are 3x more important
|
|
33
|
+
answer: { weight: 1 }, // Answer matches are baseline
|
|
34
|
+
tags: { weight: 2 }, // Tag matches are 2x
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
async initialize(faqs: Array<{ id: string; question: string; answer: string; tags: string }>) {
|
|
39
|
+
for (const faq of faqs) {
|
|
40
|
+
this.db.addDocument(faq.id, {
|
|
41
|
+
question: faq.question,
|
|
42
|
+
answer: faq.answer,
|
|
43
|
+
tags: faq.tags,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
// Required after adding documents — builds the TF-IDF index
|
|
47
|
+
this.db.buildIndex();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
search(query: string, limit = 5) {
|
|
51
|
+
return this.db.search(query, limit);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
// src/tools/search-faq.tool.ts
|
|
58
|
+
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
59
|
+
import { z } from 'zod';
|
|
60
|
+
import { FAQSearch } from '../providers/faq-search.provider';
|
|
61
|
+
|
|
62
|
+
@Tool({
|
|
63
|
+
name: 'search_faq',
|
|
64
|
+
description: 'Search the FAQ knowledge base using keyword matching',
|
|
65
|
+
inputSchema: {
|
|
66
|
+
query: z.string().min(1).describe('Search query'),
|
|
67
|
+
limit: z.number().int().min(1).max(20).default(5).describe('Max results'),
|
|
68
|
+
},
|
|
69
|
+
outputSchema: {
|
|
70
|
+
results: z.array(
|
|
71
|
+
z.object({
|
|
72
|
+
id: z.string(),
|
|
73
|
+
score: z.number(),
|
|
74
|
+
}),
|
|
75
|
+
),
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
export class SearchFaqTool extends ToolContext {
|
|
79
|
+
async execute(input: { query: string; limit: number }) {
|
|
80
|
+
const faqSearch = this.get(FAQSearch);
|
|
81
|
+
const results = faqSearch.search(input.query, input.limit);
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
results: results.map((r) => ({
|
|
85
|
+
id: r.id,
|
|
86
|
+
score: r.score,
|
|
87
|
+
})),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## What This Demonstrates
|
|
94
|
+
|
|
95
|
+
- Using `TFIDFVectoria` for zero-dependency keyword search (no model downloads)
|
|
96
|
+
- Configuring field weights to control scoring influence
|
|
97
|
+
- Calling `buildIndex()` after adding documents (required for TFIDFVectoria)
|
|
98
|
+
- Wrapping the search engine in a FrontMCP provider with `ProviderScope.GLOBAL`
|
|
99
|
+
- Injecting the provider into tools via `this.get(FAQSearch)`
|
|
100
|
+
|
|
101
|
+
## Related
|
|
102
|
+
|
|
103
|
+
- See `vectoriadb` for the full API reference and engine comparison
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vectoriadb
|
|
3
|
+
description: Use VectoriaDB for in-memory vector search with ML-based or TF-IDF engines in FrontMCP servers
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# VectoriaDB Integration
|
|
7
|
+
|
|
8
|
+
Use VectoriaDB for in-memory vector search in FrontMCP servers. Two engines are available:
|
|
9
|
+
|
|
10
|
+
- **VectoriaDB** — ML-based semantic search using transformer models. Best for understanding meaning ("find users" matches "list accounts").
|
|
11
|
+
- **TFIDFVectoria** — Zero-dependency keyword search using TF-IDF scoring. Best for exact/fuzzy keyword matching with no model downloads.
|
|
12
|
+
|
|
13
|
+
Both are included in the `vectoriadb` package (already a FrontMCP dependency).
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
| Engine | Use When | Dependencies | Init |
|
|
18
|
+
| --------------- | ----------------------------------------------------------------- | --------------- | ------------------------------------ |
|
|
19
|
+
| `TFIDFVectoria` | Keyword matching, zero deps, no network, small corpus (<10K docs) | None | Synchronous |
|
|
20
|
+
| `VectoriaDB` | Semantic understanding, similarity matching, large corpus | transformers.js | Async (downloads model on first run) |
|
|
21
|
+
|
|
22
|
+
## TFIDFVectoria — Lightweight Keyword Search
|
|
23
|
+
|
|
24
|
+
Zero dependencies, synchronous initialization. Good for tool discovery, FAQ matching, and simple search features.
|
|
25
|
+
|
|
26
|
+
### Basic Usage
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { TFIDFVectoria } from 'vectoriadb';
|
|
30
|
+
|
|
31
|
+
const db = new TFIDFVectoria({
|
|
32
|
+
defaultSimilarityThreshold: 0.0,
|
|
33
|
+
defaultTopK: 10,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Add documents (id, text)
|
|
37
|
+
db.addDocument('users-list', 'List all users with pagination and filtering');
|
|
38
|
+
db.addDocument('users-create', 'Create a new user account with email and password');
|
|
39
|
+
db.addDocument('orders-list', 'List orders for a customer with date range filters');
|
|
40
|
+
|
|
41
|
+
// Build the index (required after adding documents)
|
|
42
|
+
db.buildIndex();
|
|
43
|
+
|
|
44
|
+
// Search
|
|
45
|
+
const results = db.search('find users', 5);
|
|
46
|
+
// results: [{ id: 'users-list', score: 0.82 }, { id: 'users-create', score: 0.65 }]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### With Field Weights
|
|
50
|
+
|
|
51
|
+
Weight different fields to control scoring influence:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
const db = new TFIDFVectoria({
|
|
55
|
+
fields: {
|
|
56
|
+
name: { weight: 3 }, // Name matches are 3x more important
|
|
57
|
+
description: { weight: 2 }, // Description matches are 2x
|
|
58
|
+
tags: { weight: 1 }, // Tags are baseline
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
db.addDocument('weather-tool', {
|
|
63
|
+
name: 'get_weather',
|
|
64
|
+
description: 'Fetch current weather conditions for a city',
|
|
65
|
+
tags: 'weather forecast temperature',
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
db.buildIndex();
|
|
69
|
+
const results = db.search('temperature forecast', 5);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### FrontMCP Provider Pattern
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import { Provider, ProviderScope } from '@frontmcp/sdk';
|
|
76
|
+
import { TFIDFVectoria } from 'vectoriadb';
|
|
77
|
+
|
|
78
|
+
export const FAQSearch = Symbol('FAQSearch');
|
|
79
|
+
|
|
80
|
+
@Provider({ name: 'faq-search', provide: FAQSearch, scope: ProviderScope.GLOBAL })
|
|
81
|
+
export class FAQSearchProvider {
|
|
82
|
+
private db = new TFIDFVectoria({
|
|
83
|
+
fields: {
|
|
84
|
+
question: { weight: 3 },
|
|
85
|
+
answer: { weight: 1 },
|
|
86
|
+
tags: { weight: 2 },
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
async initialize(faqs: Array<{ id: string; question: string; answer: string; tags: string }>) {
|
|
91
|
+
for (const faq of faqs) {
|
|
92
|
+
this.db.addDocument(faq.id, {
|
|
93
|
+
question: faq.question,
|
|
94
|
+
answer: faq.answer,
|
|
95
|
+
tags: faq.tags,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
this.db.buildIndex();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
search(query: string, limit = 5) {
|
|
102
|
+
return this.db.search(query, limit);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## VectoriaDB — Semantic ML Search
|
|
108
|
+
|
|
109
|
+
Uses transformer models for true semantic understanding. "find users" matches "list accounts" even without shared keywords.
|
|
110
|
+
|
|
111
|
+
### Basic Usage
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
import { VectoriaDB, DocumentMetadata } from 'vectoriadb';
|
|
115
|
+
|
|
116
|
+
interface ProductDoc extends DocumentMetadata {
|
|
117
|
+
name: string;
|
|
118
|
+
category: string;
|
|
119
|
+
price: number;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const db = new VectoriaDB<ProductDoc>({
|
|
123
|
+
modelName: 'Xenova/all-MiniLM-L6-v2', // Default model
|
|
124
|
+
cacheDir: './.cache/transformers', // Model cache
|
|
125
|
+
defaultSimilarityThreshold: 0.4,
|
|
126
|
+
defaultTopK: 10,
|
|
127
|
+
useHNSW: true, // Enable HNSW for fast search on large datasets
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// Must initialize before use (downloads model on first run)
|
|
131
|
+
await db.initialize();
|
|
132
|
+
|
|
133
|
+
// Add documents
|
|
134
|
+
await db.add('prod-1', 'Wireless noise-canceling headphones with 30h battery', {
|
|
135
|
+
id: 'prod-1',
|
|
136
|
+
name: 'QuietComfort Ultra',
|
|
137
|
+
category: 'audio',
|
|
138
|
+
price: 349,
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// Semantic search — understands meaning, not just keywords
|
|
142
|
+
const results = await db.search('something to block office noise', {
|
|
143
|
+
topK: 5,
|
|
144
|
+
threshold: 0.4,
|
|
145
|
+
});
|
|
146
|
+
// results[0].metadata.name === 'QuietComfort Ultra' (semantic match!)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Batch Operations
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
await db.addMany([
|
|
153
|
+
{
|
|
154
|
+
id: 'doc-1',
|
|
155
|
+
text: 'First document content',
|
|
156
|
+
metadata: {
|
|
157
|
+
/* ... */
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'doc-2',
|
|
162
|
+
text: 'Second document content',
|
|
163
|
+
metadata: {
|
|
164
|
+
/* ... */
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
]);
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Filtered Search
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
const results = await db.search('wireless audio', {
|
|
174
|
+
topK: 5,
|
|
175
|
+
filter: (meta) => meta.category === 'audio' && meta.price < 300,
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Persistence with Storage Adapters
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
import { VectoriaDB, FileStorageAdapter } from 'vectoriadb';
|
|
183
|
+
|
|
184
|
+
const db = new VectoriaDB<MyDoc>({
|
|
185
|
+
storageAdapter: new FileStorageAdapter({ cacheDir: './.cache/vectors' }),
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
await db.initialize();
|
|
189
|
+
// After adding documents, persist to disk
|
|
190
|
+
await db.saveToStorage();
|
|
191
|
+
// On next startup, restores without re-embedding
|
|
192
|
+
await db.loadFromStorage();
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### FrontMCP Provider Pattern
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
import { Provider, ProviderScope } from '@frontmcp/sdk';
|
|
199
|
+
import { VectoriaDB, FileStorageAdapter } from 'vectoriadb';
|
|
200
|
+
import type { DocumentMetadata } from 'vectoriadb';
|
|
201
|
+
|
|
202
|
+
export const KnowledgeBase = Symbol('KnowledgeBase');
|
|
203
|
+
|
|
204
|
+
interface Article extends DocumentMetadata {
|
|
205
|
+
title: string;
|
|
206
|
+
category: string;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@Provider({ name: 'knowledge-base', provide: KnowledgeBase, scope: ProviderScope.GLOBAL })
|
|
210
|
+
export class KnowledgeBaseProvider {
|
|
211
|
+
private db: VectoriaDB<Article>;
|
|
212
|
+
private ready: Promise<void>;
|
|
213
|
+
|
|
214
|
+
constructor() {
|
|
215
|
+
this.db = new VectoriaDB<Article>({
|
|
216
|
+
useHNSW: true,
|
|
217
|
+
storageAdapter: new FileStorageAdapter({ cacheDir: './.cache/kb-vectors' }),
|
|
218
|
+
});
|
|
219
|
+
this.ready = this.db.initialize();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
async search(query: string, options?: { category?: string; limit?: number }) {
|
|
223
|
+
await this.ready;
|
|
224
|
+
return this.db.search(query, {
|
|
225
|
+
topK: options?.limit ?? 10,
|
|
226
|
+
filter: options?.category ? (m) => m.category === options.category : undefined,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
async index(id: string, text: string, metadata: Article) {
|
|
231
|
+
await this.ready;
|
|
232
|
+
if (this.db.has(id)) {
|
|
233
|
+
await this.db.update(id, { text, metadata });
|
|
234
|
+
} else {
|
|
235
|
+
await this.db.add(id, text, metadata);
|
|
236
|
+
}
|
|
237
|
+
await this.db.saveToStorage();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Configuration Reference
|
|
243
|
+
|
|
244
|
+
### VectoriaDB Options
|
|
245
|
+
|
|
246
|
+
| Option | Type | Default | Description |
|
|
247
|
+
| ---------------------------- | -------------- | --------------------------- | ---------------------------------------- |
|
|
248
|
+
| `modelName` | string | `'Xenova/all-MiniLM-L6-v2'` | Transformer model for embeddings |
|
|
249
|
+
| `cacheDir` | string | `'./.cache/transformers'` | Model download cache directory |
|
|
250
|
+
| `defaultSimilarityThreshold` | number | `0.3` | Minimum similarity score (0-1) |
|
|
251
|
+
| `defaultTopK` | number | `10` | Default results limit |
|
|
252
|
+
| `useHNSW` | boolean | `false` | Enable HNSW index for O(log n) search |
|
|
253
|
+
| `maxDocuments` | number | `100000` | Max documents (DoS protection) |
|
|
254
|
+
| `storageAdapter` | StorageAdapter | None | Persistence adapter (FileStorageAdapter) |
|
|
255
|
+
|
|
256
|
+
### TFIDFVectoria Options
|
|
257
|
+
|
|
258
|
+
| Option | Type | Default | Description |
|
|
259
|
+
| ---------------------------- | -------------------------- | ------- | ------------------------ |
|
|
260
|
+
| `defaultSimilarityThreshold` | number | `0.0` | Minimum similarity score |
|
|
261
|
+
| `defaultTopK` | number | `10` | Default results limit |
|
|
262
|
+
| `fields` | Record<string, { weight }> | None | Field-weighted indexing |
|
|
263
|
+
|
|
264
|
+
## Choosing Between Engines
|
|
265
|
+
|
|
266
|
+
| Criterion | TFIDFVectoria | VectoriaDB |
|
|
267
|
+
| ------------------ | ------------------------------ | ----------------------------------------- |
|
|
268
|
+
| **Dependencies** | Zero | transformers.js (~50MB model) |
|
|
269
|
+
| **Initialization** | Synchronous, instant | Async, first-run model download |
|
|
270
|
+
| **Search quality** | Keyword-based (exact/fuzzy) | Semantic (understands meaning) |
|
|
271
|
+
| **Best for** | Tool discovery, FAQ, <10K docs | Knowledge base, recommendations, any size |
|
|
272
|
+
| **Reindex needed** | Yes (`buildIndex()` after add) | No (auto-indexed on add) |
|
|
273
|
+
| **Persistence** | Not built-in | FileStorageAdapter |
|
|
274
|
+
|
|
275
|
+
## Verification Checklist
|
|
276
|
+
|
|
277
|
+
- [ ] Correct engine chosen based on requirements (TFIDFVectoria vs VectoriaDB)
|
|
278
|
+
- [ ] Provider wraps the database with proper initialization
|
|
279
|
+
- [ ] `buildIndex()` called after adding documents (TFIDFVectoria only)
|
|
280
|
+
- [ ] `await db.initialize()` called before any operations (VectoriaDB only)
|
|
281
|
+
- [ ] Field weights configured based on domain relevance
|
|
282
|
+
- [ ] Storage adapter configured if persistence is needed
|
|
283
|
+
- [ ] Search tool injects provider via `this.get(TOKEN)`
|
|
284
|
+
|
|
285
|
+
## Examples
|
|
286
|
+
|
|
287
|
+
| Example | Level | Description |
|
|
288
|
+
| ------------------------------------------------------------------------------------------------ | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
289
|
+
| [`product-catalog-search`](../examples/vectoriadb/product-catalog-search.md) | Advanced | Shows advanced VectoriaDB usage with typed document metadata, batch operations, filtered search by multiple criteria, and batch indexing of a product catalog. |
|
|
290
|
+
| [`semantic-search-with-persistence`](../examples/vectoriadb/semantic-search-with-persistence.md) | Intermediate | Shows how to use `VectoriaDB` for semantic search with transformer models, filtered search, and `FileStorageAdapter` for persistence across restarts. |
|
|
291
|
+
| [`tfidf-keyword-search`](../examples/vectoriadb/tfidf-keyword-search.md) | Basic | Shows how to use `TFIDFVectoria` for zero-dependency keyword search in a FrontMCP provider, with field weights and index building. |
|
|
292
|
+
|
|
293
|
+
> See all examples in [`examples/vectoriadb/`](../examples/vectoriadb/)
|
|
294
|
+
|
|
295
|
+
## Reference
|
|
296
|
+
|
|
297
|
+
- [VectoriaDB Documentation](https://docs.agentfront.dev/vectoriadb/get-started/welcome)
|
|
298
|
+
- [TFIDFVectoria API](https://docs.agentfront.dev/vectoriadb/api-reference/tfidf-vectoria/constructor)
|
|
299
|
+
- Related skills: `create-provider`, `create-tool`, `frontmcp-development`
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: frontmcp-guides
|
|
3
|
-
description: '
|
|
3
|
+
description: 'Tutorials, walkthroughs, and end-to-end examples for building FrontMCP servers. Use when you want a getting started guide, how to build a complete project, learn best practices, or follow a step-by-step example. Triggers: tutorial, walkthrough, how to build, getting started, learn FrontMCP.'
|
|
4
4
|
tags: [guides, examples, best-practices, architecture, walkthrough, end-to-end]
|
|
5
|
+
category: guides
|
|
6
|
+
targets: [all]
|
|
7
|
+
bundle: [recommended, full]
|
|
5
8
|
priority: 10
|
|
6
9
|
visibility: both
|
|
7
10
|
license: Apache-2.0
|
|
8
11
|
metadata:
|
|
9
|
-
docs: https://docs.agentfront.dev/frontmcp/guides/
|
|
12
|
+
docs: https://docs.agentfront.dev/frontmcp/guides/your-first-tool
|
|
10
13
|
examples:
|
|
11
14
|
- scenario: Build a simple weather API MCP server from scratch
|
|
12
15
|
expected-outcome: Working server with tools, resources, and tests deployed to Node
|
|
@@ -44,7 +47,7 @@ Complete build walkthroughs and best practices for FrontMCP servers. Each exampl
|
|
|
44
47
|
|
|
45
48
|
## Prerequisites
|
|
46
49
|
|
|
47
|
-
- Node.js
|
|
50
|
+
- Node.js 24+ and npm/yarn installed
|
|
48
51
|
- Familiarity with TypeScript and decorators
|
|
49
52
|
- `frontmcp` CLI available globally (`npm install -g frontmcp`)
|
|
50
53
|
|
|
@@ -412,6 +415,6 @@ export class ResearcherAgent extends AgentContext {
|
|
|
412
415
|
|
|
413
416
|
## Reference
|
|
414
417
|
|
|
415
|
-
- [
|
|
418
|
+
- [Your First Tool](https://docs.agentfront.dev/frontmcp/guides/your-first-tool)
|
|
416
419
|
- Domain routers: `frontmcp-development`, `frontmcp-deployment`, `frontmcp-testing`, `frontmcp-config`
|
|
417
420
|
- Core skills: `setup-project`, `create-tool`, `create-resource`, `create-provider`, `create-agent`, `configure-auth`, `setup-testing`
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-and-plugin
|
|
3
|
+
reference: example-knowledge-base
|
|
4
|
+
level: advanced
|
|
5
|
+
description: 'Shows an autonomous research agent with inner tools and configurable depth, and a plugin that hooks into tool execution for audit logging.'
|
|
6
|
+
tags: [guides, knowledge-base, knowledge, base, agent, plugin]
|
|
7
|
+
features:
|
|
8
|
+
- 'Agent with `@Agent` decorator, LLM config, inner tools, and system instructions'
|
|
9
|
+
- 'Using `this.run(prompt, { maxIterations })` to execute the LLM tool-use loop'
|
|
10
|
+
- "Configurable behavior via input schema (`depth: 'shallow' | 'deep'`)"
|
|
11
|
+
- 'Plugin hooks: `onToolExecuteBefore`, `onToolExecuteAfter`, `onToolExecuteError`'
|
|
12
|
+
- 'Using `ctx.state.set/get()` for flow state instead of mutating `rawInput`'
|
|
13
|
+
- 'Non-blocking audit logging (`.catch()` prevents audit failures from breaking tools)'
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Knowledge Base: Research Agent and Audit Log Plugin
|
|
17
|
+
|
|
18
|
+
Shows an autonomous research agent with inner tools and configurable depth, and a plugin that hooks into tool execution for audit logging.
|
|
19
|
+
|
|
20
|
+
## Code
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
// src/research/agents/researcher.agent.ts
|
|
24
|
+
import { Agent, AgentContext } from '@frontmcp/sdk';
|
|
25
|
+
import { z } from 'zod';
|
|
26
|
+
import { SearchDocsTool } from '../../search/tools/search-docs.tool';
|
|
27
|
+
import { IngestDocumentTool } from '../../ingestion/tools/ingest-document.tool';
|
|
28
|
+
|
|
29
|
+
@Agent({
|
|
30
|
+
name: 'research_topic',
|
|
31
|
+
description: 'Research a topic across the knowledge base and synthesize findings into a structured report',
|
|
32
|
+
inputSchema: {
|
|
33
|
+
topic: z.string().min(1).describe('Research topic or question'),
|
|
34
|
+
depth: z.enum(['shallow', 'deep']).default('shallow').describe('Research depth'),
|
|
35
|
+
},
|
|
36
|
+
outputSchema: {
|
|
37
|
+
topic: z.string(),
|
|
38
|
+
summary: z.string(),
|
|
39
|
+
sources: z.array(
|
|
40
|
+
z.object({
|
|
41
|
+
documentId: z.string(),
|
|
42
|
+
title: z.string(),
|
|
43
|
+
relevance: z.string(),
|
|
44
|
+
}),
|
|
45
|
+
),
|
|
46
|
+
confidence: z.enum(['low', 'medium', 'high']),
|
|
47
|
+
},
|
|
48
|
+
llm: {
|
|
49
|
+
provider: 'anthropic',
|
|
50
|
+
model: 'claude-sonnet-4-20250514',
|
|
51
|
+
apiKey: { env: 'ANTHROPIC_API_KEY' },
|
|
52
|
+
maxTokens: 4096,
|
|
53
|
+
},
|
|
54
|
+
// Inner tools: the agent can call these during its execution
|
|
55
|
+
tools: [SearchDocsTool, IngestDocumentTool],
|
|
56
|
+
systemInstructions: `You are a research assistant with access to a knowledge base.
|
|
57
|
+
Your job is to:
|
|
58
|
+
1. Search the knowledge base for relevant documents using the search_docs tool.
|
|
59
|
+
2. Analyze the results and identify key themes.
|
|
60
|
+
3. If depth is "deep", perform multiple searches with refined queries.
|
|
61
|
+
4. Synthesize findings into a structured summary with source attribution.
|
|
62
|
+
Always cite which documents support your findings.`,
|
|
63
|
+
})
|
|
64
|
+
export class ResearcherAgent extends AgentContext {
|
|
65
|
+
async execute(input: { topic: string; depth: 'shallow' | 'deep' }) {
|
|
66
|
+
const maxIterations = input.depth === 'deep' ? 5 : 2;
|
|
67
|
+
const prompt = [
|
|
68
|
+
`Research the following topic: "${input.topic}"`,
|
|
69
|
+
`Depth: ${input.depth} (max ${maxIterations} search iterations)`,
|
|
70
|
+
'Search the knowledge base, analyze results, and produce a structured summary.',
|
|
71
|
+
'Return your findings as JSON matching the output schema.',
|
|
72
|
+
].join('\n');
|
|
73
|
+
|
|
74
|
+
// this.run() executes the LLM loop with inner tools
|
|
75
|
+
return this.run(prompt, { maxIterations });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
// src/plugins/audit-log.plugin.ts
|
|
82
|
+
import { Plugin } from '@frontmcp/sdk';
|
|
83
|
+
import type { PluginHookContext } from '@frontmcp/sdk';
|
|
84
|
+
|
|
85
|
+
@Plugin({
|
|
86
|
+
name: 'AuditLog',
|
|
87
|
+
description: 'Logs all tool invocations for audit compliance',
|
|
88
|
+
})
|
|
89
|
+
export class AuditLogPlugin {
|
|
90
|
+
private readonly logs: Array<{
|
|
91
|
+
timestamp: string;
|
|
92
|
+
tool: string;
|
|
93
|
+
userId: string | undefined;
|
|
94
|
+
duration: number;
|
|
95
|
+
success: boolean;
|
|
96
|
+
}> = [];
|
|
97
|
+
|
|
98
|
+
async onToolExecuteBefore(ctx: PluginHookContext): Promise<void> {
|
|
99
|
+
// Store start time in flow state (not in rawInput)
|
|
100
|
+
ctx.state.set('audit:startTime', Date.now());
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async onToolExecuteAfter(ctx: PluginHookContext): Promise<void> {
|
|
104
|
+
const startTime = ctx.state.get('audit:startTime') as number;
|
|
105
|
+
const duration = Date.now() - startTime;
|
|
106
|
+
|
|
107
|
+
const entry = {
|
|
108
|
+
timestamp: new Date().toISOString(),
|
|
109
|
+
tool: ctx.toolName,
|
|
110
|
+
userId: ctx.session?.userId,
|
|
111
|
+
duration,
|
|
112
|
+
success: true,
|
|
113
|
+
};
|
|
114
|
+
this.logs.push(entry);
|
|
115
|
+
|
|
116
|
+
// In production, send to an external logging service
|
|
117
|
+
if (process.env.AUDIT_LOG_ENDPOINT) {
|
|
118
|
+
await ctx
|
|
119
|
+
.fetch(process.env.AUDIT_LOG_ENDPOINT, {
|
|
120
|
+
method: 'POST',
|
|
121
|
+
headers: { 'Content-Type': 'application/json' },
|
|
122
|
+
body: JSON.stringify(entry),
|
|
123
|
+
})
|
|
124
|
+
.catch(() => {
|
|
125
|
+
// Audit logging should not block tool execution
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async onToolExecuteError(ctx: PluginHookContext): Promise<void> {
|
|
131
|
+
const startTime = ctx.state.get('audit:startTime') as number;
|
|
132
|
+
const duration = Date.now() - startTime;
|
|
133
|
+
|
|
134
|
+
this.logs.push({
|
|
135
|
+
timestamp: new Date().toISOString(),
|
|
136
|
+
tool: ctx.toolName,
|
|
137
|
+
userId: ctx.session?.userId,
|
|
138
|
+
duration,
|
|
139
|
+
success: false,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
getLogs(): typeof this.logs {
|
|
144
|
+
return [...this.logs];
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## What This Demonstrates
|
|
150
|
+
|
|
151
|
+
- Agent with `@Agent` decorator, LLM config, inner tools, and system instructions
|
|
152
|
+
- Using `this.run(prompt, { maxIterations })` to execute the LLM tool-use loop
|
|
153
|
+
- Configurable behavior via input schema (`depth: 'shallow' | 'deep'`)
|
|
154
|
+
- Plugin hooks: `onToolExecuteBefore`, `onToolExecuteAfter`, `onToolExecuteError`
|
|
155
|
+
- Using `ctx.state.set/get()` for flow state instead of mutating `rawInput`
|
|
156
|
+
- Non-blocking audit logging (`.catch()` prevents audit failures from breaking tools)
|
|
157
|
+
|
|
158
|
+
## Related
|
|
159
|
+
|
|
160
|
+
- See `example-knowledge-base` for the full knowledge base example with vector store and tests
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: multi-app-composition
|
|
3
|
+
reference: example-knowledge-base
|
|
4
|
+
level: basic
|
|
5
|
+
description: 'Shows how to compose multiple apps (Ingestion, Search, Research) into a single server with shared providers, plugins, and agent registration.'
|
|
6
|
+
tags: [guides, multi-app, knowledge-base, knowledge, base, multi]
|
|
7
|
+
features:
|
|
8
|
+
- 'Composing three apps into one server: Ingestion (tools + providers), Search (tools + resources), Research (agents)'
|
|
9
|
+
- 'Sharing providers across apps (VectorStoreProvider used by both Ingestion and Search)'
|
|
10
|
+
- 'Registering plugins at the server level (AuditLogPlugin applies to all tools)'
|
|
11
|
+
- 'Registering agents in a dedicated app for AI-powered features'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Knowledge Base: Multi-App Composition
|
|
15
|
+
|
|
16
|
+
Shows how to compose multiple apps (Ingestion, Search, Research) into a single server with shared providers, plugins, and agent registration.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// src/main.ts
|
|
22
|
+
import { FrontMcp } from '@frontmcp/sdk';
|
|
23
|
+
import { IngestionApp } from './ingestion/ingestion.app';
|
|
24
|
+
import { SearchApp } from './search/search.app';
|
|
25
|
+
import { ResearchApp } from './research/research.app';
|
|
26
|
+
import { AuditLogPlugin } from './plugins/audit-log.plugin';
|
|
27
|
+
|
|
28
|
+
@FrontMcp({
|
|
29
|
+
info: { name: 'knowledge-base', version: '1.0.0' },
|
|
30
|
+
apps: [IngestionApp, SearchApp, ResearchApp],
|
|
31
|
+
plugins: [AuditLogPlugin],
|
|
32
|
+
auth: { mode: 'remote', provider: 'https://auth.example.com', clientId: 'my-client-id' },
|
|
33
|
+
redis: { provider: 'redis', host: process.env.REDIS_URL ?? 'localhost' },
|
|
34
|
+
})
|
|
35
|
+
export default class KnowledgeBaseServer {}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
// src/ingestion/ingestion.app.ts
|
|
40
|
+
import { App } from '@frontmcp/sdk';
|
|
41
|
+
import { VectorStoreProvider } from './providers/vector-store.provider';
|
|
42
|
+
import { IngestDocumentTool } from './tools/ingest-document.tool';
|
|
43
|
+
|
|
44
|
+
@App({
|
|
45
|
+
name: 'Ingestion',
|
|
46
|
+
description: 'Document ingestion and chunking pipeline',
|
|
47
|
+
providers: [VectorStoreProvider],
|
|
48
|
+
tools: [IngestDocumentTool],
|
|
49
|
+
})
|
|
50
|
+
export class IngestionApp {}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
// src/search/search.app.ts
|
|
55
|
+
import { App } from '@frontmcp/sdk';
|
|
56
|
+
import { VectorStoreProvider } from '../ingestion/providers/vector-store.provider';
|
|
57
|
+
import { SearchDocsTool } from './tools/search-docs.tool';
|
|
58
|
+
import { DocResource } from './resources/doc.resource';
|
|
59
|
+
|
|
60
|
+
@App({
|
|
61
|
+
name: 'Search',
|
|
62
|
+
description: 'Semantic search and document retrieval',
|
|
63
|
+
providers: [VectorStoreProvider],
|
|
64
|
+
tools: [SearchDocsTool],
|
|
65
|
+
resources: [DocResource],
|
|
66
|
+
})
|
|
67
|
+
export class SearchApp {}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// src/research/research.app.ts
|
|
72
|
+
import { App } from '@frontmcp/sdk';
|
|
73
|
+
import { ResearcherAgent } from './agents/researcher.agent';
|
|
74
|
+
|
|
75
|
+
@App({
|
|
76
|
+
name: 'Research',
|
|
77
|
+
description: 'AI-powered research agent for knowledge synthesis',
|
|
78
|
+
agents: [ResearcherAgent],
|
|
79
|
+
})
|
|
80
|
+
export class ResearchApp {}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## What This Demonstrates
|
|
84
|
+
|
|
85
|
+
- Composing three apps into one server: Ingestion (tools + providers), Search (tools + resources), Research (agents)
|
|
86
|
+
- Sharing providers across apps (VectorStoreProvider used by both Ingestion and Search)
|
|
87
|
+
- Registering plugins at the server level (AuditLogPlugin applies to all tools)
|
|
88
|
+
- Registering agents in a dedicated app for AI-powered features
|
|
89
|
+
|
|
90
|
+
## Related
|
|
91
|
+
|
|
92
|
+
- See `example-knowledge-base` for the full knowledge base example with vector store, search, and agent code
|