@frontmcp/skills 1.0.3 → 1.1.0-beta.1

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.
Files changed (141) hide show
  1. package/catalog/frontmcp-authorities/SKILL.md +272 -0
  2. package/catalog/frontmcp-authorities/references/authority-profiles.md +262 -0
  3. package/catalog/frontmcp-authorities/references/claims-mapping.md +266 -0
  4. package/catalog/frontmcp-authorities/references/custom-evaluators.md +420 -0
  5. package/catalog/frontmcp-authorities/references/rbac-abac-rebac.md +391 -0
  6. package/catalog/frontmcp-channels/SKILL.md +122 -0
  7. package/catalog/frontmcp-channels/examples/channel-sources/agent-notify.md +70 -0
  8. package/catalog/frontmcp-channels/examples/channel-sources/app-errors.md +71 -0
  9. package/catalog/frontmcp-channels/examples/channel-sources/file-watcher.md +102 -0
  10. package/catalog/frontmcp-channels/examples/channel-sources/job-completion.md +79 -0
  11. package/catalog/frontmcp-channels/examples/channel-sources/replay-buffer.md +106 -0
  12. package/catalog/frontmcp-channels/examples/channel-sources/service-connector.md +136 -0
  13. package/catalog/frontmcp-channels/examples/channel-sources/webhook-github.md +85 -0
  14. package/catalog/frontmcp-channels/examples/channel-two-way/whatsapp-bridge.md +133 -0
  15. package/catalog/frontmcp-channels/references/channel-sources.md +214 -0
  16. package/catalog/frontmcp-channels/references/channel-two-way.md +195 -0
  17. package/catalog/frontmcp-config/SKILL.md +20 -18
  18. package/catalog/frontmcp-config/examples/configure-auth/multi-app-auth.md +1 -2
  19. package/catalog/frontmcp-config/examples/configure-auth/public-mode-setup.md +1 -2
  20. package/catalog/frontmcp-config/examples/configure-auth/remote-oauth-with-vault.md +1 -2
  21. package/catalog/frontmcp-config/examples/configure-auth-modes/local-self-signed-tokens.md +1 -2
  22. package/catalog/frontmcp-config/examples/configure-auth-modes/remote-enterprise-oauth.md +1 -2
  23. package/catalog/frontmcp-config/examples/configure-auth-modes/transparent-jwt-validation.md +1 -2
  24. package/catalog/frontmcp-config/examples/configure-deployment-targets/distributed-ha-config.md +121 -0
  25. package/catalog/frontmcp-config/examples/configure-deployment-targets/json-schema-ide-support.md +64 -0
  26. package/catalog/frontmcp-config/examples/configure-deployment-targets/multi-target-with-security.md +113 -0
  27. package/catalog/frontmcp-config/examples/configure-elicitation/basic-confirmation-gate.md +1 -2
  28. package/catalog/frontmcp-config/examples/configure-elicitation/distributed-elicitation-redis.md +1 -2
  29. package/catalog/frontmcp-config/examples/configure-http/entry-path-reverse-proxy.md +1 -2
  30. package/catalog/frontmcp-config/examples/configure-http/unix-socket-local.md +1 -2
  31. package/catalog/frontmcp-config/examples/configure-security-headers/csp-report-only.md +69 -0
  32. package/catalog/frontmcp-config/examples/configure-security-headers/full-production-headers.md +91 -0
  33. package/catalog/frontmcp-config/examples/configure-throttle/distributed-redis-throttle.md +1 -2
  34. package/catalog/frontmcp-config/examples/configure-throttle/per-tool-rate-limit.md +1 -2
  35. package/catalog/frontmcp-config/examples/configure-throttle/server-level-rate-limit.md +1 -2
  36. package/catalog/frontmcp-config/examples/configure-transport/custom-protocol-flags.md +1 -2
  37. package/catalog/frontmcp-config/examples/configure-transport/distributed-sessions-redis.md +1 -2
  38. package/catalog/frontmcp-config/examples/configure-transport/stateless-serverless.md +1 -2
  39. package/catalog/frontmcp-config/examples/configure-transport-protocol-presets/legacy-preset-nodejs.md +1 -2
  40. package/catalog/frontmcp-config/examples/configure-transport-protocol-presets/stateless-api-serverless.md +1 -2
  41. package/catalog/frontmcp-config/references/configure-deployment-targets.md +214 -0
  42. package/catalog/frontmcp-config/references/configure-elicitation.md +1 -2
  43. package/catalog/frontmcp-config/references/configure-security-headers.md +198 -0
  44. package/catalog/frontmcp-deployment/SKILL.md +1 -0
  45. package/catalog/frontmcp-deployment/examples/build-for-cli/cli-binary-build.md +1 -2
  46. package/catalog/frontmcp-deployment/examples/build-for-cli/unix-socket-daemon.md +1 -2
  47. package/catalog/frontmcp-deployment/examples/build-for-mcpb/mcpb-bundle-build.md +117 -0
  48. package/catalog/frontmcp-deployment/examples/build-for-sdk/connect-openai.md +1 -3
  49. package/catalog/frontmcp-deployment/examples/build-for-sdk/create-flat-config.md +1 -2
  50. package/catalog/frontmcp-deployment/examples/build-for-sdk/multi-platform-connect.md +3 -3
  51. package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/basic-worker-deploy.md +1 -2
  52. package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-custom-domain.md +1 -2
  53. package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-with-kv-storage.md +1 -2
  54. package/catalog/frontmcp-deployment/examples/deploy-to-lambda/lambda-handler-with-cors.md +1 -2
  55. package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-with-kv.md +1 -2
  56. package/catalog/frontmcp-deployment/examples/mcp-client-integration/http-remote.md +106 -0
  57. package/catalog/frontmcp-deployment/examples/mcp-client-integration/stdio-binary-with-env.md +107 -0
  58. package/catalog/frontmcp-deployment/examples/mcp-client-integration/stdio-npx.md +89 -0
  59. package/catalog/frontmcp-deployment/references/build-for-mcpb.md +209 -0
  60. package/catalog/frontmcp-deployment/references/build-for-sdk.md +1 -2
  61. package/catalog/frontmcp-deployment/references/mcp-client-integration.md +225 -0
  62. package/catalog/frontmcp-development/SKILL.md +4 -3
  63. package/catalog/frontmcp-development/examples/create-agent/basic-agent-with-tools.md +3 -6
  64. package/catalog/frontmcp-development/examples/create-agent/custom-multi-pass-agent.md +1 -2
  65. package/catalog/frontmcp-development/examples/create-agent/nested-agents-with-swarm.md +2 -4
  66. package/catalog/frontmcp-development/examples/create-agent-llm-config/anthropic-config.md +1 -2
  67. package/catalog/frontmcp-development/examples/create-agent-llm-config/openai-config.md +1 -2
  68. package/catalog/frontmcp-development/examples/create-job/basic-report-job.md +1 -2
  69. package/catalog/frontmcp-development/examples/create-job/job-with-permissions.md +2 -3
  70. package/catalog/frontmcp-development/examples/create-job/job-with-retry.md +1 -2
  71. package/catalog/frontmcp-development/examples/create-plugin-hooks/tool-level-hooks-and-stage-replacement.md +2 -5
  72. package/catalog/frontmcp-development/examples/create-provider/basic-database-provider.md +4 -3
  73. package/catalog/frontmcp-development/examples/create-skill-with-tools/directory-skill-with-tools.md +2 -3
  74. package/catalog/frontmcp-development/examples/create-tool/basic-class-tool.md +1 -2
  75. package/catalog/frontmcp-development/examples/create-tool/tool-with-di-and-errors.md +2 -2
  76. package/catalog/frontmcp-development/examples/create-tool/tool-with-rate-limiting-and-progress.md +1 -2
  77. package/catalog/frontmcp-development/examples/create-tool-annotations/destructive-delete-tool.md +2 -4
  78. package/catalog/frontmcp-development/examples/create-tool-annotations/readonly-query-tool.md +1 -2
  79. package/catalog/frontmcp-development/examples/create-tool-output-schema-types/primitive-and-media-outputs.md +3 -6
  80. package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-raw-shape-output.md +1 -2
  81. package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-schema-advanced-output.md +2 -4
  82. package/catalog/frontmcp-development/examples/decorators-guide/agent-skill-job-workflow.md +3 -5
  83. package/catalog/frontmcp-development/examples/decorators-guide/basic-server-with-app-and-tools.md +5 -5
  84. package/catalog/frontmcp-development/examples/decorators-guide/multi-app-with-plugins-and-providers.md +4 -6
  85. package/catalog/frontmcp-development/examples/official-plugins/cache-and-feature-flags.md +3 -5
  86. package/catalog/frontmcp-development/examples/official-plugins/production-multi-plugin-setup.md +4 -5
  87. package/catalog/frontmcp-development/examples/official-plugins/remember-plugin-session-memory.md +3 -5
  88. package/catalog/frontmcp-development/examples/{official-adapters → openapi-adapter}/authenticated-adapter-with-polling.md +2 -2
  89. package/catalog/frontmcp-development/examples/{official-adapters → openapi-adapter}/basic-openapi-adapter.md +2 -2
  90. package/catalog/frontmcp-development/examples/openapi-adapter/format-resolution-and-custom-resolvers.md +108 -0
  91. package/catalog/frontmcp-development/examples/{official-adapters → openapi-adapter}/multi-api-hub-with-inline-spec.md +2 -2
  92. package/catalog/frontmcp-development/examples/openapi-adapter/ref-security-and-filtering.md +111 -0
  93. package/catalog/frontmcp-development/references/create-agent.md +4 -7
  94. package/catalog/frontmcp-development/references/create-job.md +3 -6
  95. package/catalog/frontmcp-development/references/create-plugin-hooks.md +12 -16
  96. package/catalog/frontmcp-development/references/create-skill-with-tools.md +2 -3
  97. package/catalog/frontmcp-development/references/create-tool.md +93 -23
  98. package/catalog/frontmcp-development/references/create-workflow.md +2 -3
  99. package/catalog/frontmcp-development/references/decorators-guide.md +32 -36
  100. package/catalog/frontmcp-development/references/official-adapters.md +24 -153
  101. package/catalog/frontmcp-development/references/openapi-adapter.md +431 -0
  102. package/catalog/frontmcp-extensibility/examples/vectoriadb/product-catalog-search.md +4 -4
  103. package/catalog/frontmcp-extensibility/examples/vectoriadb/semantic-search-with-persistence.md +4 -4
  104. package/catalog/frontmcp-extensibility/examples/vectoriadb/tfidf-keyword-search.md +4 -3
  105. package/catalog/frontmcp-guides/SKILL.md +3 -3
  106. package/catalog/frontmcp-guides/examples/example-knowledge-base/agent-and-plugin.md +4 -5
  107. package/catalog/frontmcp-guides/examples/example-knowledge-base/vector-search-and-resources.md +4 -3
  108. package/catalog/frontmcp-guides/examples/example-task-manager/auth-and-crud-tools.md +4 -4
  109. package/catalog/frontmcp-guides/examples/example-weather-api/weather-tool-with-schemas.md +1 -2
  110. package/catalog/frontmcp-guides/references/example-knowledge-base.md +22 -17
  111. package/catalog/frontmcp-guides/references/example-task-manager.md +16 -11
  112. package/catalog/frontmcp-guides/references/example-weather-api.md +6 -3
  113. package/catalog/frontmcp-observability/examples/telemetry-api/tool-custom-spans.md +2 -3
  114. package/catalog/frontmcp-observability/examples/tracing-setup/basic-tracing.md +4 -3
  115. package/catalog/frontmcp-observability/references/telemetry-api.md +2 -3
  116. package/catalog/frontmcp-production-readiness/examples/common-checklist/observability-setup.md +1 -2
  117. package/catalog/frontmcp-production-readiness/examples/common-checklist/security-hardening.md +3 -4
  118. package/catalog/frontmcp-production-readiness/examples/distributed-ha/ha-kubernetes-3-replicas.md +229 -0
  119. package/catalog/frontmcp-production-readiness/examples/production-browser/cross-platform-crypto.md +2 -3
  120. package/catalog/frontmcp-production-readiness/examples/production-cli-binary/stdio-transport-error-handling.md +1 -2
  121. package/catalog/frontmcp-production-readiness/examples/production-cloudflare/durable-objects-state.md +2 -4
  122. package/catalog/frontmcp-production-readiness/examples/production-cloudflare/workers-runtime-constraints.md +2 -3
  123. package/catalog/frontmcp-production-readiness/examples/production-lambda/cold-start-connection-reuse.md +3 -2
  124. package/catalog/frontmcp-production-readiness/examples/production-vercel/cold-start-optimization.md +2 -2
  125. package/catalog/frontmcp-production-readiness/examples/production-vercel/stateless-serverless-design.md +3 -3
  126. package/catalog/frontmcp-production-readiness/references/distributed-ha.md +194 -0
  127. package/catalog/frontmcp-setup/SKILL.md +11 -11
  128. package/catalog/frontmcp-setup/examples/project-structure-standalone/feature-folder-organization.md +5 -3
  129. package/catalog/frontmcp-setup/examples/project-structure-standalone/minimal-standalone-layout.md +4 -2
  130. package/catalog/frontmcp-setup/examples/setup-project/basic-node-server.md +4 -2
  131. package/catalog/frontmcp-setup/examples/setup-project/vercel-serverless-server.md +4 -2
  132. package/catalog/frontmcp-setup/examples/setup-redis/hybrid-vercel-kv-with-pubsub.md +8 -7
  133. package/catalog/frontmcp-setup/references/setup-project.md +10 -9
  134. package/catalog/frontmcp-setup/references/setup-redis.md +19 -16
  135. package/catalog/frontmcp-testing/examples/test-direct-client/basic-create-test.md +1 -3
  136. package/catalog/frontmcp-testing/examples/test-direct-client/openai-claude-format-test.md +1 -3
  137. package/catalog/frontmcp-testing/examples/test-tool-unit/schema-validation-test.md +2 -2
  138. package/catalog/frontmcp-testing/references/test-direct-client.md +1 -3
  139. package/catalog/frontmcp-testing/references/test-tool-unit.md +2 -2
  140. package/catalog/skills-manifest.json +364 -12
  141. package/package.json +1 -1
