@frontmcp/skills 1.0.0-beta.13 → 1.0.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/catalog/TEMPLATE.md +55 -0
- package/catalog/frontmcp-config/SKILL.md +2 -2
- package/catalog/frontmcp-config/examples/configure-auth/multi-app-auth.md +87 -0
- package/catalog/frontmcp-config/examples/configure-auth/public-mode-setup.md +63 -0
- package/catalog/frontmcp-config/examples/configure-auth/remote-oauth-with-vault.md +76 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-self-signed-tokens.md +77 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/remote-enterprise-oauth.md +73 -0
- package/catalog/frontmcp-config/examples/configure-auth-modes/transparent-jwt-validation.md +64 -0
- package/catalog/frontmcp-config/examples/configure-elicitation/basic-confirmation-gate.md +83 -0
- package/catalog/frontmcp-config/examples/configure-elicitation/distributed-elicitation-redis.md +87 -0
- package/catalog/frontmcp-config/examples/configure-http/cors-restricted-origins.md +52 -0
- package/catalog/frontmcp-config/examples/configure-http/entry-path-reverse-proxy.md +72 -0
- package/catalog/frontmcp-config/examples/configure-http/unix-socket-local.md +64 -0
- package/catalog/frontmcp-config/examples/configure-session/multi-server-key-prefix.md +68 -0
- package/catalog/frontmcp-config/examples/configure-session/redis-session-store.md +52 -0
- package/catalog/frontmcp-config/examples/configure-session/vercel-kv-session.md +52 -0
- package/catalog/frontmcp-config/examples/configure-throttle/distributed-redis-throttle.md +94 -0
- package/catalog/frontmcp-config/examples/configure-throttle/per-tool-rate-limit.md +92 -0
- package/catalog/frontmcp-config/examples/configure-throttle/server-level-rate-limit.md +83 -0
- package/catalog/frontmcp-config/examples/configure-throttle-guard-config/full-guard-config.md +99 -0
- package/catalog/frontmcp-config/examples/configure-throttle-guard-config/minimal-guard-config.md +55 -0
- package/catalog/frontmcp-config/examples/configure-transport/custom-protocol-flags.md +74 -0
- package/catalog/frontmcp-config/examples/configure-transport/distributed-sessions-redis.md +86 -0
- package/catalog/frontmcp-config/examples/configure-transport/stateless-serverless.md +69 -0
- package/catalog/frontmcp-config/examples/configure-transport-protocol-presets/legacy-preset-nodejs.md +65 -0
- package/catalog/frontmcp-config/examples/configure-transport-protocol-presets/stateless-api-serverless.md +69 -0
- package/catalog/frontmcp-config/references/configure-auth-modes.md +10 -0
- package/catalog/frontmcp-config/references/configure-auth.md +10 -0
- package/catalog/frontmcp-config/references/configure-elicitation.md +9 -0
- package/catalog/frontmcp-config/references/configure-http.md +10 -0
- package/catalog/frontmcp-config/references/configure-session.md +10 -0
- package/catalog/frontmcp-config/references/configure-throttle-guard-config.md +9 -0
- package/catalog/frontmcp-config/references/configure-throttle.md +10 -0
- package/catalog/frontmcp-config/references/configure-transport-protocol-presets.md +9 -0
- package/catalog/frontmcp-config/references/configure-transport.md +10 -0
- package/catalog/frontmcp-config/references/setup-redis.md +5 -0
- package/catalog/frontmcp-config/references/setup-sqlite.md +5 -0
- package/catalog/frontmcp-deployment/SKILL.md +2 -2
- package/catalog/frontmcp-deployment/examples/build-for-browser/browser-build-with-custom-entry.md +43 -0
- package/catalog/frontmcp-deployment/examples/build-for-browser/browser-crypto-and-storage.md +85 -0
- package/catalog/frontmcp-deployment/examples/build-for-browser/react-provider-setup.md +61 -0
- package/catalog/frontmcp-deployment/examples/build-for-cli/cli-binary-build.md +66 -0
- package/catalog/frontmcp-deployment/examples/build-for-cli/unix-socket-daemon.md +76 -0
- package/catalog/frontmcp-deployment/examples/build-for-sdk/connect-openai.md +78 -0
- package/catalog/frontmcp-deployment/examples/build-for-sdk/create-flat-config.md +85 -0
- package/catalog/frontmcp-deployment/examples/build-for-sdk/multi-platform-connect.md +104 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/basic-worker-deploy.md +82 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-custom-domain.md +97 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-with-kv-storage.md +92 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/cdk-deployment.md +92 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/lambda-handler-with-cors.md +113 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/sam-template-basic.md +100 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node/docker-compose-with-redis.md +101 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node/pm2-with-nginx.md +79 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node/resource-limits.md +92 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node-dockerfile/basic-multistage-dockerfile.md +63 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-node-dockerfile/secure-nonroot-dockerfile.md +89 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-mcp-endpoint-test.md +69 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-with-kv.md +82 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-with-skills-cache.md +90 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel-config/minimal-vercel-config.md +49 -0
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel-config/vercel-config-with-security-headers.md +92 -0
- package/catalog/frontmcp-deployment/references/build-for-browser.md +10 -0
- package/catalog/frontmcp-deployment/references/build-for-cli.md +9 -0
- package/catalog/frontmcp-deployment/references/build-for-sdk.md +10 -0
- package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +10 -0
- package/catalog/frontmcp-deployment/references/deploy-to-lambda.md +10 -0
- package/catalog/frontmcp-deployment/references/deploy-to-node-dockerfile.md +9 -0
- package/catalog/frontmcp-deployment/references/deploy-to-node.md +10 -0
- package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +9 -0
- package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +10 -0
- package/catalog/frontmcp-development/SKILL.md +2 -2
- package/catalog/frontmcp-development/examples/create-adapter/basic-api-adapter.md +92 -0
- package/catalog/frontmcp-development/examples/create-adapter/namespaced-adapter.md +124 -0
- package/catalog/frontmcp-development/examples/create-agent/basic-agent-with-tools.md +121 -0
- package/catalog/frontmcp-development/examples/create-agent/custom-multi-pass-agent.md +95 -0
- package/catalog/frontmcp-development/examples/create-agent/nested-agents-with-swarm.md +111 -0
- package/catalog/frontmcp-development/examples/create-agent-llm-config/anthropic-config.md +81 -0
- package/catalog/frontmcp-development/examples/create-agent-llm-config/openai-config.md +80 -0
- package/catalog/frontmcp-development/examples/create-job/basic-report-job.md +87 -0
- package/catalog/frontmcp-development/examples/create-job/job-with-permissions.md +117 -0
- package/catalog/frontmcp-development/examples/create-job/job-with-retry.md +88 -0
- package/catalog/frontmcp-development/examples/create-plugin/basic-plugin-with-provider.md +69 -0
- package/catalog/frontmcp-development/examples/create-plugin/configurable-dynamic-plugin.md +178 -0
- package/catalog/frontmcp-development/examples/create-plugin/plugin-with-context-extension.md +107 -0
- package/catalog/frontmcp-development/examples/create-plugin-hooks/basic-logging-plugin.md +69 -0
- package/catalog/frontmcp-development/examples/create-plugin-hooks/caching-with-around.md +80 -0
- package/catalog/frontmcp-development/examples/create-plugin-hooks/tool-level-hooks-and-stage-replacement.md +100 -0
- package/catalog/frontmcp-development/examples/create-prompt/basic-prompt.md +72 -0
- package/catalog/frontmcp-development/examples/create-prompt/dynamic-rag-prompt.md +92 -0
- package/catalog/frontmcp-development/examples/create-prompt/multi-turn-debug-session.md +86 -0
- package/catalog/frontmcp-development/examples/create-provider/basic-database-provider.md +113 -0
- package/catalog/frontmcp-development/examples/create-provider/config-and-api-providers.md +107 -0
- package/catalog/frontmcp-development/examples/create-resource/basic-static-resource.md +72 -0
- package/catalog/frontmcp-development/examples/create-resource/binary-and-multi-content.md +111 -0
- package/catalog/frontmcp-development/examples/create-resource/parameterized-template.md +84 -0
- package/catalog/frontmcp-development/examples/create-skill/basic-inline-skill.md +96 -0
- package/catalog/frontmcp-development/examples/create-skill/directory-based-skill.md +115 -0
- package/catalog/frontmcp-development/examples/create-skill/parameterized-skill.md +96 -0
- package/catalog/frontmcp-development/examples/create-skill-with-tools/basic-tool-orchestration.md +76 -0
- package/catalog/frontmcp-development/examples/create-skill-with-tools/directory-skill-with-tools.md +149 -0
- package/catalog/frontmcp-development/examples/create-skill-with-tools/incident-response-skill.md +92 -0
- package/catalog/frontmcp-development/examples/create-tool/basic-class-tool.md +62 -0
- package/catalog/frontmcp-development/examples/create-tool/tool-with-di-and-errors.md +84 -0
- package/catalog/frontmcp-development/examples/create-tool/tool-with-rate-limiting-and-progress.md +93 -0
- package/catalog/frontmcp-development/examples/create-tool-annotations/destructive-delete-tool.md +94 -0
- package/catalog/frontmcp-development/examples/create-tool-annotations/readonly-query-tool.md +60 -0
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/primitive-and-media-outputs.md +104 -0
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-raw-shape-output.md +63 -0
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-schema-advanced-output.md +103 -0
- package/catalog/frontmcp-development/examples/create-workflow/basic-deploy-pipeline.md +91 -0
- package/catalog/frontmcp-development/examples/create-workflow/parallel-validation-pipeline.md +90 -0
- package/catalog/frontmcp-development/examples/create-workflow/webhook-triggered-workflow.md +136 -0
- package/catalog/frontmcp-development/examples/decorators-guide/agent-skill-job-workflow.md +145 -0
- package/catalog/frontmcp-development/examples/decorators-guide/basic-server-with-app-and-tools.md +124 -0
- package/catalog/frontmcp-development/examples/decorators-guide/multi-app-with-plugins-and-providers.md +149 -0
- package/catalog/frontmcp-development/examples/official-adapters/authenticated-adapter-with-polling.md +84 -0
- package/catalog/frontmcp-development/examples/official-adapters/basic-openapi-adapter.md +54 -0
- package/catalog/frontmcp-development/examples/official-adapters/multi-api-hub-with-inline-spec.md +130 -0
- package/catalog/frontmcp-development/examples/official-plugins/cache-and-feature-flags.md +117 -0
- package/catalog/frontmcp-development/examples/official-plugins/production-multi-plugin-setup.md +147 -0
- package/catalog/frontmcp-development/examples/official-plugins/remember-plugin-session-memory.md +104 -0
- package/catalog/frontmcp-development/references/create-adapter.md +9 -0
- package/catalog/frontmcp-development/references/create-agent-llm-config.md +9 -0
- package/catalog/frontmcp-development/references/create-agent.md +10 -0
- package/catalog/frontmcp-development/references/create-job.md +10 -0
- package/catalog/frontmcp-development/references/create-plugin-hooks.md +10 -0
- package/catalog/frontmcp-development/references/create-plugin.md +10 -0
- package/catalog/frontmcp-development/references/create-prompt.md +10 -0
- package/catalog/frontmcp-development/references/create-provider.md +9 -0
- package/catalog/frontmcp-development/references/create-resource.md +52 -15
- package/catalog/frontmcp-development/references/create-skill-with-tools.md +10 -0
- package/catalog/frontmcp-development/references/create-skill.md +10 -0
- package/catalog/frontmcp-development/references/create-tool-annotations.md +9 -0
- package/catalog/frontmcp-development/references/create-tool-output-schema-types.md +10 -0
- package/catalog/frontmcp-development/references/create-tool.md +10 -0
- package/catalog/frontmcp-development/references/create-workflow.md +10 -0
- package/catalog/frontmcp-development/references/decorators-guide.md +10 -0
- package/catalog/frontmcp-development/references/official-adapters.md +10 -0
- package/catalog/frontmcp-development/references/official-plugins.md +10 -0
- package/catalog/frontmcp-extensibility/SKILL.md +1 -1
- package/catalog/frontmcp-extensibility/examples/vectoriadb/product-catalog-search.md +175 -0
- package/catalog/frontmcp-extensibility/examples/vectoriadb/semantic-search-with-persistence.md +138 -0
- package/catalog/frontmcp-extensibility/examples/vectoriadb/tfidf-keyword-search.md +103 -0
- package/catalog/frontmcp-extensibility/references/vectoriadb.md +10 -0
- package/catalog/frontmcp-guides/SKILL.md +2 -2
- package/catalog/frontmcp-guides/examples/example-knowledge-base/agent-and-plugin.md +160 -0
- package/catalog/frontmcp-guides/examples/example-knowledge-base/multi-app-composition.md +92 -0
- package/catalog/frontmcp-guides/examples/example-knowledge-base/vector-search-and-resources.md +135 -0
- package/catalog/frontmcp-guides/examples/example-task-manager/auth-and-crud-tools.md +135 -0
- package/catalog/frontmcp-guides/examples/example-task-manager/authenticated-e2e-tests.md +148 -0
- package/catalog/frontmcp-guides/examples/example-task-manager/redis-provider-with-di.md +129 -0
- package/catalog/frontmcp-guides/examples/example-weather-api/server-and-app-setup.md +75 -0
- package/catalog/frontmcp-guides/examples/example-weather-api/unit-and-e2e-tests.md +142 -0
- package/catalog/frontmcp-guides/examples/example-weather-api/weather-tool-with-schemas.md +74 -0
- package/catalog/frontmcp-guides/references/example-knowledge-base.md +10 -0
- package/catalog/frontmcp-guides/references/example-task-manager.md +10 -0
- package/catalog/frontmcp-guides/references/example-weather-api.md +10 -0
- package/catalog/frontmcp-production-readiness/SKILL.md +2 -2
- package/catalog/frontmcp-production-readiness/examples/common-checklist/caching-and-performance.md +102 -0
- package/catalog/frontmcp-production-readiness/examples/common-checklist/observability-setup.md +104 -0
- package/catalog/frontmcp-production-readiness/examples/common-checklist/security-hardening.md +95 -0
- package/catalog/frontmcp-production-readiness/examples/production-browser/browser-bundle-config.md +93 -0
- package/catalog/frontmcp-production-readiness/examples/production-browser/cross-platform-crypto.md +116 -0
- package/catalog/frontmcp-production-readiness/examples/production-browser/security-and-performance.md +128 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-binary/binary-build-config.md +109 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-binary/stdio-transport-error-handling.md +132 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/daemon-socket-config.md +82 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/graceful-shutdown-cleanup.md +107 -0
- package/catalog/frontmcp-production-readiness/examples/production-cli-daemon/security-and-permissions.md +119 -0
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/durable-objects-state.md +124 -0
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/workers-runtime-constraints.md +103 -0
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/wrangler-config.md +89 -0
- package/catalog/frontmcp-production-readiness/examples/production-lambda/cold-start-connection-reuse.md +122 -0
- package/catalog/frontmcp-production-readiness/examples/production-lambda/sam-template.md +107 -0
- package/catalog/frontmcp-production-readiness/examples/production-lambda/scaling-and-monitoring.md +138 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-sdk/basic-sdk-lifecycle.md +85 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-sdk/multi-instance-cleanup.md +110 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-sdk/package-json-config.md +107 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-server/docker-multi-stage.md +103 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-server/graceful-shutdown.md +87 -0
- package/catalog/frontmcp-production-readiness/examples/production-node-server/redis-session-scaling.md +97 -0
- package/catalog/frontmcp-production-readiness/examples/production-vercel/cold-start-optimization.md +104 -0
- package/catalog/frontmcp-production-readiness/examples/production-vercel/stateless-serverless-design.md +91 -0
- package/catalog/frontmcp-production-readiness/examples/production-vercel/vercel-edge-config.md +78 -0
- package/catalog/frontmcp-production-readiness/references/common-checklist.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-browser.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-cli-binary.md +9 -0
- package/catalog/frontmcp-production-readiness/references/production-cli-daemon.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-cloudflare.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-lambda.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-node-sdk.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-node-server.md +10 -0
- package/catalog/frontmcp-production-readiness/references/production-vercel.md +10 -0
- package/catalog/frontmcp-setup/examples/frontmcp-skills-usage/bundle-presets-scaffolding.md +61 -0
- package/catalog/frontmcp-setup/examples/frontmcp-skills-usage/install-and-search-skills.md +83 -0
- package/catalog/frontmcp-setup/examples/multi-app-composition/local-apps-with-shared-tools.md +87 -0
- package/catalog/frontmcp-setup/examples/multi-app-composition/per-app-auth-and-isolation.md +88 -0
- package/catalog/frontmcp-setup/examples/multi-app-composition/remote-and-esm-apps.md +81 -0
- package/catalog/frontmcp-setup/examples/nx-workflow/build-test-affected.md +77 -0
- package/catalog/frontmcp-setup/examples/nx-workflow/multi-server-deployment.md +93 -0
- package/catalog/frontmcp-setup/examples/nx-workflow/scaffold-and-generate.md +62 -0
- package/catalog/frontmcp-setup/examples/project-structure-nx/nx-generator-scaffolding.md +73 -0
- package/catalog/frontmcp-setup/examples/project-structure-nx/nx-workspace-with-apps.md +85 -0
- package/catalog/frontmcp-setup/examples/project-structure-nx/shared-library-usage.md +89 -0
- package/catalog/frontmcp-setup/examples/project-structure-standalone/dev-workflow-commands.md +64 -0
- package/catalog/frontmcp-setup/examples/project-structure-standalone/feature-folder-organization.md +111 -0
- package/catalog/frontmcp-setup/examples/project-structure-standalone/minimal-standalone-layout.md +73 -0
- package/catalog/frontmcp-setup/examples/readme-guide/node-server-readme.md +89 -0
- package/catalog/frontmcp-setup/examples/readme-guide/vercel-deployment-readme.md +90 -0
- package/catalog/frontmcp-setup/examples/setup-project/basic-node-server.md +99 -0
- package/catalog/frontmcp-setup/examples/setup-project/cli-scaffold-with-flags.md +77 -0
- package/catalog/frontmcp-setup/examples/setup-project/vercel-serverless-server.md +89 -0
- package/catalog/frontmcp-setup/examples/setup-redis/docker-redis-local-dev.md +88 -0
- package/catalog/frontmcp-setup/examples/setup-redis/hybrid-vercel-kv-with-pubsub.md +78 -0
- package/catalog/frontmcp-setup/examples/setup-redis/vercel-kv-serverless.md +78 -0
- package/catalog/frontmcp-setup/examples/setup-sqlite/basic-sqlite-setup.md +75 -0
- package/catalog/frontmcp-setup/examples/setup-sqlite/encrypted-sqlite-storage.md +55 -0
- package/catalog/frontmcp-setup/examples/setup-sqlite/unix-socket-daemon.md +70 -0
- package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +9 -0
- package/catalog/frontmcp-setup/references/multi-app-composition.md +10 -0
- package/catalog/frontmcp-setup/references/nx-workflow.md +10 -0
- package/catalog/frontmcp-setup/references/project-structure-nx.md +10 -0
- package/catalog/frontmcp-setup/references/project-structure-standalone.md +10 -0
- package/catalog/frontmcp-setup/references/readme-guide.md +9 -0
- package/catalog/frontmcp-setup/references/setup-project.md +10 -0
- package/catalog/frontmcp-setup/references/setup-redis.md +10 -0
- package/catalog/frontmcp-setup/references/setup-sqlite.md +10 -0
- package/catalog/frontmcp-testing/examples/setup-testing/fixture-based-e2e-test.md +70 -0
- package/catalog/frontmcp-testing/examples/setup-testing/jest-config-with-coverage.md +59 -0
- package/catalog/frontmcp-testing/examples/setup-testing/unit-test-tool-resource-prompt.md +115 -0
- package/catalog/frontmcp-testing/examples/test-auth/oauth-flow-test.md +78 -0
- package/catalog/frontmcp-testing/examples/test-auth/role-based-access-test.md +88 -0
- package/catalog/frontmcp-testing/examples/test-auth/token-factory-test.md +71 -0
- package/catalog/frontmcp-testing/examples/test-browser-build/browser-bundle-validation.md +58 -0
- package/catalog/frontmcp-testing/examples/test-browser-build/playwright-browser-test.md +69 -0
- package/catalog/frontmcp-testing/examples/test-cli-binary/binary-startup-test.md +77 -0
- package/catalog/frontmcp-testing/examples/test-cli-binary/js-bundle-import-test.md +56 -0
- package/catalog/frontmcp-testing/examples/test-direct-client/basic-create-test.md +74 -0
- package/catalog/frontmcp-testing/examples/test-direct-client/openai-claude-format-test.md +79 -0
- package/catalog/frontmcp-testing/examples/test-e2e-handler/basic-e2e-test.md +67 -0
- package/catalog/frontmcp-testing/examples/test-e2e-handler/manual-client-with-transport.md +72 -0
- package/catalog/frontmcp-testing/examples/test-e2e-handler/tool-call-and-error-e2e.md +73 -0
- package/catalog/frontmcp-testing/examples/test-tool-unit/basic-tool-test.md +69 -0
- package/catalog/frontmcp-testing/examples/test-tool-unit/schema-validation-test.md +82 -0
- package/catalog/frontmcp-testing/examples/test-tool-unit/tool-error-handling-test.md +92 -0
- package/catalog/frontmcp-testing/references/setup-testing.md +10 -0
- package/catalog/frontmcp-testing/references/test-auth.md +10 -0
- package/catalog/frontmcp-testing/references/test-browser-build.md +9 -0
- package/catalog/frontmcp-testing/references/test-cli-binary.md +9 -0
- package/catalog/frontmcp-testing/references/test-direct-client.md +9 -0
- package/catalog/frontmcp-testing/references/test-e2e-handler.md +10 -0
- package/catalog/frontmcp-testing/references/test-tool-unit.md +10 -0
- package/catalog/skills-manifest.json +2383 -67
- package/package.json +1 -1
- package/src/manifest.d.ts +23 -0
- package/src/manifest.js +3 -1
- package/src/manifest.js.map +1 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vercel-config-with-security-headers
|
|
3
|
+
reference: deploy-to-vercel-config
|
|
4
|
+
level: intermediate
|
|
5
|
+
description: 'A complete `vercel.json` with per-route security headers for health, MCP, and all other endpoints.'
|
|
6
|
+
tags: [deployment, vercel, cache, security, config, headers]
|
|
7
|
+
features:
|
|
8
|
+
- 'Per-route header configuration: `/health` and `/mcp` get `Cache-Control: no-store` to prevent caching'
|
|
9
|
+
- 'Global security headers (`X-Frame-Options`, `X-Content-Type-Options`, `Referrer-Policy`) applied to all routes'
|
|
10
|
+
- 'Setting `framework: null` to tell Vercel this is not a framework project'
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# vercel.json with Security Headers
|
|
14
|
+
|
|
15
|
+
A complete `vercel.json` with per-route security headers for health, MCP, and all other endpoints.
|
|
16
|
+
|
|
17
|
+
## Code
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
// vercel.json
|
|
21
|
+
{
|
|
22
|
+
"$schema": "https://openapi.vercel.sh/vercel.json",
|
|
23
|
+
"framework": null,
|
|
24
|
+
"buildCommand": "frontmcp build --target vercel",
|
|
25
|
+
"outputDirectory": "dist",
|
|
26
|
+
"rewrites": [
|
|
27
|
+
{
|
|
28
|
+
"source": "/(.*)",
|
|
29
|
+
"destination": "/api/frontmcp"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"functions": {
|
|
33
|
+
"api/frontmcp.js": {
|
|
34
|
+
"memory": 512,
|
|
35
|
+
"maxDuration": 30
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"regions": ["iad1"],
|
|
39
|
+
"headers": [
|
|
40
|
+
{
|
|
41
|
+
"source": "/health",
|
|
42
|
+
"headers": [
|
|
43
|
+
{
|
|
44
|
+
"key": "Cache-Control",
|
|
45
|
+
"value": "no-store"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"source": "/mcp",
|
|
51
|
+
"headers": [
|
|
52
|
+
{
|
|
53
|
+
"key": "Cache-Control",
|
|
54
|
+
"value": "no-store"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"key": "X-Content-Type-Options",
|
|
58
|
+
"value": "nosniff"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"source": "/(.*)",
|
|
64
|
+
"headers": [
|
|
65
|
+
{
|
|
66
|
+
"key": "X-Frame-Options",
|
|
67
|
+
"value": "DENY"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"key": "X-Content-Type-Options",
|
|
71
|
+
"value": "nosniff"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"key": "Referrer-Policy",
|
|
75
|
+
"value": "strict-origin-when-cross-origin"
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## What This Demonstrates
|
|
84
|
+
|
|
85
|
+
- Per-route header configuration: `/health` and `/mcp` get `Cache-Control: no-store` to prevent caching
|
|
86
|
+
- Global security headers (`X-Frame-Options`, `X-Content-Type-Options`, `Referrer-Policy`) applied to all routes
|
|
87
|
+
- Setting `framework: null` to tell Vercel this is not a framework project
|
|
88
|
+
|
|
89
|
+
## Related
|
|
90
|
+
|
|
91
|
+
- See `deploy-to-vercel-config` for the full reference configuration
|
|
92
|
+
- See `deploy-to-vercel` for the complete deployment guide
|
|
@@ -137,6 +137,16 @@ ls dist/browser/
|
|
|
137
137
|
| Bundle too large | All server-side code included | Use `--target browser` and a dedicated client entry file |
|
|
138
138
|
| `@frontmcp/utils` fs throws | File system ops called in browser | Remove fs calls; use API endpoints or in-memory alternatives |
|
|
139
139
|
|
|
140
|
+
## Examples
|
|
141
|
+
|
|
142
|
+
| Example | Level | Description |
|
|
143
|
+
| ----------------------------------------------------------------------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------------- |
|
|
144
|
+
| [`browser-build-with-custom-entry`](../examples/build-for-browser/browser-build-with-custom-entry.md) | Intermediate | Build a browser bundle using a dedicated client entry file that avoids Node.js-only imports. |
|
|
145
|
+
| [`browser-crypto-and-storage`](../examples/build-for-browser/browser-crypto-and-storage.md) | Advanced | Use `@frontmcp/utils` crypto functions (WebCrypto API) and in-memory storage in browser environments. |
|
|
146
|
+
| [`react-provider-setup`](../examples/build-for-browser/react-provider-setup.md) | Basic | Connect a React application to a remote FrontMCP server using `@frontmcp/react`. |
|
|
147
|
+
|
|
148
|
+
> See all examples in [`examples/build-for-browser/`](../examples/build-for-browser/)
|
|
149
|
+
|
|
140
150
|
## Reference
|
|
141
151
|
|
|
142
152
|
- **Docs:** <https://docs.agentfront.dev/frontmcp/deployment/browser-compatibility>
|
|
@@ -185,6 +185,15 @@ frontmcp service uninstall my-server
|
|
|
185
185
|
| Permission denied on binary | Missing execute permission | Run `chmod +x dist/my-server` |
|
|
186
186
|
| Binary fails on different OS | SEA binaries are platform-specific | Build on the target OS or use CI matrix builds |
|
|
187
187
|
|
|
188
|
+
## Examples
|
|
189
|
+
|
|
190
|
+
| Example | Level | Description |
|
|
191
|
+
| ----------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------ |
|
|
192
|
+
| [`cli-binary-build`](../examples/build-for-cli/cli-binary-build.md) | Basic | Build a FrontMCP server as a standalone binary using Node.js Single Executable Applications (SEA). |
|
|
193
|
+
| [`unix-socket-daemon`](../examples/build-for-cli/unix-socket-daemon.md) | Intermediate | Run a FrontMCP server as a local daemon accessible via Unix socket for IDE extensions and local MCP clients. |
|
|
194
|
+
|
|
195
|
+
> See all examples in [`examples/build-for-cli/`](../examples/build-for-cli/)
|
|
196
|
+
|
|
188
197
|
## Reference
|
|
189
198
|
|
|
190
199
|
- **Docs:** <https://docs.agentfront.dev/frontmcp/deployment/production-build>
|
|
@@ -258,6 +258,16 @@ node -e "const { create } = require('./dist/my-sdk.cjs.js'); ..."
|
|
|
258
258
|
| `connectOpenAI()` format wrong | Using raw `listTools()` instead of platform client | Use `connectOpenAI()` which formats tools for OpenAI automatically |
|
|
259
259
|
| Bundle includes `@frontmcp/*` | Build config missing externals | Verify `--target sdk` is set; it marks `@frontmcp/*` as external |
|
|
260
260
|
|
|
261
|
+
## Examples
|
|
262
|
+
|
|
263
|
+
| Example | Level | Description |
|
|
264
|
+
| ------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------- |
|
|
265
|
+
| [`connect-openai`](../examples/build-for-sdk/connect-openai.md) | Intermediate | Use `connectOpenAI()` to get tools formatted for OpenAI's function-calling API. |
|
|
266
|
+
| [`create-flat-config`](../examples/build-for-sdk/create-flat-config.md) | Basic | Spin up an in-memory FrontMCP server from a flat config object using `create()`. |
|
|
267
|
+
| [`multi-platform-connect`](../examples/build-for-sdk/multi-platform-connect.md) | Advanced | Connect the same FrontMCP server to multiple LLM platforms using platform-specific `connect*()` functions. |
|
|
268
|
+
|
|
269
|
+
> See all examples in [`examples/build-for-sdk/`](../examples/build-for-sdk/)
|
|
270
|
+
|
|
261
271
|
## Reference
|
|
262
272
|
|
|
263
273
|
- **Docs:** <https://docs.agentfront.dev/frontmcp/deployment/direct-client>
|
|
@@ -212,6 +212,16 @@ curl -X POST https://frontmcp-worker.your-subdomain.workers.dev/mcp \
|
|
|
212
212
|
- [ ] SSE streaming works end-to-end (if using SSE transport)
|
|
213
213
|
- [ ] Custom domain resolves correctly (if configured)
|
|
214
214
|
|
|
215
|
+
## Examples
|
|
216
|
+
|
|
217
|
+
| Example | Level | Description |
|
|
218
|
+
| -------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
|
|
219
|
+
| [`basic-worker-deploy`](../examples/deploy-to-cloudflare/basic-worker-deploy.md) | Basic | Deploy a FrontMCP server to Cloudflare Workers with a minimal configuration. |
|
|
220
|
+
| [`worker-custom-domain`](../examples/deploy-to-cloudflare/worker-custom-domain.md) | Advanced | Scaffold a FrontMCP project targeting Cloudflare, configure a custom domain, and verify the deployment. |
|
|
221
|
+
| [`worker-with-kv-storage`](../examples/deploy-to-cloudflare/worker-with-kv-storage.md) | Intermediate | Deploy a FrontMCP server to Cloudflare Workers with KV namespace for session and state storage. |
|
|
222
|
+
|
|
223
|
+
> See all examples in [`examples/deploy-to-cloudflare/`](../examples/deploy-to-cloudflare/)
|
|
224
|
+
|
|
215
225
|
## Reference
|
|
216
226
|
|
|
217
227
|
- **Docs:** <https://docs.agentfront.dev/frontmcp/deployment/serverless>
|
|
@@ -316,6 +316,16 @@ Lambda cold starts occur when a new execution environment is initialized. Strate
|
|
|
316
316
|
| Redis connection refused from Lambda | Lambda not in the same VPC as ElastiCache | Place the Lambda in the ElastiCache VPC with appropriate security group rules |
|
|
317
317
|
| `sam deploy` fails with IAM error | Insufficient permissions for CloudFormation stack creation | Ensure the deploying IAM user/role has `cloudformation:*`, `lambda:*`, `apigateway:*`, and `iam:PassRole` |
|
|
318
318
|
|
|
319
|
+
## Examples
|
|
320
|
+
|
|
321
|
+
| Example | Level | Description |
|
|
322
|
+
| -------------------------------------------------------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------------- |
|
|
323
|
+
| [`cdk-deployment`](../examples/deploy-to-lambda/cdk-deployment.md) | Advanced | Deploy a FrontMCP server to AWS Lambda using CDK with provisioned concurrency and secrets management. |
|
|
324
|
+
| [`lambda-handler-with-cors`](../examples/deploy-to-lambda/lambda-handler-with-cors.md) | Intermediate | Create a custom Lambda handler with an explicit API Gateway definition for CORS support. |
|
|
325
|
+
| [`sam-template-basic`](../examples/deploy-to-lambda/sam-template-basic.md) | Basic | Deploy a FrontMCP server to AWS Lambda with API Gateway using a SAM template. |
|
|
326
|
+
|
|
327
|
+
> See all examples in [`examples/deploy-to-lambda/`](../examples/deploy-to-lambda/)
|
|
328
|
+
|
|
319
329
|
## Reference
|
|
320
330
|
|
|
321
331
|
- **Docs:** https://docs.agentfront.dev/frontmcp/deployment/serverless
|
|
@@ -57,3 +57,12 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
|
57
57
|
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
|
|
58
58
|
|
|
59
59
|
CMD ["node", "dist/main.js"]
|
|
60
|
+
|
|
61
|
+
## Examples
|
|
62
|
+
|
|
63
|
+
| Example | Level | Description |
|
|
64
|
+
| ----------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------ |
|
|
65
|
+
| [`basic-multistage-dockerfile`](../examples/deploy-to-node-dockerfile/basic-multistage-dockerfile.md) | Basic | A minimal multi-stage Dockerfile for building and running a FrontMCP server in production. |
|
|
66
|
+
| [`secure-nonroot-dockerfile`](../examples/deploy-to-node-dockerfile/secure-nonroot-dockerfile.md) | Advanced | A production Dockerfile with a non-root user, proper ownership, and security hardening. |
|
|
67
|
+
|
|
68
|
+
> See all examples in [`examples/deploy-to-node-dockerfile/`](../examples/deploy-to-node-dockerfile/)
|
|
@@ -256,6 +256,16 @@ services:
|
|
|
256
256
|
| Out of memory (OOM kill) | Container memory limit is too low | Increase the memory limit in Docker or set `NODE_OPTIONS="--max-old-space-size=1024"` |
|
|
257
257
|
| PM2 not restarting on reboot | Startup hook was not saved | Run `pm2 save && pm2 startup` to persist the process list across reboots |
|
|
258
258
|
|
|
259
|
+
## Examples
|
|
260
|
+
|
|
261
|
+
| Example | Level | Description |
|
|
262
|
+
| -------------------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------- |
|
|
263
|
+
| [`docker-compose-with-redis`](../examples/deploy-to-node/docker-compose-with-redis.md) | Basic | Deploy a FrontMCP server with Redis using Docker Compose for production. |
|
|
264
|
+
| [`pm2-with-nginx`](../examples/deploy-to-node/pm2-with-nginx.md) | Intermediate | Deploy a FrontMCP server on bare metal using PM2 for process management and NGINX for TLS termination. |
|
|
265
|
+
| [`resource-limits`](../examples/deploy-to-node/resource-limits.md) | Advanced | Configure resource limits, health checks, and environment variables for a production FrontMCP deployment. |
|
|
266
|
+
|
|
267
|
+
> See all examples in [`examples/deploy-to-node/`](../examples/deploy-to-node/)
|
|
268
|
+
|
|
259
269
|
## Reference
|
|
260
270
|
|
|
261
271
|
- **Docs:** https://docs.agentfront.dev/frontmcp/deployment/production-build
|
|
@@ -63,3 +63,12 @@ description: Reference vercel.json configuration for deploying a FrontMCP server
|
|
|
63
63
|
}
|
|
64
64
|
]
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
## Examples
|
|
68
|
+
|
|
69
|
+
| Example | Level | Description |
|
|
70
|
+
| ------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------------------------------------------------------------------------- |
|
|
71
|
+
| [`minimal-vercel-config`](../examples/deploy-to-vercel-config/minimal-vercel-config.md) | Basic | The minimum `vercel.json` needed to deploy a FrontMCP server to Vercel. |
|
|
72
|
+
| [`vercel-config-with-security-headers`](../examples/deploy-to-vercel-config/vercel-config-with-security-headers.md) | Intermediate | A complete `vercel.json` with per-route security headers for health, MCP, and all other endpoints. |
|
|
73
|
+
|
|
74
|
+
> See all examples in [`examples/deploy-to-vercel-config/`](../examples/deploy-to-vercel-config/)
|
|
@@ -223,6 +223,16 @@ Serverless functions are stateless between invocations. All persistent state mus
|
|
|
223
223
|
| Bundle too large | Unnecessary dependencies included | Review dependencies and remove unused packages to reduce bundle size |
|
|
224
224
|
| Cold starts too slow | Low function memory or large bundle | Increase memory to 1024 MB; audit dependencies; consider Vercel Fluid Compute |
|
|
225
225
|
|
|
226
|
+
## Examples
|
|
227
|
+
|
|
228
|
+
| Example | Level | Description |
|
|
229
|
+
| -------------------------------------------------------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------- |
|
|
230
|
+
| [`vercel-mcp-endpoint-test`](../examples/deploy-to-vercel/vercel-mcp-endpoint-test.md) | Advanced | Verify a Vercel-deployed FrontMCP server by testing health, tool listing, and tool invocation. |
|
|
231
|
+
| [`vercel-with-kv`](../examples/deploy-to-vercel/vercel-with-kv.md) | Basic | Deploy a FrontMCP server to Vercel serverless functions with Vercel KV for session persistence. |
|
|
232
|
+
| [`vercel-with-skills-cache`](../examples/deploy-to-vercel/vercel-with-skills-cache.md) | Intermediate | Deploy a FrontMCP server to Vercel with skills enabled and KV-backed skill caching. |
|
|
233
|
+
|
|
234
|
+
> See all examples in [`examples/deploy-to-vercel/`](../examples/deploy-to-vercel/)
|
|
235
|
+
|
|
226
236
|
## Reference
|
|
227
237
|
|
|
228
238
|
- **Docs:** https://docs.agentfront.dev/frontmcp/deployment/serverless
|
|
@@ -9,7 +9,7 @@ priority: 10
|
|
|
9
9
|
visibility: both
|
|
10
10
|
license: Apache-2.0
|
|
11
11
|
metadata:
|
|
12
|
-
docs: https://docs.agentfront.dev/frontmcp/
|
|
12
|
+
docs: https://docs.agentfront.dev/frontmcp/fundamentals/overview
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
# FrontMCP Development Router
|
|
@@ -122,5 +122,5 @@ Entry point for building MCP server components. This skill helps you find the ri
|
|
|
122
122
|
|
|
123
123
|
## Reference
|
|
124
124
|
|
|
125
|
-
- [
|
|
125
|
+
- [FrontMCP Overview](https://docs.agentfront.dev/frontmcp/fundamentals/overview)
|
|
126
126
|
- Related skills: `create-tool`, `create-resource`, `create-prompt`, `create-agent`, `create-provider`, `create-job`, `create-workflow`, `create-skill`, `create-skill-with-tools`, `decorators-guide`, `official-adapters`, `official-plugins`
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: basic-api-adapter
|
|
3
|
+
reference: create-adapter
|
|
4
|
+
level: basic
|
|
5
|
+
description: 'A minimal adapter that fetches operation definitions from an external API and generates MCP tools.'
|
|
6
|
+
tags: [development, adapter, api]
|
|
7
|
+
features:
|
|
8
|
+
- 'Extending `DynamicAdapter<TOptions>` with a typed options interface'
|
|
9
|
+
- 'Declaring `__options_brand` for proper TypeScript inference on `init()`'
|
|
10
|
+
- 'Implementing `fetch()` to return `FrontMcpAdapterResponse` with tools, resources, and prompts'
|
|
11
|
+
- 'Registering the adapter via the static `init()` method in the `adapters` array'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Basic Dynamic Adapter
|
|
15
|
+
|
|
16
|
+
A minimal adapter that fetches operation definitions from an external API and generates MCP tools.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// src/adapters/my-api.adapter.ts
|
|
22
|
+
import { DynamicAdapter, type FrontMcpAdapterResponse } from '@frontmcp/sdk';
|
|
23
|
+
|
|
24
|
+
interface MyAdapterOptions {
|
|
25
|
+
endpoint: string;
|
|
26
|
+
apiKey: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class MyApiAdapter extends DynamicAdapter<MyAdapterOptions> {
|
|
30
|
+
declare __options_brand: MyAdapterOptions;
|
|
31
|
+
|
|
32
|
+
async fetch(): Promise<FrontMcpAdapterResponse> {
|
|
33
|
+
// Fetch definitions from external source
|
|
34
|
+
const res = await globalThis.fetch(this.options.endpoint, {
|
|
35
|
+
headers: { Authorization: `Bearer ${this.options.apiKey}` },
|
|
36
|
+
});
|
|
37
|
+
const schema = await res.json();
|
|
38
|
+
|
|
39
|
+
// Convert to MCP tool definitions
|
|
40
|
+
return {
|
|
41
|
+
tools: schema.operations.map((op: { name: string; description: string; params: Record<string, unknown> }) => ({
|
|
42
|
+
name: op.name,
|
|
43
|
+
description: op.description,
|
|
44
|
+
inputSchema: this.convertParams(op.params),
|
|
45
|
+
execute: async (input: Record<string, unknown>) => {
|
|
46
|
+
return this.callApi(op.name, input);
|
|
47
|
+
},
|
|
48
|
+
})),
|
|
49
|
+
resources: [],
|
|
50
|
+
prompts: [],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private convertParams(params: Record<string, unknown>) {
|
|
55
|
+
// Convert external param definitions to Zod schemas
|
|
56
|
+
return {};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private async callApi(operation: string, input: Record<string, unknown>) {
|
|
60
|
+
// Call the external API
|
|
61
|
+
return {};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
// src/server.ts
|
|
68
|
+
import { App } from '@frontmcp/sdk';
|
|
69
|
+
|
|
70
|
+
@App({
|
|
71
|
+
name: 'MyApp',
|
|
72
|
+
adapters: [
|
|
73
|
+
MyApiAdapter.init({
|
|
74
|
+
name: 'my-api',
|
|
75
|
+
endpoint: 'https://api.example.com/schema',
|
|
76
|
+
apiKey: process.env.API_KEY!,
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
})
|
|
80
|
+
class MyApp {}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## What This Demonstrates
|
|
84
|
+
|
|
85
|
+
- Extending `DynamicAdapter<TOptions>` with a typed options interface
|
|
86
|
+
- Declaring `__options_brand` for proper TypeScript inference on `init()`
|
|
87
|
+
- Implementing `fetch()` to return `FrontMcpAdapterResponse` with tools, resources, and prompts
|
|
88
|
+
- Registering the adapter via the static `init()` method in the `adapters` array
|
|
89
|
+
|
|
90
|
+
## Related
|
|
91
|
+
|
|
92
|
+
- See `create-adapter` for namespacing, error handling, and the full adapter response interface
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: namespaced-adapter
|
|
3
|
+
reference: create-adapter
|
|
4
|
+
level: intermediate
|
|
5
|
+
description: 'An adapter that namespaces generated tools to avoid collisions and includes proper error handling for startup failures.'
|
|
6
|
+
tags: [development, adapter, namespaced]
|
|
7
|
+
features:
|
|
8
|
+
- "Namespacing tools with `name: 'adapter-name:operation-name'` to prevent collisions"
|
|
9
|
+
- 'Throwing descriptive errors in `fetch()` so misconfigurations surface at startup'
|
|
10
|
+
- 'Registering multiple instances of the same adapter class with different configurations'
|
|
11
|
+
- 'Validating the external response shape before generating tool definitions'
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Namespaced Adapter with Error Handling
|
|
15
|
+
|
|
16
|
+
An adapter that namespaces generated tools to avoid collisions and includes proper error handling for startup failures.
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// src/adapters/graphql-api.adapter.ts
|
|
22
|
+
import { DynamicAdapter, type FrontMcpAdapterResponse } from '@frontmcp/sdk';
|
|
23
|
+
|
|
24
|
+
interface GraphqlAdapterOptions {
|
|
25
|
+
endpoint: string;
|
|
26
|
+
apiKey: string;
|
|
27
|
+
namespace?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
class GraphqlApiAdapter extends DynamicAdapter<GraphqlAdapterOptions> {
|
|
31
|
+
declare __options_brand: GraphqlAdapterOptions;
|
|
32
|
+
|
|
33
|
+
async fetch(): Promise<FrontMcpAdapterResponse> {
|
|
34
|
+
const namespace = this.options.namespace ?? this.options.name;
|
|
35
|
+
|
|
36
|
+
// Fetch schema from GraphQL introspection
|
|
37
|
+
const res = await globalThis.fetch(this.options.endpoint, {
|
|
38
|
+
method: 'POST',
|
|
39
|
+
headers: {
|
|
40
|
+
'Content-Type': 'application/json',
|
|
41
|
+
Authorization: `Bearer ${this.options.apiKey}`,
|
|
42
|
+
},
|
|
43
|
+
body: JSON.stringify({
|
|
44
|
+
query: '{ __schema { queryType { fields { name description } } } }',
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (!res.ok) {
|
|
49
|
+
throw new Error(`GraphQL adapter failed to fetch schema from ${this.options.endpoint}: HTTP ${res.status}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const schema = await res.json();
|
|
53
|
+
const fields = schema.data?.__schema?.queryType?.fields;
|
|
54
|
+
|
|
55
|
+
if (!fields || !Array.isArray(fields)) {
|
|
56
|
+
throw new Error(`GraphQL adapter received unexpected schema format from ${this.options.endpoint}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Namespace tools to prevent collisions across adapters
|
|
60
|
+
return {
|
|
61
|
+
tools: fields.map((field: { name: string; description: string }) => ({
|
|
62
|
+
name: `${namespace}:${field.name}`,
|
|
63
|
+
description: field.description || `Query ${field.name} from GraphQL API`,
|
|
64
|
+
inputSchema: {},
|
|
65
|
+
execute: async (input: Record<string, unknown>) => {
|
|
66
|
+
return this.executeQuery(field.name, input);
|
|
67
|
+
},
|
|
68
|
+
})),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private async executeQuery(queryName: string, variables: Record<string, unknown>) {
|
|
73
|
+
const res = await globalThis.fetch(this.options.endpoint, {
|
|
74
|
+
method: 'POST',
|
|
75
|
+
headers: {
|
|
76
|
+
'Content-Type': 'application/json',
|
|
77
|
+
Authorization: `Bearer ${this.options.apiKey}`,
|
|
78
|
+
},
|
|
79
|
+
body: JSON.stringify({ query: `{ ${queryName} }`, variables }),
|
|
80
|
+
});
|
|
81
|
+
return res.json();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// src/server.ts
|
|
88
|
+
import { FrontMcp, App } from '@frontmcp/sdk';
|
|
89
|
+
|
|
90
|
+
@App({
|
|
91
|
+
name: 'DataApp',
|
|
92
|
+
adapters: [
|
|
93
|
+
// Each adapter uses its name for tool namespacing
|
|
94
|
+
GraphqlApiAdapter.init({
|
|
95
|
+
name: 'users-api',
|
|
96
|
+
endpoint: 'https://users.example.com/graphql',
|
|
97
|
+
apiKey: process.env.USERS_API_KEY!,
|
|
98
|
+
}),
|
|
99
|
+
GraphqlApiAdapter.init({
|
|
100
|
+
name: 'orders-api',
|
|
101
|
+
endpoint: 'https://orders.example.com/graphql',
|
|
102
|
+
apiKey: process.env.ORDERS_API_KEY!,
|
|
103
|
+
}),
|
|
104
|
+
],
|
|
105
|
+
})
|
|
106
|
+
class DataApp {}
|
|
107
|
+
|
|
108
|
+
@FrontMcp({
|
|
109
|
+
info: { name: 'data-server', version: '1.0.0' },
|
|
110
|
+
apps: [DataApp],
|
|
111
|
+
})
|
|
112
|
+
class DataServer {}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## What This Demonstrates
|
|
116
|
+
|
|
117
|
+
- Namespacing tools with `name: 'adapter-name:operation-name'` to prevent collisions
|
|
118
|
+
- Throwing descriptive errors in `fetch()` so misconfigurations surface at startup
|
|
119
|
+
- Registering multiple instances of the same adapter class with different configurations
|
|
120
|
+
- Validating the external response shape before generating tool definitions
|
|
121
|
+
|
|
122
|
+
## Related
|
|
123
|
+
|
|
124
|
+
- See `create-adapter` for the full `FrontMcpAdapterResponse` interface, Nx generator, and verification checklist
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: basic-agent-with-tools
|
|
3
|
+
reference: create-agent
|
|
4
|
+
level: basic
|
|
5
|
+
description: 'An autonomous agent that uses inner tools to review GitHub pull requests.'
|
|
6
|
+
tags: [development, anthropic, agent, tools]
|
|
7
|
+
features:
|
|
8
|
+
- 'Creating an agent with `@Agent` decorator, `llm` config, and `inputSchema`'
|
|
9
|
+
- 'Defining inner tools in the `tools` array that the agent can invoke during its reasoning loop'
|
|
10
|
+
- "Using `{ env: 'ANTHROPIC_API_KEY' }` for safe API key configuration"
|
|
11
|
+
- 'Inner tools are private to the agent and not exposed to external MCP clients'
|
|
12
|
+
- 'The default `execute()` runs the full agent loop without needing an override'
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Basic Agent with Inner Tools
|
|
16
|
+
|
|
17
|
+
An autonomous agent that uses inner tools to review GitHub pull requests.
|
|
18
|
+
|
|
19
|
+
## Code
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
// src/apps/review/tools/fetch-pr.tool.ts
|
|
23
|
+
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
24
|
+
import { z } from 'zod';
|
|
25
|
+
|
|
26
|
+
@Tool({
|
|
27
|
+
name: 'fetch_pr',
|
|
28
|
+
description: 'Fetch pull request details from GitHub',
|
|
29
|
+
inputSchema: {
|
|
30
|
+
owner: z.string(),
|
|
31
|
+
repo: z.string(),
|
|
32
|
+
number: z.number(),
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
class FetchPRTool extends ToolContext {
|
|
36
|
+
async execute(input: { owner: string; repo: string; number: number }) {
|
|
37
|
+
const response = await this.fetch(
|
|
38
|
+
`https://api.github.com/repos/${input.owner}/${input.repo}/pulls/${input.number}`,
|
|
39
|
+
);
|
|
40
|
+
return response.json();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
// src/apps/review/tools/post-review.tool.ts
|
|
47
|
+
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
48
|
+
import { z } from 'zod';
|
|
49
|
+
|
|
50
|
+
@Tool({
|
|
51
|
+
name: 'post_review_comment',
|
|
52
|
+
description: 'Post a review comment on a PR',
|
|
53
|
+
inputSchema: {
|
|
54
|
+
owner: z.string(),
|
|
55
|
+
repo: z.string(),
|
|
56
|
+
number: z.number(),
|
|
57
|
+
body: z.string(),
|
|
58
|
+
},
|
|
59
|
+
})
|
|
60
|
+
class PostReviewCommentTool extends ToolContext {
|
|
61
|
+
async execute(input: { owner: string; repo: string; number: number; body: string }) {
|
|
62
|
+
await this.fetch(`https://api.github.com/repos/${input.owner}/${input.repo}/pulls/${input.number}/reviews`, {
|
|
63
|
+
method: 'POST',
|
|
64
|
+
body: JSON.stringify({ body: input.body, event: 'COMMENT' }),
|
|
65
|
+
});
|
|
66
|
+
return 'Comment posted';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
// src/apps/review/agents/pr-reviewer.agent.ts
|
|
73
|
+
import { Agent, AgentContext } from '@frontmcp/sdk';
|
|
74
|
+
import { z } from 'zod';
|
|
75
|
+
|
|
76
|
+
@Agent({
|
|
77
|
+
name: 'pr_reviewer',
|
|
78
|
+
description: 'Autonomously reviews GitHub pull requests',
|
|
79
|
+
llm: {
|
|
80
|
+
provider: 'anthropic',
|
|
81
|
+
model: 'claude-sonnet-4-20250514',
|
|
82
|
+
apiKey: { env: 'ANTHROPIC_API_KEY' },
|
|
83
|
+
},
|
|
84
|
+
inputSchema: {
|
|
85
|
+
owner: z.string().describe('Repository owner'),
|
|
86
|
+
repo: z.string().describe('Repository name'),
|
|
87
|
+
prNumber: z.number().describe('PR number to review'),
|
|
88
|
+
},
|
|
89
|
+
systemInstructions: 'You are a senior code reviewer. Fetch the PR, analyze changes, and post a thorough review.',
|
|
90
|
+
tools: [FetchPRTool, PostReviewCommentTool],
|
|
91
|
+
})
|
|
92
|
+
class PRReviewerAgent extends AgentContext {
|
|
93
|
+
// Default execute() runs the agent loop.
|
|
94
|
+
// The agent will autonomously call FetchPRTool, analyze the diff,
|
|
95
|
+
// and call PostReviewCommentTool to leave a review.
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
// src/apps/review/index.ts
|
|
101
|
+
import { App } from '@frontmcp/sdk';
|
|
102
|
+
|
|
103
|
+
@App({
|
|
104
|
+
name: 'review-app',
|
|
105
|
+
agents: [PRReviewerAgent],
|
|
106
|
+
})
|
|
107
|
+
class ReviewApp {}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## What This Demonstrates
|
|
111
|
+
|
|
112
|
+
- Creating an agent with `@Agent` decorator, `llm` config, and `inputSchema`
|
|
113
|
+
- Defining inner tools in the `tools` array that the agent can invoke during its reasoning loop
|
|
114
|
+
- Using `{ env: 'ANTHROPIC_API_KEY' }` for safe API key configuration
|
|
115
|
+
- Inner tools are private to the agent and not exposed to external MCP clients
|
|
116
|
+
- The default `execute()` runs the full agent loop without needing an override
|
|
117
|
+
|
|
118
|
+
## Related
|
|
119
|
+
|
|
120
|
+
- See `create-agent` for custom execute, sub-agents, swarm configuration, and exported tools
|
|
121
|
+
- See `create-agent-llm-config` for all supported LLM providers and model options
|