@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,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: structured-logging
|
|
3
|
+
description: 'Add structured JSON logging with trace correlation and configurable sinks (stdout, winston, pino, OTLP).'
|
|
4
|
+
tags: [logging, structured, json, sinks, ndjson, winston, pino, redaction]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Structured Logging
|
|
8
|
+
|
|
9
|
+
Add structured JSON logging that enriches every log entry with `trace_id`, `span_id`, `request_id`, and `session_id_hash`. Logs flow through configurable sinks — stdout (NDJSON), winston, pino, OTLP, console, or custom callbacks.
|
|
10
|
+
|
|
11
|
+
## How It Works
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
this.logger.info('message', { userId: 123 })
|
|
15
|
+
│
|
|
16
|
+
├── ConsoleLogTransport (dev console — pretty colored output)
|
|
17
|
+
│
|
|
18
|
+
└── StructuredLogTransport (enriches with trace context)
|
|
19
|
+
├── StdoutSink → NDJSON to stdout (Docker/K8s collects)
|
|
20
|
+
├── OtlpSink → OTLP HTTP to Coralogix/Datadog/Logz.io
|
|
21
|
+
├── WinstonSink → forward to winston instance
|
|
22
|
+
├── PinoSink → forward to pino instance
|
|
23
|
+
└── CallbackSink → custom handler function
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Enable Structured Logging
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
@FrontMcp({
|
|
30
|
+
observability: {
|
|
31
|
+
tracing: true,
|
|
32
|
+
logging: true, // Default: StdoutSink (NDJSON)
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Log Entry Format
|
|
38
|
+
|
|
39
|
+
Every `this.logger.info()` call produces:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"timestamp": "2026-04-03T10:15:30.123Z",
|
|
44
|
+
"level": "info",
|
|
45
|
+
"severity_number": 9,
|
|
46
|
+
"message": "processing user request",
|
|
47
|
+
"trace_id": "abcdef1234567890abcdef1234567890",
|
|
48
|
+
"span_id": "1234567890abcdef",
|
|
49
|
+
"request_id": "req-uuid-001",
|
|
50
|
+
"session_id_hash": "a3f8b2c1d4e5f6a7",
|
|
51
|
+
"scope_id": "my-app",
|
|
52
|
+
"flow_name": "tools:call-tool",
|
|
53
|
+
"elapsed_ms": 42,
|
|
54
|
+
"prefix": "MyTool",
|
|
55
|
+
"attributes": { "userId": 123 }
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Configure Sinks
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
observability: {
|
|
63
|
+
logging: {
|
|
64
|
+
sinks: [
|
|
65
|
+
{ type: 'stdout' }, // NDJSON to stdout
|
|
66
|
+
{ type: 'console' }, // console.log (browser-safe)
|
|
67
|
+
{ type: 'otlp', endpoint: 'http://collector:4318' }, // OTLP to any backend
|
|
68
|
+
{ type: 'winston', logger: winstonInstance }, // Forward to winston
|
|
69
|
+
{ type: 'pino', logger: pinoInstance }, // Forward to pino
|
|
70
|
+
{ type: 'callback', fn: (entry) => queue.push(entry) },// Custom handler
|
|
71
|
+
],
|
|
72
|
+
redactFields: ['password', 'token', 'secret', 'authorization'],
|
|
73
|
+
includeStacks: process.env.NODE_ENV !== 'production',
|
|
74
|
+
staticFields: { service: 'my-server', env: 'production' },
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Sink Types
|
|
80
|
+
|
|
81
|
+
| Type | Output | Environment | Use Case |
|
|
82
|
+
| ---------- | ---------------------------- | ---------------- | ------------------------------------ |
|
|
83
|
+
| `stdout` | NDJSON to `process.stdout` | Node.js | 12-factor apps, Docker, K8s |
|
|
84
|
+
| `console` | `console.log/warn/error` | Browser, Node.js | Local dev, browser apps |
|
|
85
|
+
| `otlp` | OTLP HTTP POST to `/v1/logs` | Node.js | Coralogix, Datadog, Logz.io, Grafana |
|
|
86
|
+
| `winston` | Forward to winston instance | Node.js | Existing winston setup |
|
|
87
|
+
| `pino` | Forward to pino instance | Node.js | Existing pino setup |
|
|
88
|
+
| `callback` | User-provided function | Any | Custom integrations |
|
|
89
|
+
|
|
90
|
+
## Field Redaction
|
|
91
|
+
|
|
92
|
+
Sensitive fields are replaced with `[REDACTED]` before reaching any sink:
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
logging: {
|
|
96
|
+
redactFields: ['password', 'token', 'secret', 'authorization', 'cookie'],
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Redaction is recursive (handles nested objects) and case-insensitive.
|
|
101
|
+
|
|
102
|
+
## Examples
|
|
103
|
+
|
|
104
|
+
| Example | Level | Description |
|
|
105
|
+
| ------------------------------------------------------------------------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
106
|
+
| [`stdout-logging`](../examples/structured-logging/stdout-logging.md) | Basic | Enable NDJSON structured logging to stdout with automatic trace correlation and field redaction. |
|
|
107
|
+
| [`winston-integration`](../examples/structured-logging/winston-integration.md) | Intermediate | Forward FrontMCP structured log entries to your existing winston logger. Each entry includes trace_id and span_id as metadata. |
|
|
108
|
+
|
|
109
|
+
> See all examples in [`examples/structured-logging/`](../examples/structured-logging/)
|
|
110
|
+
|
|
111
|
+
## Reference
|
|
112
|
+
|
|
113
|
+
- [Observability Guide](https://docs.agentfront.dev/frontmcp/guides/observability)
|
|
114
|
+
- Related skills: `frontmcp-observability`, `frontmcp-production-readiness`
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: telemetry-api
|
|
3
|
+
description: 'Use this.telemetry in tools, plugins, and agents to create custom spans, events, and attributes.'
|
|
4
|
+
tags: [telemetry, api, spans, events, attributes, this-telemetry, custom]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Telemetry API (`this.telemetry`)
|
|
8
|
+
|
|
9
|
+
Every execution context (tools, resources, prompts, agents) gets a `this.telemetry` API when observability is enabled. No imports, no context construction — it automatically inherits the current request's trace ID, session ID, and scope.
|
|
10
|
+
|
|
11
|
+
## Available Methods
|
|
12
|
+
|
|
13
|
+
| Method | Purpose |
|
|
14
|
+
| ---------------------------- | --------------------------------------------------- |
|
|
15
|
+
| `startSpan(name, attrs?)` | Create a child span (you must call `.end()`) |
|
|
16
|
+
| `withSpan(name, fn, attrs?)` | Run a function in an auto-managed span |
|
|
17
|
+
| `addEvent(name, attrs?)` | Add an event to the active execution span |
|
|
18
|
+
| `setAttributes(attrs)` | Set attributes on the active execution span |
|
|
19
|
+
| `traceId` | Get the current trace ID (for external correlation) |
|
|
20
|
+
| `sessionId` | Get the privacy-safe session tracing ID |
|
|
21
|
+
|
|
22
|
+
## Usage in Tools
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
26
|
+
import { z } from 'zod';
|
|
27
|
+
|
|
28
|
+
@Tool({
|
|
29
|
+
name: 'analyze_data',
|
|
30
|
+
description: 'Analyze dataset with custom telemetry',
|
|
31
|
+
inputSchema: { datasetId: z.string() },
|
|
32
|
+
})
|
|
33
|
+
class AnalyzeDataTool extends ToolContext<typeof AnalyzeDataTool> {
|
|
34
|
+
async execute({ datasetId }: { datasetId: string }) {
|
|
35
|
+
// Events go on the "tool analyze_data" span
|
|
36
|
+
this.telemetry.addEvent('analysis-started', { datasetId });
|
|
37
|
+
|
|
38
|
+
// Child span for a specific operation
|
|
39
|
+
const data = await this.telemetry.withSpan('fetch-dataset', async (span) => {
|
|
40
|
+
span.setAttribute('dataset.id', datasetId);
|
|
41
|
+
const res = await this.fetch(`/api/datasets/${datasetId}`);
|
|
42
|
+
span.addEvent('data-received', { rows: res.headers.get('x-total-count') ?? '0' });
|
|
43
|
+
return res.json();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Attributes on the execution span
|
|
47
|
+
this.telemetry.setAttributes({ 'dataset.size': data.length });
|
|
48
|
+
|
|
49
|
+
// Another child span
|
|
50
|
+
const result = await this.telemetry.withSpan('run-analysis', async (span) => {
|
|
51
|
+
const analysis = this.get(AnalysisService).run(data);
|
|
52
|
+
span.setAttribute('result.score', analysis.score);
|
|
53
|
+
return analysis;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return { score: result.score, datasetId };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Result in the trace:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
tool analyze_data
|
|
65
|
+
├── event: analysis-started
|
|
66
|
+
├── attribute: dataset.size = 1500
|
|
67
|
+
│
|
|
68
|
+
├── fetch-dataset (child span)
|
|
69
|
+
│ ├── attribute: dataset.id = "ds-123"
|
|
70
|
+
│ └── event: data-received
|
|
71
|
+
│
|
|
72
|
+
└── run-analysis (child span)
|
|
73
|
+
└── attribute: result.score = 0.95
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Usage in Plugins
|
|
77
|
+
|
|
78
|
+
External plugins use the same `this.telemetry` API. Events appear on the parent tool/resource span:
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
@Plugin({ name: 'my-audit-plugin', contextExtensions: [...] })
|
|
82
|
+
class AuditPlugin extends DynamicPlugin<AuditOptions> {
|
|
83
|
+
@ToolHook.Will('execute')
|
|
84
|
+
willExecute(flowCtx: FlowCtxOf<'tools:call-tool'>): void {
|
|
85
|
+
const toolCtx = flowCtx.state.toolContext;
|
|
86
|
+
if (toolCtx?.telemetry) {
|
|
87
|
+
toolCtx.telemetry.addEvent('audit.pre-check', { policy: 'strict' });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Usage in Agents
|
|
94
|
+
|
|
95
|
+
Agents have the same API. Nested tool calls automatically share the trace ID:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
@Agent({ name: 'research-agent', tools: [WebSearchTool, SummarizerTool] })
|
|
99
|
+
class ResearchAgent extends AgentContext {
|
|
100
|
+
async execute(input: { query: string }) {
|
|
101
|
+
this.telemetry.addEvent('research-started', { query: input.query });
|
|
102
|
+
// Nested tool calls get their own spans under the agent span
|
|
103
|
+
return super.execute(input);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Manual Span Management
|
|
109
|
+
|
|
110
|
+
For operations where you need explicit control:
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
const span = this.telemetry.startSpan('complex-operation', {
|
|
114
|
+
'operation.type': 'batch-import',
|
|
115
|
+
'batch.size': items.length,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
try {
|
|
119
|
+
for (const item of items) {
|
|
120
|
+
await processItem(item);
|
|
121
|
+
span.addEvent('item-processed', { itemId: item.id });
|
|
122
|
+
}
|
|
123
|
+
span.end();
|
|
124
|
+
} catch (err) {
|
|
125
|
+
span.recordError(err);
|
|
126
|
+
span.endWithError(err);
|
|
127
|
+
throw err;
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Access to Raw OTel Span
|
|
132
|
+
|
|
133
|
+
For advanced use cases, access the underlying OTel Span:
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
const telemetrySpan = this.telemetry.startSpan('advanced-op');
|
|
137
|
+
const otelSpan = telemetrySpan.raw; // @opentelemetry/api Span
|
|
138
|
+
otelSpan.setAttributes({ 'custom.otel.attr': 'value' });
|
|
139
|
+
telemetrySpan.end();
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Examples
|
|
143
|
+
|
|
144
|
+
| Example | Level | Description |
|
|
145
|
+
| --------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
146
|
+
| [`tool-custom-spans`](../examples/telemetry-api/tool-custom-spans.md) | Basic | Create child spans, events, and attributes inside a tool's execute method using this.telemetry. |
|
|
147
|
+
| [`plugin-telemetry`](../examples/telemetry-api/plugin-telemetry.md) | Intermediate | Add telemetry events from a custom plugin's hooks. Events appear on the tool execution span, giving you visibility into plugin behavior within the trace. |
|
|
148
|
+
| [`agent-nested-tracing`](../examples/telemetry-api/agent-nested-tracing.md) | Advanced | Trace an agent's execution lifecycle including its nested tool calls. Every span shares the same trace ID. |
|
|
149
|
+
|
|
150
|
+
> See all examples in [`examples/telemetry-api/`](../examples/telemetry-api/)
|
|
151
|
+
|
|
152
|
+
## Reference
|
|
153
|
+
|
|
154
|
+
- [Telemetry API Reference](https://docs.agentfront.dev/frontmcp/sdk-reference/telemetry)
|
|
155
|
+
- Related skills: `frontmcp-development`, `frontmcp-extensibility`
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: testing-observability
|
|
3
|
+
description: 'Test that your spans, log entries, and telemetry instrumentation work correctly.'
|
|
4
|
+
tags: [testing, spans, assertions, integration, jest]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Testing Observability
|
|
8
|
+
|
|
9
|
+
Verify that your tools create the right spans, log entries include trace context, and custom telemetry produces the expected output.
|
|
10
|
+
|
|
11
|
+
## Test Utilities
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import {
|
|
15
|
+
createTestTracer,
|
|
16
|
+
getFinishedSpans,
|
|
17
|
+
assertSpanExists,
|
|
18
|
+
assertSpanAttribute,
|
|
19
|
+
findSpan,
|
|
20
|
+
findSpansByAttribute,
|
|
21
|
+
} from '@frontmcp/observability';
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Testing Custom Spans
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
describe('AnalyzeDataTool', () => {
|
|
28
|
+
const { tracer, exporter, cleanup } = createTestTracer();
|
|
29
|
+
|
|
30
|
+
afterEach(() => exporter.reset());
|
|
31
|
+
afterAll(() => cleanup());
|
|
32
|
+
|
|
33
|
+
it('should create a fetch-dataset child span', async () => {
|
|
34
|
+
// ... invoke tool ...
|
|
35
|
+
|
|
36
|
+
const spans = getFinishedSpans(exporter);
|
|
37
|
+
const fetchSpan = assertSpanExists(spans, 'fetch-dataset');
|
|
38
|
+
assertSpanAttribute(fetchSpan, 'dataset.id', 'ds-123');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should record error on span when API fails', async () => {
|
|
42
|
+
// ... invoke tool that fails ...
|
|
43
|
+
|
|
44
|
+
const spans = getFinishedSpans(exporter);
|
|
45
|
+
const span = findSpan(spans, 'fetch-dataset');
|
|
46
|
+
expect(span?.status.code).toBe(SpanStatusCode.ERROR);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Testing Log Entries
|
|
52
|
+
|
|
53
|
+
Use a `CallbackSink` to capture structured log entries:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { StructuredLogTransport, CallbackSink } from '@frontmcp/observability';
|
|
57
|
+
import type { StructuredLogEntry } from '@frontmcp/observability';
|
|
58
|
+
|
|
59
|
+
describe('Structured logging', () => {
|
|
60
|
+
it('should include trace_id in log entries', () => {
|
|
61
|
+
const entries: StructuredLogEntry[] = [];
|
|
62
|
+
const sink = new CallbackSink((e) => entries.push(e));
|
|
63
|
+
|
|
64
|
+
const transport = new StructuredLogTransport([sink], {}, () => ({
|
|
65
|
+
requestId: 'req-001',
|
|
66
|
+
traceContext: { traceId: 'a'.repeat(32), parentId: 'b'.repeat(16), traceFlags: 1 },
|
|
67
|
+
sessionIdHash: 'hash12345678',
|
|
68
|
+
scopeId: 'test',
|
|
69
|
+
elapsed: 0,
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
transport.log({
|
|
73
|
+
level: 2,
|
|
74
|
+
levelName: 'info',
|
|
75
|
+
message: 'test message',
|
|
76
|
+
args: [{ userId: 123 }],
|
|
77
|
+
timestamp: new Date(),
|
|
78
|
+
prefix: 'MyTool',
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
expect(entries).toHaveLength(1);
|
|
82
|
+
expect(entries[0].trace_id).toBe('a'.repeat(32));
|
|
83
|
+
expect(entries[0].attributes).toEqual({ userId: 123 });
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Testing Auto-Instrumentation Hooks
|
|
89
|
+
|
|
90
|
+
Test that the SDK's hook functions produce correct spans:
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import { BasicTracerProvider, InMemorySpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
94
|
+
import {
|
|
95
|
+
onToolWillParse,
|
|
96
|
+
onToolWillExecute,
|
|
97
|
+
onToolDidExecute,
|
|
98
|
+
onToolDidFinalize,
|
|
99
|
+
} from '@frontmcp/observability/plugin/observability.hooks';
|
|
100
|
+
|
|
101
|
+
const exporter = new InMemorySpanExporter();
|
|
102
|
+
const provider = new BasicTracerProvider();
|
|
103
|
+
provider.addSpanProcessor(new SimpleSpanProcessor(exporter));
|
|
104
|
+
provider.register();
|
|
105
|
+
|
|
106
|
+
it('should create RPC + tool spans', () => {
|
|
107
|
+
const flowCtx = {
|
|
108
|
+
state: { input: { name: 'my_tool' }, _toolOwnerId: 'MyApp' },
|
|
109
|
+
get: (token) => {
|
|
110
|
+
if (token === Symbol.for('frontmcp:CONTEXT')) {
|
|
111
|
+
return {
|
|
112
|
+
requestId: 'req-001',
|
|
113
|
+
sessionId: 'sess',
|
|
114
|
+
scopeId: 'scope',
|
|
115
|
+
traceContext: { traceId: 'a'.repeat(32), parentId: 'b'.repeat(16), traceFlags: 1, raw: '...' },
|
|
116
|
+
authInfo: {},
|
|
117
|
+
metadata: { customHeaders: {} },
|
|
118
|
+
set: () => {},
|
|
119
|
+
get: () => undefined,
|
|
120
|
+
delete: () => {},
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const opts = { executionSpans: true, flowStageEvents: true };
|
|
127
|
+
onToolWillParse(opts, flowCtx);
|
|
128
|
+
onToolWillExecute(opts, flowCtx);
|
|
129
|
+
onToolDidExecute(opts, flowCtx);
|
|
130
|
+
onToolDidFinalize(flowCtx);
|
|
131
|
+
|
|
132
|
+
const spans = exporter.getFinishedSpans();
|
|
133
|
+
expect(spans.find((s) => s.name === 'tools/call')).toBeTruthy();
|
|
134
|
+
expect(spans.find((s) => s.name === 'tool my_tool')).toBeTruthy();
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Test Isolation
|
|
139
|
+
|
|
140
|
+
Each test should:
|
|
141
|
+
|
|
142
|
+
1. Call `exporter.reset()` in `beforeEach` to clear previous spans
|
|
143
|
+
2. Call `cleanup()` in `afterAll` to shut down the provider
|
|
144
|
+
3. Use `createTestTracer()` which does NOT register globally (safe for parallel tests)
|
|
145
|
+
|
|
146
|
+
## API Reference
|
|
147
|
+
|
|
148
|
+
| Function | Purpose |
|
|
149
|
+
| ----------------------------------------- | --------------------------------------------------- |
|
|
150
|
+
| `createTestTracer(name?)` | Create isolated tracer + exporter (not global) |
|
|
151
|
+
| `getFinishedSpans(exporter)` | Get all exported spans |
|
|
152
|
+
| `assertSpanExists(spans, name)` | Assert span exists, return it (throws if not found) |
|
|
153
|
+
| `assertSpanAttribute(span, key, value)` | Assert attribute value on a span |
|
|
154
|
+
| `findSpan(spans, name)` | Find span by name (returns undefined if not found) |
|
|
155
|
+
| `findSpansByAttribute(spans, key, value)` | Find all spans with matching attribute |
|
|
156
|
+
|
|
157
|
+
## Examples
|
|
158
|
+
|
|
159
|
+
| Example | Level | Description |
|
|
160
|
+
| ----------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------- |
|
|
161
|
+
| [`test-custom-spans`](../examples/testing-observability/test-custom-spans.md) | Basic | Verify that your tool creates the expected child spans with correct attributes. |
|
|
162
|
+
| [`test-log-correlation`](../examples/testing-observability/test-log-correlation.md) | Intermediate | Verify that structured log entries include trace context fields for correlation with spans. |
|
|
163
|
+
|
|
164
|
+
> See all examples in [`examples/testing-observability/`](../examples/testing-observability/)
|
|
165
|
+
|
|
166
|
+
## Reference
|
|
167
|
+
|
|
168
|
+
- [Telemetry API Reference](https://docs.agentfront.dev/frontmcp/sdk-reference/telemetry)
|
|
169
|
+
- Related skills: `frontmcp-testing`, `frontmcp-observability`
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tracing-setup
|
|
3
|
+
description: 'Enable OpenTelemetry distributed tracing for all FrontMCP flows with zero configuration.'
|
|
4
|
+
tags: [tracing, opentelemetry, spans, setup]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Tracing Setup
|
|
8
|
+
|
|
9
|
+
Enable automatic distributed tracing for every flow in your FrontMCP server. When enabled, 103+ hooks create spans for tool calls, resource reads, HTTP requests, auth flows, transport sessions, and more — with zero code changes.
|
|
10
|
+
|
|
11
|
+
## How It Works
|
|
12
|
+
|
|
13
|
+
1. Set `observability: true` in `@FrontMcp` config
|
|
14
|
+
2. The SDK auto-loads `@frontmcp/observability` and registers hooks on all 33 flows
|
|
15
|
+
3. Every request gets a single W3C trace ID, shared across all spans
|
|
16
|
+
4. Without a TracerProvider, all OTel calls are no-ops (zero overhead)
|
|
17
|
+
|
|
18
|
+
## Enable Tracing
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { FrontMcp } from '@frontmcp/sdk';
|
|
22
|
+
|
|
23
|
+
@FrontMcp({
|
|
24
|
+
info: { name: 'my-server', version: '1.0.0' },
|
|
25
|
+
apps: [MyApp],
|
|
26
|
+
observability: true,
|
|
27
|
+
})
|
|
28
|
+
export default class Server {}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Configure a TracerProvider
|
|
32
|
+
|
|
33
|
+
Spans only appear when a TracerProvider is configured. Three ways:
|
|
34
|
+
|
|
35
|
+
### Option A: setupOTel() convenience
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { setupOTel } from '@frontmcp/observability';
|
|
39
|
+
|
|
40
|
+
// Call BEFORE @FrontMcp decorator runs
|
|
41
|
+
setupOTel({
|
|
42
|
+
serviceName: 'my-server',
|
|
43
|
+
exporter: 'otlp',
|
|
44
|
+
endpoint: 'http://localhost:4318',
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Option B: Environment variables
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
OTEL_SERVICE_NAME=my-server \
|
|
52
|
+
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 \
|
|
53
|
+
node server.js
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Option C: Your own OTel SDK
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { NodeSDK } from '@opentelemetry/sdk-node';
|
|
60
|
+
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
|
|
61
|
+
|
|
62
|
+
const sdk = new NodeSDK({
|
|
63
|
+
traceExporter: new OTLPTraceExporter({ url: 'http://localhost:4318/v1/traces' }),
|
|
64
|
+
});
|
|
65
|
+
sdk.start();
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Span Hierarchy
|
|
69
|
+
|
|
70
|
+
Every request produces a span tree:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
HTTP Server Span: "POST /mcp"
|
|
74
|
+
├── event: stage.traceRequest
|
|
75
|
+
├── event: stage.checkAuthorization
|
|
76
|
+
├── event: stage.router
|
|
77
|
+
│
|
|
78
|
+
├── RPC Span: "tools/call"
|
|
79
|
+
│ ├── rpc.system = "mcp"
|
|
80
|
+
│ ├── mcp.session.id = "a3f8..."
|
|
81
|
+
│ ├── event: stage.parseInput
|
|
82
|
+
│ ├── event: stage.findTool
|
|
83
|
+
│ ├── event: stage.validateInput
|
|
84
|
+
│ │
|
|
85
|
+
│ ├── Tool Span: "tool get_weather"
|
|
86
|
+
│ │ ├── mcp.component.type = "tool"
|
|
87
|
+
│ │ ├── enduser.id = "client-42"
|
|
88
|
+
│ │ ├── event: stage.execute.start
|
|
89
|
+
│ │ ├── event: stage.execute.done
|
|
90
|
+
│ │
|
|
91
|
+
│ ├── event: stage.validateOutput
|
|
92
|
+
│ └── event: stage.finalize
|
|
93
|
+
│
|
|
94
|
+
└── event: stage.finalize
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Fine-Grained Control
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
observability: {
|
|
101
|
+
tracing: {
|
|
102
|
+
httpSpans: true, // HTTP request spans
|
|
103
|
+
executionSpans: true, // Tool/resource/prompt/agent spans
|
|
104
|
+
fetchSpans: true, // Outbound ctx.fetch() spans
|
|
105
|
+
flowStageEvents: true, // Flow stage events on execution spans
|
|
106
|
+
transportSpans: true, // SSE/HTTP transport spans
|
|
107
|
+
authSpans: true, // Auth/session verify spans
|
|
108
|
+
oauthSpans: true, // OAuth flow spans
|
|
109
|
+
elicitationSpans: true, // Elicitation spans
|
|
110
|
+
hookSpans: false, // Individual hook spans (verbose)
|
|
111
|
+
startupReport: true, // Emit startup span on first request
|
|
112
|
+
},
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Local Development
|
|
117
|
+
|
|
118
|
+
### otel-desktop-viewer
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
brew install ymtdzzz/tap/otel-desktop-viewer
|
|
122
|
+
otel-desktop-viewer # UI at :8000, OTLP on :4317
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Jaeger
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
docker run -d --name jaeger \
|
|
129
|
+
-p 16686:16686 -p 4317:4317 -p 4318:4318 \
|
|
130
|
+
jaegertracing/all-in-one:latest
|
|
131
|
+
# UI at http://localhost:16686
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Examples
|
|
135
|
+
|
|
136
|
+
| Example | Level | Description |
|
|
137
|
+
| ----------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------ |
|
|
138
|
+
| [`basic-tracing`](../examples/tracing-setup/basic-tracing.md) | Basic | Enable auto-tracing and see spans printed to your terminal. |
|
|
139
|
+
| [`production-tracing`](../examples/tracing-setup/production-tracing.md) | Intermediate | Full production observability — traces to OTLP, structured logs to stdout, per-request log collection. |
|
|
140
|
+
|
|
141
|
+
> See all examples in [`examples/tracing-setup/`](../examples/tracing-setup/)
|
|
142
|
+
|
|
143
|
+
## Reference
|
|
144
|
+
|
|
145
|
+
- [Observability Guide](https://docs.agentfront.dev/frontmcp/guides/observability)
|
|
146
|
+
- Related skills: `frontmcp-config`, `frontmcp-deployment`
|