@@ -47,8 +47,7 @@ class AuditPlugin {}
47
47
 
48
48
  ```typescript
49
49
  // src/tools/query.tool.ts
50
- import { Tool, ToolContext } from '@frontmcp/sdk';
51
- import { z } from 'zod';
50
+ import { Tool, ToolContext, z } from '@frontmcp/sdk';
52
51
 
53
52
  @Tool({
54
53
  name: 'run_query',
@@ -68,8 +67,7 @@ class QueryTool extends ToolContext {
68
67
 
69
68
  ```typescript
70
69
  // src/tools/report.tool.ts
71
- import { Tool, ToolContext } from '@frontmcp/sdk';
72
- import { z } from 'zod';
70
+ import { Tool, ToolContext, z } from '@frontmcp/sdk';
73
71
 
74
72
  @Tool({
75
73
  name: 'generate_report',
@@ -90,7 +88,7 @@ class ReportTool extends ToolContext {
90
88
 
91
89
  ```typescript
92
90
  // src/resources/dashboard.resource.ts
93
- import { ResourceTemplate, ResourceContext } from '@frontmcp/sdk';
91
+ import { ResourceContext, ResourceTemplate } from '@frontmcp/sdk';
94
92
 
95
93
  @ResourceTemplate({
96
94
  name: 'dashboard',
@@ -109,7 +107,7 @@ class DashboardResource extends ResourceContext {
109
107
 
110
108
  ```typescript
111
109
  // src/server.ts
112
- import { FrontMcp, App } from '@frontmcp/sdk';
110
+ import { App, FrontMcp } from '@frontmcp/sdk';
113
111
 
114
112
  @App({
115
113
  name: 'analytics',
@@ -21,9 +21,9 @@ Demonstrates combining the Cache plugin for tool result caching with the Feature
21
21
 
22
22
  ```typescript
23
23
  // src/server.ts
24
- import { FrontMcp, App } from '@frontmcp/sdk';
25
24
  import CachePlugin from '@frontmcp/plugin-cache';
26
25
  import FeatureFlagPlugin from '@frontmcp/plugin-feature-flags';
26
+ import { App, FrontMcp } from '@frontmcp/sdk';
27
27
 
28
28
  @App({
29
29
  name: 'api',
@@ -55,8 +55,7 @@ class MyServer {}
55
55
 
56
56
  ```typescript
57
57
  // src/tools/get-weather.tool.ts
58
- import { Tool, ToolContext } from '@frontmcp/sdk';
59
- import { z } from 'zod';
58
+ import { Tool, ToolContext, z } from '@frontmcp/sdk';
60
59
 
61
60
  // Per-tool cache metadata with custom TTL and sliding window
62
61
  @Tool({
@@ -80,8 +79,7 @@ class GetWeatherTool extends ToolContext {
80
79
 
81
80
  ```typescript
82
81
  // src/tools/beta-search.tool.ts
83
- import { Tool, ToolContext } from '@frontmcp/sdk';
84
- import { z } from 'zod';
82
+ import { Tool, ToolContext, z } from '@frontmcp/sdk';
85
83
 
86
84
  // Tool gated behind a feature flag -- hidden from list_tools when flag is off
87
85
  @Tool({
@@ -24,12 +24,12 @@ Demonstrates a production-ready server configuration combining CodeCall, Remembe
24
24
 
25
25
  ```typescript
26
26
  // src/server.ts
27
- import { FrontMcp, App } from '@frontmcp/sdk';
28
- import CodeCallPlugin from '@frontmcp/plugin-codecall';
29
- import RememberPlugin from '@frontmcp/plugin-remember';
30
27
  import { ApprovalPlugin } from '@frontmcp/plugin-approval';
31
28
  import CachePlugin from '@frontmcp/plugin-cache';
29
+ import CodeCallPlugin from '@frontmcp/plugin-codecall';
32
30
  import FeatureFlagPlugin from '@frontmcp/plugin-feature-flags';
31
+ import RememberPlugin from '@frontmcp/plugin-remember';
32
+ import { App, FrontMcp } from '@frontmcp/sdk';
33
33
 
34
34
  @App({ name: 'core', tools: [ReadDataTool, WriteDataTool, DeleteDataTool] })
35
35
  class CoreApp {}
@@ -89,8 +89,7 @@ class ProductionServer {}
89
89
 
90
90
  ```typescript
91
91
  // src/tools/delete-data.tool.ts
92
- import { Tool, ToolContext } from '@frontmcp/sdk';
93
- import { z } from 'zod';
92
+ import { Tool, ToolContext, z } from '@frontmcp/sdk';
94
93
 
95
94
  @Tool({
96
95
  name: 'delete_data',
@@ -20,8 +20,8 @@ Demonstrates installing the Remember plugin and using `this.remember` in tools t
20
20
 
21
21
  ```typescript
22
22
  // src/server.ts
23
- import { FrontMcp, App } from '@frontmcp/sdk';
24
23
  import RememberPlugin from '@frontmcp/plugin-remember';
24
+ import { App, FrontMcp } from '@frontmcp/sdk';
25
25
 
26
26
  @App({ name: 'my-app', tools: [PreferencesTool, GreetingTool] })
27
27
  class MyApp {}
@@ -41,8 +41,7 @@ class MyServer {}
41
41
 
42
42
  ```typescript
43
43
  // src/tools/preferences.tool.ts
44
- import { Tool, ToolContext } from '@frontmcp/sdk';
45
- import { z } from 'zod';
44
+ import { Tool, ToolContext, z } from '@frontmcp/sdk';
46
45
 
47
46
  @Tool({
48
47
  name: 'set_preferences',
@@ -64,8 +63,7 @@ class PreferencesTool extends ToolContext {
64
63
 
65
64
  ```typescript
66
65
  // src/tools/greeting.tool.ts
67
- import { Tool, ToolContext } from '@frontmcp/sdk';
68
- import { z } from 'zod';
66
+ import { Tool, ToolContext, z } from '@frontmcp/sdk';
69
67
 
70
68
  @Tool({
71
69
  name: 'get_greeting',
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: authenticated-adapter-with-polling
3
- reference: official-adapters
3
+ reference: openapi-adapter
4
4
  level: intermediate
5
5
  description: 'Demonstrates configuring authentication (API key and bearer token) and automatic spec polling for OpenAPI adapters.'
6
6
  tags: [development, auth, openapi, security, adapters, authenticated]
@@ -80,5 +80,5 @@ class MyServer {}
80
80
 
81
81
  ## Related
82
82
 
83
- - See `official-adapters` for inline specs, multiple adapter registration, and troubleshooting
83
+ - See `openapi-adapter` for all five auth strategies, format resolution, and $ref security
84
84
  - See `decorators-guide` for the full `@App` and `@FrontMcp` field reference
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: basic-openapi-adapter
3
- reference: official-adapters
3
+ reference: openapi-adapter
4
4
  level: basic
5
5
  description: 'Demonstrates converting an OpenAPI specification into MCP tools automatically using `OpenapiAdapter` with minimal configuration.'
6
6
  tags: [development, openapi, adapters, adapter]
@@ -51,4 +51,4 @@ class MyServer {}
51
51
 
52
52
  ## Related
53
53
 
54
- - See `official-adapters` for authentication options, spec polling, and inline specs
54
+ - See `openapi-adapter` for authentication, filtering, transforms, and security options
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: format-resolution-and-custom-resolvers
3
+ reference: openapi-adapter
4
+ level: intermediate
5
+ description: 'Demonstrates using built-in and custom format resolvers to enrich tool input schemas with concrete constraints from OpenAPI format values.'
6
+ tags: [development, openapi, adapters, format, schema, validation]
7
+ features:
8
+ - 'Enabling built-in format resolvers with `resolveFormats: true` for uuid, date-time, email, int32, etc.'
9
+ - 'Adding custom format resolvers for domain-specific formats (phone, currency)'
10
+ - 'Merging custom resolvers with built-ins where custom takes precedence'
11
+ - 'Using custom-only resolvers without built-ins for full control'
12
+ ---
13
+
14
+ # Format Resolution and Custom Resolvers
15
+
16
+ Demonstrates using built-in and custom format resolvers to enrich tool input schemas with concrete constraints from OpenAPI format values.
17
+
18
+ ## Code
19
+
20
+ ```typescript
21
+ // src/server.ts
22
+ import { FrontMcp, App } from '@frontmcp/sdk';
23
+ import { OpenapiAdapter } from '@frontmcp/adapters';
24
+
25
+ @App({
26
+ name: 'format-demo',
27
+ adapters: [
28
+ // Built-in format resolvers only
29
+ // uuid fields get regex patterns, date-time gets ISO 8601 format,
30
+ // int32 gets min/max constraints, email gets validation pattern
31
+ OpenapiAdapter.init({
32
+ name: 'users-api',
33
+ url: 'https://api.example.com/openapi.json',
34
+ baseUrl: 'https://api.example.com',
35
+ generateOptions: {
36
+ resolveFormats: true,
37
+ },
38
+ }),
39
+
40
+ // Built-in + custom format resolvers
41
+ // Custom resolvers are merged with built-ins; custom takes precedence
42
+ OpenapiAdapter.init({
43
+ name: 'payments-api',
44
+ url: 'https://payments.example.com/openapi.json',
45
+ baseUrl: 'https://payments.example.com',
46
+ generateOptions: {
47
+ resolveFormats: true,
48
+ formatResolvers: {
49
+ // Domain-specific formats
50
+ phone: (schema) => ({
51
+ ...schema,
52
+ pattern: '^\\+[1-9]\\d{1,14}$',
53
+ description: 'E.164 international phone number (e.g., +14155552671)',
54
+ }),
55
+ currency: (schema) => ({
56
+ ...schema,
57
+ pattern: '^[A-Z]{3}$',
58
+ description: 'ISO 4217 currency code (e.g., USD, EUR, GBP)',
59
+ }),
60
+ 'country-code': (schema) => ({
61
+ ...schema,
62
+ pattern: '^[A-Z]{2}$',
63
+ description: 'ISO 3166-1 alpha-2 country code (e.g., US, GB, DE)',
64
+ }),
65
+ },
66
+ },
67
+ }),
68
+
69
+ // Custom resolvers only (no built-ins)
70
+ // Only the formats you explicitly define are resolved
71
+ OpenapiAdapter.init({
72
+ name: 'legacy-api',
73
+ url: 'https://legacy.example.com/openapi.json',
74
+ baseUrl: 'https://legacy.example.com',
75
+ generateOptions: {
76
+ // Without resolveFormats: true, only custom resolvers apply
77
+ formatResolvers: {
78
+ 'social-security': (schema) => ({
79
+ ...schema,
80
+ pattern: '^\\d{3}-\\d{2}-\\d{4}$',
81
+ description: 'US Social Security Number (XXX-XX-XXXX)',
82
+ }),
83
+ },
84
+ },
85
+ }),
86
+ ],
87
+ })
88
+ class FormatDemoApp {}
89
+
90
+ @FrontMcp({
91
+ info: { name: 'format-demo-server', version: '1.0.0' },
92
+ apps: [FormatDemoApp],
93
+ http: { port: 3000 },
94
+ })
95
+ class MyServer {}
96
+ ```
97
+
98
+ ## What This Demonstrates
99
+
100
+ - Enabling built-in format resolvers with `resolveFormats: true` for uuid, date-time, email, int32, etc.
101
+ - Adding custom format resolvers for domain-specific formats (phone, currency)
102
+ - Merging custom resolvers with built-ins where custom takes precedence
103
+ - Using custom-only resolvers without built-ins for full control
104
+
105
+ ## Related
106
+
107
+ - See `openapi-adapter` for all generate options, authentication, and $ref security
108
+ - See `create-tool` for building tools with manual schema definitions
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: multi-api-hub-with-inline-spec
3
- reference: official-adapters
3
+ reference: openapi-adapter
4
4
  level: advanced
5
5
  description: 'Demonstrates registering multiple OpenAPI adapters from different APIs in a single app, including one with an inline spec definition instead of a remote URL.'
6
6
  tags: [development, openapi, remote, adapters, multi, api]
@@ -126,5 +126,5 @@ class MyServer {}
126
126
 
127
127
  ## Related
128
128
 
129
- - See `official-adapters` for spec polling, `securityResolver`, and the adapter vs plugin comparison
129
+ - See `openapi-adapter` for spec polling, `securityResolver`, and filtering operations
130
130
  - See `decorators-guide` for the `@Adapter` decorator and how adapters fit in the hierarchy
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: ref-security-and-filtering
3
+ reference: openapi-adapter
4
+ level: intermediate
5
+ description: 'Demonstrates configuring $ref resolution security to prevent SSRF attacks and filtering which API operations become MCP tools.'
6
+ tags: [development, openapi, adapters, security, ssrf, filtering]
7
+ features:
8
+ - 'Configuring `refResolution` to restrict which hosts and protocols are allowed for external `$ref` pointers'
9
+ - 'Using `allowedHosts` to restrict $refs to trusted schema servers'
10
+ - 'Using `allowedProtocols` to enable or disable file://, http://, https://, and other protocols'
11
+ - 'Filtering operations with `includeOperations`, `excludeOperations`, and `filterFn`'
12
+ - 'Combining security hardening with operation filtering for a production-ready setup'
13
+ ---
14
+
15
+ # $ref Security and Operation Filtering
16
+
17
+ Demonstrates configuring $ref resolution security to prevent SSRF attacks and filtering which API operations become MCP tools.
18
+
19
+ ## Code
20
+
21
+ ```typescript
22
+ // src/server.ts
23
+ import { FrontMcp, App } from '@frontmcp/sdk';
24
+ import { OpenapiAdapter } from '@frontmcp/adapters';
25
+
26
+ @App({
27
+ name: 'secure-app',
28
+ adapters: [
29
+ // Production-hardened: restrict $refs to trusted hosts + filter operations
30
+ OpenapiAdapter.init({
31
+ name: 'partner-api',
32
+ url: 'https://api.partner.com/openapi.json',
33
+ baseUrl: 'https://api.partner.com',
34
+ loadOptions: {
35
+ refResolution: {
36
+ // Only allow $refs pointing to the partner's own schema server
37
+ allowedHosts: ['schemas.partner.com', 'api.partner.com'],
38
+ // Block additional hosts known to be problematic
39
+ blockedHosts: ['internal.partner.com'],
40
+ },
41
+ },
42
+ generateOptions: {
43
+ // Only expose read operations to MCP clients
44
+ filterFn: (op) => op.method === 'get',
45
+ // Skip deprecated endpoints
46
+ includeDeprecated: false,
47
+ },
48
+ staticAuth: {
49
+ apiKey: process.env.PARTNER_API_KEY!,
50
+ },
51
+ }),
52
+
53
+ // Internal API: allow internal IPs but lock down to specific operations
54
+ OpenapiAdapter.init({
55
+ name: 'internal-api',
56
+ url: 'http://10.0.0.5:8080/openapi.json',
57
+ baseUrl: 'http://10.0.0.5:8080',
58
+ loadOptions: {
59
+ refResolution: {
60
+ // Allow internal IPs since this is a trusted internal service
61
+ allowInternalIPs: true,
62
+ },
63
+ },
64
+ generateOptions: {
65
+ // Only include specific safe operations
66
+ includeOperations: ['getStatus', 'listMetrics', 'getConfig'],
67
+ },
68
+ }),
69
+
70
+ // Maximum lockdown: no external $refs at all
71
+ OpenapiAdapter.init({
72
+ name: 'sandbox-api',
73
+ url: 'https://sandbox.example.com/openapi.json',
74
+ baseUrl: 'https://sandbox.example.com',
75
+ loadOptions: {
76
+ refResolution: {
77
+ // Block ALL external $ref resolution — only local #/ pointers work
78
+ allowedProtocols: [],
79
+ },
80
+ },
81
+ generateOptions: {
82
+ // Exclude admin and dangerous operations
83
+ excludeOperations: ['deleteAll', 'resetDatabase', 'adminPanel'],
84
+ // Only include billing-related paths
85
+ filterFn: (op) => op.path.startsWith('/billing') || op.path.startsWith('/invoices'),
86
+ },
87
+ }),
88
+ ],
89
+ })
90
+ class SecureApp {}
91
+
92
+ @FrontMcp({
93
+ info: { name: 'secure-server', version: '1.0.0' },
94
+ apps: [SecureApp],
95
+ http: { port: 3000 },
96
+ })
97
+ class MyServer {}
98
+ ```
99
+
100
+ ## What This Demonstrates
101
+
102
+ - Configuring `refResolution` to restrict which hosts and protocols are allowed for external `$ref` pointers
103
+ - Using `allowedHosts` to restrict $refs to trusted schema servers
104
+ - Using `allowedProtocols` to enable or disable file://, http://, https://, and other protocols
105
+ - Filtering operations with `includeOperations`, `excludeOperations`, and `filterFn`
106
+ - Combining security hardening with operation filtering for a production-ready setup
107
+
108
+ ## Related
109
+
110
+ - See `openapi-adapter` for all `refResolution` options and the full blocked IP list
111
+ - See `official-adapters` for the adapter vs plugin comparison
@@ -43,8 +43,7 @@ Agents are autonomous AI entities that use an LLM to reason, plan, and invoke in
43
43
  Create a class extending `AgentContext<In, Out>` and optionally override the `execute(input: In): Promise<Out>` method. The `@Agent` decorator requires `name`, `description`, and `llm` configuration.
44
44
 
45
45
  ```typescript
46
- import { Agent, AgentContext } from '@frontmcp/sdk';
47
- import { z } from 'zod';
46
+ import { Agent, AgentContext, z } from '@frontmcp/sdk';
48
47
 
49
48
  @Agent({
50
49
  name: 'code_reviewer',
@@ -242,8 +241,7 @@ async execute(input: { text: string }) {
242
241
  The `tools` array in `@Agent` metadata defines tools that the agent itself can invoke during its reasoning loop. These are NOT exposed to external callers -- they are private to the agent.
243
242
 
244
243
  ```typescript
245
- import { Tool, ToolContext, Agent, AgentContext } from '@frontmcp/sdk';
246
- import { z } from 'zod';
244
+ import { Agent, AgentContext, Tool, ToolContext, z } from '@frontmcp/sdk';
247
245
 
248
246
  @Tool({
249
247
  name: 'fetch_pr',
@@ -406,8 +404,7 @@ class BillingAgent extends AgentContext {}
406
404
  For agents that do not need a class, use the `agent()` function builder.
407
405
 
408
406
  ```typescript
409
- import { agent } from '@frontmcp/sdk';
410
- import { z } from 'zod';
407
+ import { agent, z } from '@frontmcp/sdk';
411
408
 
412
409
  const QuickSummarizer = agent({
413
410
  name: 'quick_summarizer',
@@ -458,7 +455,7 @@ Both return values that can be registered in `agents: [ExternalAgent, CloudAgent
458
455
  Add agent classes (or function-style agents) to the `agents` array in `@FrontMcp` or `@App`.
459
456
 
460
457
  ```typescript
461
- import { FrontMcp, App } from '@frontmcp/sdk';
458
+ import { App, FrontMcp } from '@frontmcp/sdk';
462
459
 
463
460
  @App({
464
461
  name: 'review-app',
@@ -50,8 +50,7 @@ Create a class extending `JobContext<In, Out>` and implement the `execute(input:
50
50
  ### Basic Example
51
51
 
52
52
  ```typescript
53
- import { Job, JobContext } from '@frontmcp/sdk';
54
- import { z } from 'zod';
53
+ import { Job, JobContext, z } from '@frontmcp/sdk';
55
54
 
56
55
  @Job({
57
56
  name: 'generate-report',
@@ -339,8 +338,7 @@ permissions: {
339
338
  For simple jobs that do not need a class, use the `job()` function builder. The callback receives `(input, ctx)` where `ctx` provides all `JobContext` methods.
340
339
 
341
340
  ```typescript
342
- import { job } from '@frontmcp/sdk';
343
- import { z } from 'zod';
341
+ import { job, z } from '@frontmcp/sdk';
344
342
 
345
343
  const CleanupTempFiles = job({
346
344
  name: 'cleanup-temp-files',
@@ -444,8 +442,7 @@ This creates the job file, spec file, and updates barrel exports.
444
442
  ## Complete Example: Data Pipeline Job
445
443
 
446
444
  ```typescript
447
- import { Job, JobContext, FrontMcp, App, job } from '@frontmcp/sdk';
448
- import { z } from 'zod';
445
+ import { App, FrontMcp, Job, job, JobContext, z } from '@frontmcp/sdk';
449
446
 
450
447
  @Job({
451
448
  name: 'etl-pipeline',
@@ -72,7 +72,7 @@ In addition to flow-based hooks, plugins can register callbacks for server lifec
72
72
  Runs after the HTTP server is fully initialized and listening. Use for warming caches, starting background indexing, or logging readiness.
73
73
 
74
74
  ```typescript
75
- import { Plugin, DynamicPlugin } from '@frontmcp/sdk';
75
+ import { DynamicPlugin, Plugin } from '@frontmcp/sdk';
76
76
 
77
77
  @Plugin({
78
78
  name: 'cache-warmer',
@@ -105,12 +105,12 @@ For convenience, FrontMCP exports typed aliases so you do not need to call `Flow
105
105
 
106
106
  ```typescript
107
107
  import {
108
- ToolHook, // FlowHooksOf('tools:call-tool')
109
- ListToolsHook, // FlowHooksOf('tools:list-tools')
110
- ResourceHook, // FlowHooksOf('resources:read-resource')
111
- ListResourcesHook, // FlowHooksOf('resources:list-resources')
112
108
  AgentCallHook, // FlowHooksOf('agents:call-agent')
113
109
  HttpHook, // FlowHooksOf('http:request')
110
+ ListResourcesHook, // FlowHooksOf('resources:list-resources')
111
+ ListToolsHook, // FlowHooksOf('tools:list-tools')
112
+ ResourceHook, // FlowHooksOf('resources:read-resource')
113
+ ToolHook, // FlowHooksOf('tools:call-tool')
114
114
  } from '@frontmcp/sdk';
115
115
  ```
116
116
 
@@ -152,8 +152,7 @@ Both `@Will` and `@Did` (and `@Around`) accept an optional options object:
152
152
  ### Logging Plugin
153
153
 
154
154
  ```typescript
155
- import { Plugin } from '@frontmcp/sdk';
156
- import { ToolHook } from '@frontmcp/sdk';
155
+ import { Plugin, ToolHook } from '@frontmcp/sdk';
157
156
 
158
157
  const { Will, Did } = ToolHook;
159
158
 
@@ -174,8 +173,7 @@ export class LoggingPlugin {
174
173
  ### Authorization Check Plugin
175
174
 
176
175
  ```typescript
177
- import { Plugin } from '@frontmcp/sdk';
178
- import { ToolHook } from '@frontmcp/sdk';
176
+ import { Plugin, ToolHook } from '@frontmcp/sdk';
179
177
 
180
178
  const { Will } = ToolHook;
181
179
 
@@ -194,8 +192,7 @@ export class AuthCheckPlugin {
194
192
  ### Caching Plugin with @Around
195
193
 
196
194
  ```typescript
197
- import { Plugin } from '@frontmcp/sdk';
198
- import { ToolHook } from '@frontmcp/sdk';
195
+ import { Plugin, ToolHook } from '@frontmcp/sdk';
199
196
 
200
197
  const { Around } = ToolHook;
201
198
 
@@ -227,8 +224,7 @@ export class CachePlugin {
227
224
  ### Stage Replacement
228
225
 
229
226
  ```typescript
230
- import { Plugin } from '@frontmcp/sdk';
231
- import { ToolHook } from '@frontmcp/sdk';
227
+ import { Plugin, ToolHook } from '@frontmcp/sdk';
232
228
 
233
229
  const { Stage } = ToolHook;
234
230
 
@@ -249,8 +245,9 @@ Register plugins in your `@App` decorator:
249
245
 
250
246
  ```typescript
251
247
  import { App } from '@frontmcp/sdk';
252
- import { LoggingPlugin } from './plugins/logging.plugin';
248
+
253
249
  import { CachePlugin } from './plugins/cache.plugin';
250
+ import { LoggingPlugin } from './plugins/logging.plugin';
254
251
 
255
252
  @App({
256
253
  name: 'my-app',
@@ -266,8 +263,7 @@ Plugins are initialized in array order. Hook priority determines execution order
266
263
  You can add hook methods directly on a `@Tool` class to intercept its own execution flow. The hooks apply only when **this tool** is called:
267
264
 
268
265
  ```typescript
269
- import { Tool, ToolContext } from '@frontmcp/sdk';
270
- import { z } from 'zod';
266
+ import { Tool, ToolContext, z } from '@frontmcp/sdk';
271
267
 
272
268
  const { Will, Did } = ToolHook;
273
269
 
@@ -431,7 +431,7 @@ Both return values that can be registered in `skills: [ExternalSkill, CloudSkill
431
431
  Add skill classes (or function-style skills) to the `skills` array in `@FrontMcp` or `@App`.
432
432
 
433
433
  ```typescript
434
- import { FrontMcp, App } from '@frontmcp/sdk';
434
+ import { App, FrontMcp } from '@frontmcp/sdk';
435
435
 
436
436
  @App({
437
437
  name: 'devops-app',
@@ -505,8 +505,7 @@ GET /skills
505
505
  ## Complete Example: Multi-Tool Orchestration Skill
506
506
 
507
507
  ```typescript
508
- import { Skill, SkillContext, Tool, ToolContext, FrontMcp, App } from '@frontmcp/sdk';
509
- import { z } from 'zod';
508
+ import { App, FrontMcp, Skill, SkillContext, Tool, ToolContext, z } from '@frontmcp/sdk';
510
509
 
511
510
  // Define the tools that the skill references
512
511