@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.
- package/catalog/frontmcp-authorities/SKILL.md +272 -0
- package/catalog/frontmcp-authorities/references/authority-profiles.md +262 -0
- package/catalog/frontmcp-authorities/references/claims-mapping.md +266 -0
- package/catalog/frontmcp-authorities/references/custom-evaluators.md +420 -0
- package/catalog/frontmcp-authorities/references/rbac-abac-rebac.md +391 -0
- package/catalog/frontmcp-channels/SKILL.md +122 -0
- package/catalog/frontmcp-channels/examples/channel-sources/agent-notify.md +70 -0
- package/catalog/frontmcp-channels/examples/channel-sources/app-errors.md +71 -0
- package/catalog/frontmcp-channels/examples/channel-sources/file-watcher.md +102 -0
- package/catalog/frontmcp-channels/examples/channel-sources/job-completion.md +79 -0
- package/catalog/frontmcp-channels/examples/channel-sources/replay-buffer.md +106 -0
- package/catalog/frontmcp-channels/examples/channel-sources/service-connector.md +136 -0
- package/catalog/frontmcp-channels/examples/channel-sources/webhook-github.md +85 -0
- package/catalog/frontmcp-channels/examples/channel-two-way/whatsapp-bridge.md +133 -0
- package/catalog/frontmcp-channels/references/channel-sources.md +214 -0
- package/catalog/frontmcp-channels/references/channel-two-way.md +195 -0
- package/catalog/frontmcp-config/SKILL.md +20 -18
- package/catalog/frontmcp-config/examples/configure-auth/multi-app-auth.md +1 -2
- package/catalog/frontmcp-config/examples/configure-auth/public-mode-setup.md +1 -2
- package/catalog/frontmcp-config/examples/configure-auth/remote-oauth-with-vault.md +1 -2
- package/catalog/frontmcp-config/examples/configure-auth-modes/local-self-signed-tokens.md +1 -2
- package/catalog/frontmcp-config/examples/configure-auth-modes/remote-enterprise-oauth.md +1 -2
- package/catalog/frontmcp-config/examples/configure-auth-modes/transparent-jwt-validation.md +1 -2
- package/catalog/frontmcp-config/examples/configure-deployment-targets/distributed-ha-config.md +121 -0
- package/catalog/frontmcp-config/examples/configure-deployment-targets/json-schema-ide-support.md +64 -0
- package/catalog/frontmcp-config/examples/configure-deployment-targets/multi-target-with-security.md +113 -0
- package/catalog/frontmcp-config/examples/configure-elicitation/basic-confirmation-gate.md +1 -2
- package/catalog/frontmcp-config/examples/configure-elicitation/distributed-elicitation-redis.md +1 -2
- package/catalog/frontmcp-config/examples/configure-http/entry-path-reverse-proxy.md +1 -2
- package/catalog/frontmcp-config/examples/configure-http/unix-socket-local.md +1 -2
- package/catalog/frontmcp-config/examples/configure-security-headers/csp-report-only.md +69 -0
- package/catalog/frontmcp-config/examples/configure-security-headers/full-production-headers.md +91 -0
- package/catalog/frontmcp-config/examples/configure-throttle/distributed-redis-throttle.md +1 -2
- package/catalog/frontmcp-config/examples/configure-throttle/per-tool-rate-limit.md +1 -2
- package/catalog/frontmcp-config/examples/configure-throttle/server-level-rate-limit.md +1 -2
- package/catalog/frontmcp-config/examples/configure-transport/custom-protocol-flags.md +1 -2
- package/catalog/frontmcp-config/examples/configure-transport/distributed-sessions-redis.md +1 -2
- package/catalog/frontmcp-config/examples/configure-transport/stateless-serverless.md +1 -2
- package/catalog/frontmcp-config/examples/configure-transport-protocol-presets/legacy-preset-nodejs.md +1 -2
- package/catalog/frontmcp-config/examples/configure-transport-protocol-presets/stateless-api-serverless.md +1 -2
- package/catalog/frontmcp-config/references/configure-deployment-targets.md +214 -0
- package/catalog/frontmcp-config/references/configure-elicitation.md +1 -2
- package/catalog/frontmcp-config/references/configure-security-headers.md +198 -0
- package/catalog/frontmcp-deployment/SKILL.md +1 -0
- package/catalog/frontmcp-deployment/examples/build-for-cli/cli-binary-build.md +1 -2
- package/catalog/frontmcp-deployment/examples/build-for-cli/unix-socket-daemon.md +1 -2
- package/catalog/frontmcp-deployment/examples/build-for-mcpb/mcpb-bundle-build.md +117 -0
- package/catalog/frontmcp-deployment/examples/build-for-sdk/connect-openai.md +1 -3
- package/catalog/frontmcp-deployment/examples/build-for-sdk/create-flat-config.md +1 -2
- package/catalog/frontmcp-deployment/examples/build-for-sdk/multi-platform-connect.md +3 -3
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/basic-worker-deploy.md +1 -2
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-custom-domain.md +1 -2
- package/catalog/frontmcp-deployment/examples/deploy-to-cloudflare/worker-with-kv-storage.md +1 -2
- package/catalog/frontmcp-deployment/examples/deploy-to-lambda/lambda-handler-with-cors.md +1 -2
- package/catalog/frontmcp-deployment/examples/deploy-to-vercel/vercel-with-kv.md +1 -2
- package/catalog/frontmcp-deployment/examples/mcp-client-integration/http-remote.md +106 -0
- package/catalog/frontmcp-deployment/examples/mcp-client-integration/stdio-binary-with-env.md +107 -0
- package/catalog/frontmcp-deployment/examples/mcp-client-integration/stdio-npx.md +89 -0
- package/catalog/frontmcp-deployment/references/build-for-mcpb.md +209 -0
- package/catalog/frontmcp-deployment/references/build-for-sdk.md +1 -2
- package/catalog/frontmcp-deployment/references/mcp-client-integration.md +225 -0
- package/catalog/frontmcp-development/SKILL.md +4 -3
- package/catalog/frontmcp-development/examples/create-agent/basic-agent-with-tools.md +3 -6
- package/catalog/frontmcp-development/examples/create-agent/custom-multi-pass-agent.md +1 -2
- package/catalog/frontmcp-development/examples/create-agent/nested-agents-with-swarm.md +2 -4
- package/catalog/frontmcp-development/examples/create-agent-llm-config/anthropic-config.md +1 -2
- package/catalog/frontmcp-development/examples/create-agent-llm-config/openai-config.md +1 -2
- package/catalog/frontmcp-development/examples/create-job/basic-report-job.md +1 -2
- package/catalog/frontmcp-development/examples/create-job/job-with-permissions.md +2 -3
- package/catalog/frontmcp-development/examples/create-job/job-with-retry.md +1 -2
- package/catalog/frontmcp-development/examples/create-plugin-hooks/tool-level-hooks-and-stage-replacement.md +2 -5
- package/catalog/frontmcp-development/examples/create-provider/basic-database-provider.md +4 -3
- package/catalog/frontmcp-development/examples/create-skill-with-tools/directory-skill-with-tools.md +2 -3
- package/catalog/frontmcp-development/examples/create-tool/basic-class-tool.md +1 -2
- package/catalog/frontmcp-development/examples/create-tool/tool-with-di-and-errors.md +2 -2
- package/catalog/frontmcp-development/examples/create-tool/tool-with-rate-limiting-and-progress.md +1 -2
- package/catalog/frontmcp-development/examples/create-tool-annotations/destructive-delete-tool.md +2 -4
- package/catalog/frontmcp-development/examples/create-tool-annotations/readonly-query-tool.md +1 -2
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/primitive-and-media-outputs.md +3 -6
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-raw-shape-output.md +1 -2
- package/catalog/frontmcp-development/examples/create-tool-output-schema-types/zod-schema-advanced-output.md +2 -4
- package/catalog/frontmcp-development/examples/decorators-guide/agent-skill-job-workflow.md +3 -5
- package/catalog/frontmcp-development/examples/decorators-guide/basic-server-with-app-and-tools.md +5 -5
- package/catalog/frontmcp-development/examples/decorators-guide/multi-app-with-plugins-and-providers.md +4 -6
- package/catalog/frontmcp-development/examples/official-plugins/cache-and-feature-flags.md +3 -5
- package/catalog/frontmcp-development/examples/official-plugins/production-multi-plugin-setup.md +4 -5
- package/catalog/frontmcp-development/examples/official-plugins/remember-plugin-session-memory.md +3 -5
- package/catalog/frontmcp-development/examples/{official-adapters → openapi-adapter}/authenticated-adapter-with-polling.md +2 -2
- package/catalog/frontmcp-development/examples/{official-adapters → openapi-adapter}/basic-openapi-adapter.md +2 -2
- package/catalog/frontmcp-development/examples/openapi-adapter/format-resolution-and-custom-resolvers.md +108 -0
- package/catalog/frontmcp-development/examples/{official-adapters → openapi-adapter}/multi-api-hub-with-inline-spec.md +2 -2
- package/catalog/frontmcp-development/examples/openapi-adapter/ref-security-and-filtering.md +111 -0
- package/catalog/frontmcp-development/references/create-agent.md +4 -7
- package/catalog/frontmcp-development/references/create-job.md +3 -6
- package/catalog/frontmcp-development/references/create-plugin-hooks.md +12 -16
- package/catalog/frontmcp-development/references/create-skill-with-tools.md +2 -3
- package/catalog/frontmcp-development/references/create-tool.md +93 -23
- package/catalog/frontmcp-development/references/create-workflow.md +2 -3
- package/catalog/frontmcp-development/references/decorators-guide.md +32 -36
- package/catalog/frontmcp-development/references/official-adapters.md +24 -153
- package/catalog/frontmcp-development/references/openapi-adapter.md +431 -0
- package/catalog/frontmcp-extensibility/examples/vectoriadb/product-catalog-search.md +4 -4
- package/catalog/frontmcp-extensibility/examples/vectoriadb/semantic-search-with-persistence.md +4 -4
- package/catalog/frontmcp-extensibility/examples/vectoriadb/tfidf-keyword-search.md +4 -3
- package/catalog/frontmcp-guides/SKILL.md +3 -3
- package/catalog/frontmcp-guides/examples/example-knowledge-base/agent-and-plugin.md +4 -5
- package/catalog/frontmcp-guides/examples/example-knowledge-base/vector-search-and-resources.md +4 -3
- package/catalog/frontmcp-guides/examples/example-task-manager/auth-and-crud-tools.md +4 -4
- package/catalog/frontmcp-guides/examples/example-weather-api/weather-tool-with-schemas.md +1 -2
- package/catalog/frontmcp-guides/references/example-knowledge-base.md +22 -17
- package/catalog/frontmcp-guides/references/example-task-manager.md +16 -11
- package/catalog/frontmcp-guides/references/example-weather-api.md +6 -3
- package/catalog/frontmcp-observability/examples/telemetry-api/tool-custom-spans.md +2 -3
- package/catalog/frontmcp-observability/examples/tracing-setup/basic-tracing.md +4 -3
- package/catalog/frontmcp-observability/references/telemetry-api.md +2 -3
- package/catalog/frontmcp-production-readiness/examples/common-checklist/observability-setup.md +1 -2
- package/catalog/frontmcp-production-readiness/examples/common-checklist/security-hardening.md +3 -4
- package/catalog/frontmcp-production-readiness/examples/distributed-ha/ha-kubernetes-3-replicas.md +229 -0
- package/catalog/frontmcp-production-readiness/examples/production-browser/cross-platform-crypto.md +2 -3
- package/catalog/frontmcp-production-readiness/examples/production-cli-binary/stdio-transport-error-handling.md +1 -2
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/durable-objects-state.md +2 -4
- package/catalog/frontmcp-production-readiness/examples/production-cloudflare/workers-runtime-constraints.md +2 -3
- package/catalog/frontmcp-production-readiness/examples/production-lambda/cold-start-connection-reuse.md +3 -2
- package/catalog/frontmcp-production-readiness/examples/production-vercel/cold-start-optimization.md +2 -2
- package/catalog/frontmcp-production-readiness/examples/production-vercel/stateless-serverless-design.md +3 -3
- package/catalog/frontmcp-production-readiness/references/distributed-ha.md +194 -0
- package/catalog/frontmcp-setup/SKILL.md +11 -11
- package/catalog/frontmcp-setup/examples/project-structure-standalone/feature-folder-organization.md +5 -3
- package/catalog/frontmcp-setup/examples/project-structure-standalone/minimal-standalone-layout.md +4 -2
- package/catalog/frontmcp-setup/examples/setup-project/basic-node-server.md +4 -2
- package/catalog/frontmcp-setup/examples/setup-project/vercel-serverless-server.md +4 -2
- package/catalog/frontmcp-setup/examples/setup-redis/hybrid-vercel-kv-with-pubsub.md +8 -7
- package/catalog/frontmcp-setup/references/setup-project.md +10 -9
- package/catalog/frontmcp-setup/references/setup-redis.md +19 -16
- package/catalog/frontmcp-testing/examples/test-direct-client/basic-create-test.md +1 -3
- package/catalog/frontmcp-testing/examples/test-direct-client/openai-claude-format-test.md +1 -3
- package/catalog/frontmcp-testing/examples/test-tool-unit/schema-validation-test.md +2 -2
- package/catalog/frontmcp-testing/references/test-direct-client.md +1 -3
- package/catalog/frontmcp-testing/references/test-tool-unit.md +2 -2
- package/catalog/skills-manifest.json +364 -12
- package/package.json +1 -1
|
@@ -34,8 +34,7 @@ Tools are the primary way to expose executable actions to AI clients in the MCP
|
|
|
34
34
|
Create a class extending `ToolContext<In, Out>` and implement the `execute(input: In): Promise<Out>` method. The `@Tool` decorator requires at minimum a `name` and an `inputSchema`.
|
|
35
35
|
|
|
36
36
|
```typescript
|
|
37
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
38
|
-
import { z } from 'zod';
|
|
37
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
39
38
|
|
|
40
39
|
@Tool({
|
|
41
40
|
name: 'greet_user',
|
|
@@ -158,6 +157,65 @@ class GetWeatherTool extends ToolContext {
|
|
|
158
157
|
- CodeCall cannot infer return types for chaining tool calls in VM scripts
|
|
159
158
|
- No compile-time type checking on the return value
|
|
160
159
|
|
|
160
|
+
### Typed Output Patterns
|
|
161
|
+
|
|
162
|
+
The `Out` generic on `ToolContext<InSchema, OutSchema, In, Out>` is inferred from `outputSchema`. You can wire the generics explicitly for full type safety — no `as any` casts needed:
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
const inputSchema = {
|
|
166
|
+
city: z.string(),
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const outputSchema = {
|
|
170
|
+
temperature: z.number(),
|
|
171
|
+
unit: z.enum(['celsius', 'fahrenheit']),
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
@Tool({
|
|
175
|
+
name: 'get_weather',
|
|
176
|
+
inputSchema,
|
|
177
|
+
outputSchema,
|
|
178
|
+
})
|
|
179
|
+
// No generics needed — ToolContext infers types from the @Tool decorator
|
|
180
|
+
class GetWeatherTool extends ToolContext {
|
|
181
|
+
async execute(input: { city: string }) {
|
|
182
|
+
// Return type is inferred as { temperature: number; unit: 'celsius' | 'fahrenheit' }
|
|
183
|
+
// TypeScript will error if you return the wrong shape
|
|
184
|
+
return { temperature: 22, unit: 'celsius' as const };
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**`return` vs `this.respond()`** — Both work and both are validated against `outputSchema` in the finalize stage:
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
// Option 1: return (preferred — simpler, same validation)
|
|
193
|
+
async execute(input: Input) {
|
|
194
|
+
return { temperature: 22, unit: 'celsius' };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Option 2: this.respond() — useful for early exit (throws FlowControl.respond internally)
|
|
198
|
+
async execute(input: Input) {
|
|
199
|
+
if (someCondition) {
|
|
200
|
+
this.respond({ temperature: 0, unit: 'celsius' }); // never returns
|
|
201
|
+
}
|
|
202
|
+
return { temperature: 22, unit: 'celsius' };
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Early returns from elicitation** must still match the output schema:
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
async execute(input: Input) {
|
|
210
|
+
const result = await this.elicit('Confirm?', { confirm: z.boolean() });
|
|
211
|
+
if (result.action !== 'accept') {
|
|
212
|
+
// Must return a value matching outputSchema, not a raw string
|
|
213
|
+
return { temperature: 0, unit: 'celsius' as const };
|
|
214
|
+
}
|
|
215
|
+
// ... normal execution
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
161
219
|
Supported `outputSchema` types:
|
|
162
220
|
|
|
163
221
|
- **Zod raw shapes** (recommended): `{ field: z.string(), count: z.number() }` — structured JSON output with validation
|
|
@@ -263,7 +321,7 @@ class DeleteRecordTool extends ToolContext {
|
|
|
263
321
|
For MCP-specific errors, use error classes with JSON-RPC codes:
|
|
264
322
|
|
|
265
323
|
```typescript
|
|
266
|
-
import {
|
|
324
|
+
import { MCP_ERROR_CODES, PublicMcpError, ResourceNotFoundError } from '@frontmcp/sdk';
|
|
267
325
|
|
|
268
326
|
this.fail(new ResourceNotFoundError(`Record ${input.id}`));
|
|
269
327
|
```
|
|
@@ -348,8 +406,7 @@ Annotation fields:
|
|
|
348
406
|
For simple tools that do not need a class, use the `tool()` function builder. It returns a value you register the same way as a class tool.
|
|
349
407
|
|
|
350
408
|
```typescript
|
|
351
|
-
import { tool } from '@frontmcp/sdk';
|
|
352
|
-
import { z } from 'zod';
|
|
409
|
+
import { tool, z } from '@frontmcp/sdk';
|
|
353
410
|
|
|
354
411
|
const AddNumbers = tool({
|
|
355
412
|
name: 'add_numbers',
|
|
@@ -395,7 +452,7 @@ Both return values that can be registered in `tools: [RemoteTool, CloudTool]`.
|
|
|
395
452
|
Add tool classes (or function-style tools) to the `tools` array in `@FrontMcp` or `@App`.
|
|
396
453
|
|
|
397
454
|
```typescript
|
|
398
|
-
import {
|
|
455
|
+
import { App, FrontMcp } from '@frontmcp/sdk';
|
|
399
456
|
|
|
400
457
|
@App({
|
|
401
458
|
name: 'my-app',
|
|
@@ -549,7 +606,20 @@ if (this.isEnv('production')) {
|
|
|
549
606
|
|
|
550
607
|
## Elicitation (Interactive Input)
|
|
551
608
|
|
|
552
|
-
Tools can request interactive input from users mid-execution using `this.elicit()`.
|
|
609
|
+
Tools can request interactive input from users mid-execution using `this.elicit()`.
|
|
610
|
+
|
|
611
|
+
> **Prerequisite:** Elicitation must be enabled at server level:
|
|
612
|
+
>
|
|
613
|
+
> ```typescript
|
|
614
|
+
> @FrontMcp({
|
|
615
|
+
> elicitation: { enabled: true },
|
|
616
|
+
> // ... rest of config
|
|
617
|
+
> })
|
|
618
|
+
> ```
|
|
619
|
+
>
|
|
620
|
+
> See `configure-elicitation` for full configuration options including Redis-backed elicitation stores.
|
|
621
|
+
>
|
|
622
|
+
> **What happens without it:** Calling `this.elicit()` throws `ElicitationDisabledError` at runtime with the message: _"Elicitation is disabled in server configuration. Enable it via @FrontMcp({ elicitation: { enabled: true } })"_. The tool call fails and the error is returned to the client. There is no compile-time or startup warning — the error only occurs when the tool is actually invoked.
|
|
553
623
|
|
|
554
624
|
```typescript
|
|
555
625
|
@Tool({
|
|
@@ -573,8 +643,6 @@ class ConfirmDeleteTool extends ToolContext {
|
|
|
573
643
|
}
|
|
574
644
|
```
|
|
575
645
|
|
|
576
|
-
> **Note:** Elicitation must be enabled at server level: `@FrontMcp({ elicitation: { enabled: true } })`. See `configure-elicitation` for full configuration options.
|
|
577
|
-
|
|
578
646
|
## Tool Examples
|
|
579
647
|
|
|
580
648
|
Provide usage examples for documentation and discovery:
|
|
@@ -607,13 +675,14 @@ class ConvertCurrencyTool extends ToolContext {
|
|
|
607
675
|
|
|
608
676
|
## Common Patterns
|
|
609
677
|
|
|
610
|
-
| Pattern
|
|
611
|
-
|
|
|
612
|
-
| Input schema
|
|
613
|
-
| Output schema
|
|
614
|
-
| DI resolution
|
|
615
|
-
| Error handling
|
|
616
|
-
| Tool naming
|
|
678
|
+
| Pattern | Correct | Incorrect | Why |
|
|
679
|
+
| -------------------- | ----------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------- |
|
|
680
|
+
| Input schema | `inputSchema: { name: z.string() }` (raw shape) | `inputSchema: z.object({ name: z.string() })` | Framework wraps in `z.object()` internally |
|
|
681
|
+
| Output schema | Always define `outputSchema` | Omit `outputSchema` | Prevents data leaks and enables CodeCall chaining |
|
|
682
|
+
| DI resolution | `this.get(TOKEN)` with proper error handling | `this.tryGet(TOKEN)!` with non-null assertion | `get` throws a clear error; non-null assertions mask failures |
|
|
683
|
+
| Error handling | `this.fail(new ResourceNotFoundError(...))` | `throw new Error(...)` | `this.fail` triggers the error flow with MCP error codes |
|
|
684
|
+
| Tool naming | `snake_case` names: `get_weather` | `camelCase` or `PascalCase`: `getWeather` | MCP protocol convention for tool names |
|
|
685
|
+
| ToolContext generics | `class MyTool extends ToolContext` | `class MyTool extends ToolContext<typeof inputSchema>` | Types are auto-inferred from `@Tool` decorator — explicit generics are redundant |
|
|
617
686
|
|
|
618
687
|
## Verification Checklist
|
|
619
688
|
|
|
@@ -634,13 +703,14 @@ class ConvertCurrencyTool extends ToolContext {
|
|
|
634
703
|
|
|
635
704
|
## Troubleshooting
|
|
636
705
|
|
|
637
|
-
| Problem
|
|
638
|
-
|
|
|
639
|
-
| Tool not appearing in `tools/list`
|
|
640
|
-
| Zod validation error on valid input
|
|
641
|
-
| `this.get(TOKEN)` throws DependencyNotFoundError
|
|
642
|
-
| Output contains unexpected fields
|
|
643
|
-
| Tool times out
|
|
706
|
+
| Problem | Cause | Solution |
|
|
707
|
+
| ------------------------------------------------- | ------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
708
|
+
| Tool not appearing in `tools/list` | Not registered in `tools` array | Add tool class to `@App` or `@FrontMcp` `tools` array |
|
|
709
|
+
| Zod validation error on valid input | Using `z.object()` wrapper in `inputSchema` | Use raw shape: `{ field: z.string() }` not `z.object({ field: z.string() })` |
|
|
710
|
+
| `this.get(TOKEN)` throws DependencyNotFoundError | Provider not registered in scope | Register provider in `providers` array of `@App` or `@FrontMcp` |
|
|
711
|
+
| Output contains unexpected fields | No `outputSchema` defined | Add `outputSchema` to strip unvalidated fields from response |
|
|
712
|
+
| Tool times out | No timeout configured for long operation | Add `timeout: { executeMs: 30_000 }` to `@Tool` options |
|
|
713
|
+
| `this.elicit()` throws `ElicitationDisabledError` | Elicitation not enabled at server level | Add `elicitation: { enabled: true }` to `@FrontMcp` config |
|
|
644
714
|
|
|
645
715
|
## Examples
|
|
646
716
|
|
|
@@ -422,7 +422,7 @@ Register it the same way as a class workflow: `workflows: [QuickDeploy]`.
|
|
|
422
422
|
Add workflow classes (or function-style workflows) to the `workflows` array in `@App`. Workflows require jobs to be enabled since each step runs a named job.
|
|
423
423
|
|
|
424
424
|
```typescript
|
|
425
|
-
import {
|
|
425
|
+
import { App, FrontMcp } from '@frontmcp/sdk';
|
|
426
426
|
|
|
427
427
|
@App({
|
|
428
428
|
name: 'pipeline-app',
|
|
@@ -462,8 +462,7 @@ This creates the workflow file, spec file, and updates barrel exports.
|
|
|
462
462
|
## Complete Example: CI/CD Pipeline
|
|
463
463
|
|
|
464
464
|
```typescript
|
|
465
|
-
import {
|
|
466
|
-
import { z } from 'zod';
|
|
465
|
+
import { App, FrontMcp, Job, JobContext, Workflow, workflow, z } from '@frontmcp/sdk';
|
|
467
466
|
|
|
468
467
|
// --- Jobs ---
|
|
469
468
|
|
|
@@ -61,32 +61,32 @@ FrontMCP uses a hierarchical decorator system. The nesting order is:
|
|
|
61
61
|
|
|
62
62
|
**Key fields:**
|
|
63
63
|
|
|
64
|
-
| Field | Description
|
|
65
|
-
| --------------- |
|
|
66
|
-
| `info` | Server name, version, and description
|
|
67
|
-
| `apps` | Array of `@App` classes to mount
|
|
68
|
-
| `serve?` | Auto-start HTTP server (default: `true`). Set `false` for programmatic usage
|
|
69
|
-
| `splitByApp?` | If `true`, each app gets its own scope and basePath. Default: `false`
|
|
70
|
-
| `redis?` | Redis / Vercel KV connection for sessions, transport persistence, auth tokens
|
|
71
|
-
| `plugins?` | Global plugins (instantiated per scope)
|
|
72
|
-
| `providers?` | Global DI providers available to all apps
|
|
73
|
-
| `tools?` | Standalone tools (outside apps, merged with app tools)
|
|
74
|
-
| `resources?` | Standalone resources (merged with app resources)
|
|
75
|
-
| `skills?` | Standalone skills (merged with app skills)
|
|
76
|
-
| `skillsConfig?` | Skills HTTP endpoints (`/llm.txt`, `/skills`) and MCP tool config
|
|
77
|
-
| `transport?` | Transport preset (`'modern'`, `'legacy'`, `'stateless-api'`, `'full'`) or object
|
|
78
|
-
| `auth?` | Authentication mode: `'public'`, `'transparent'`, `'local'`, `'remote'`
|
|
79
|
-
| `http?` | HTTP server options (port, host, cors, socketPath)
|
|
80
|
-
| `logging?` | Logging configuration (transports and levels)
|
|
81
|
-
| `elicitation?` | Enable interactive user input during tool execution
|
|
82
|
-
| `sqlite?` | SQLite storage for local deployments (sessions, events)
|
|
83
|
-
| `pubsub?` | Redis pub/sub for resource subscriptions (falls back to `redis` config)
|
|
84
|
-
| `jobs?` | Background jobs/workflows system (`{ enabled, store? }`)
|
|
85
|
-
| `throttle?` | Server-level guard config (see note below)
|
|
86
|
-
| `pagination?` | List operation pagination (`tools/list` endpoint)
|
|
87
|
-
| `ui?` | UI rendering config (CDN overrides for widget imports)
|
|
88
|
-
| `extApps?` | Widget-to-host MCP Apps communication (host capabilities, session validation)
|
|
89
|
-
| `loader?` | Default npm/ESM package loader for `App.esm()` / `App.remote()` apps
|
|
64
|
+
| Field | Description |
|
|
65
|
+
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
66
|
+
| `info` | Server name, version, and description |
|
|
67
|
+
| `apps` | Array of `@App` classes to mount |
|
|
68
|
+
| `serve?` | Auto-start HTTP server (default: `true`). Set `false` for programmatic usage |
|
|
69
|
+
| `splitByApp?` | If `true`, each app gets its own scope and basePath. Default: `false` |
|
|
70
|
+
| `redis?` | Redis / Vercel KV connection for sessions, transport persistence, auth tokens |
|
|
71
|
+
| `plugins?` | Global plugins (instantiated per scope) |
|
|
72
|
+
| `providers?` | Global DI providers available to all apps |
|
|
73
|
+
| `tools?` | Standalone tools (outside apps, merged with app tools) |
|
|
74
|
+
| `resources?` | Standalone resources (merged with app resources) |
|
|
75
|
+
| `skills?` | Standalone skills (merged with app skills) |
|
|
76
|
+
| `skillsConfig?` | Skills HTTP endpoints (`/llm.txt`, `/skills`) and MCP tool config |
|
|
77
|
+
| `transport?` | Transport preset (`'modern'`, `'legacy'`, `'stateless-api'`, `'full'`) or object |
|
|
78
|
+
| `auth?` | Authentication mode: `'public'`, `'transparent'`, `'local'`, `'remote'` |
|
|
79
|
+
| `http?` | HTTP server options (port, host, cors, socketPath) |
|
|
80
|
+
| `logging?` | Logging configuration (transports and levels) |
|
|
81
|
+
| `elicitation?` | Enable interactive user input during tool execution |
|
|
82
|
+
| `sqlite?` | SQLite storage for local deployments (sessions, events) |
|
|
83
|
+
| `pubsub?` | Redis pub/sub for distributed resource subscriptions across multiple instances (single-server deployments use in-memory subscriptions; falls back to `redis` config) |
|
|
84
|
+
| `jobs?` | Background jobs/workflows system (`{ enabled, store? }`) |
|
|
85
|
+
| `throttle?` | Server-level guard config (see note below) |
|
|
86
|
+
| `pagination?` | List operation pagination (`tools/list` endpoint) |
|
|
87
|
+
| `ui?` | UI rendering config (CDN overrides for widget imports) |
|
|
88
|
+
| `extApps?` | Widget-to-host MCP Apps communication (host capabilities, session validation) |
|
|
89
|
+
| `loader?` | Default npm/ESM package loader for `App.esm()` / `App.remote()` apps |
|
|
90
90
|
|
|
91
91
|
> **Throttle vs per-tool guards:** Server-level `throttle` is a `GuardConfig` object with `global`, `defaultRateLimit`, `defaultConcurrency`, `defaultTimeout` sub-fields that set server-wide defaults. Tool-level `rateLimit`, `concurrency`, `timeout` fields (on `@Tool`) override these defaults per tool.
|
|
92
92
|
|
|
@@ -172,8 +172,7 @@ class AnalyticsApp {}
|
|
|
172
172
|
| `ui?` | UI widget configuration for tool rendering |
|
|
173
173
|
|
|
174
174
|
```typescript
|
|
175
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
176
|
-
import { z } from 'zod';
|
|
175
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
177
176
|
|
|
178
177
|
@Tool({
|
|
179
178
|
name: 'search_users',
|
|
@@ -293,7 +292,7 @@ class AppConfigResource extends ResourceContext {
|
|
|
293
292
|
| `icons?` | Array of Icon objects for UI representation |
|
|
294
293
|
|
|
295
294
|
```typescript
|
|
296
|
-
import {
|
|
295
|
+
import { ResourceContext, ResourceTemplate } from '@frontmcp/sdk';
|
|
297
296
|
|
|
298
297
|
@ResourceTemplate({
|
|
299
298
|
name: 'user_profile',
|
|
@@ -332,8 +331,7 @@ class UserProfileResource extends ResourceContext {
|
|
|
332
331
|
| `swarm?` | Multi-agent swarm configuration |
|
|
333
332
|
|
|
334
333
|
```typescript
|
|
335
|
-
import { Agent, AgentContext } from '@frontmcp/sdk';
|
|
336
|
-
import { z } from 'zod';
|
|
334
|
+
import { Agent, AgentContext, z } from '@frontmcp/sdk';
|
|
337
335
|
|
|
338
336
|
@Agent({
|
|
339
337
|
name: 'research_agent',
|
|
@@ -499,8 +497,7 @@ class DatabaseProvider {}
|
|
|
499
497
|
| `access` | Access control configuration |
|
|
500
498
|
|
|
501
499
|
```typescript
|
|
502
|
-
import { Flow } from '@frontmcp/sdk';
|
|
503
|
-
import { z } from 'zod';
|
|
500
|
+
import { Flow, z } from '@frontmcp/sdk';
|
|
504
501
|
|
|
505
502
|
@Flow({
|
|
506
503
|
name: 'approval-flow',
|
|
@@ -536,8 +533,7 @@ class ApprovalFlow {}
|
|
|
536
533
|
| `permissions?` | Access control: `[{ action: 'execute', roles: ['admin'] }]` |
|
|
537
534
|
|
|
538
535
|
```typescript
|
|
539
|
-
import { Job, JobContext } from '@frontmcp/sdk';
|
|
540
|
-
import { z } from 'zod';
|
|
536
|
+
import { Job, JobContext, z } from '@frontmcp/sdk';
|
|
541
537
|
|
|
542
538
|
@Job({
|
|
543
539
|
name: 'sync_data',
|
|
@@ -630,7 +626,7 @@ class DeployPipeline {}
|
|
|
630
626
|
| `@Around` | Wrapping | Wraps the flow, controlling execution |
|
|
631
627
|
|
|
632
628
|
```typescript
|
|
633
|
-
import {
|
|
629
|
+
import { Around, Did, HookContext, Stage, Will } from '@frontmcp/sdk';
|
|
634
630
|
|
|
635
631
|
class AuditHooks {
|
|
636
632
|
@Will('tools:call-tool')
|
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: official-adapters
|
|
3
|
-
description:
|
|
3
|
+
description: Overview of all official FrontMCP adapters that convert external definitions into MCP primitives
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Official Adapters
|
|
7
7
|
|
|
8
|
-
Adapters convert external definitions (OpenAPI specs, Lambda functions, etc.) into MCP tools, resources, and prompts automatically.
|
|
8
|
+
Adapters convert external definitions (OpenAPI specs, Lambda functions, etc.) into MCP tools, resources, and prompts automatically. They are registered in the `adapters` array of `@App`.
|
|
9
9
|
|
|
10
10
|
## When to Use This Skill
|
|
11
11
|
|
|
12
12
|
### Must Use
|
|
13
13
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- Setting up authentication (API key, bearer token, OAuth) for an adapter-generated API integration
|
|
14
|
+
- Integrating an external API or service that has a machine-readable specification
|
|
15
|
+
- Auto-generating MCP tools from an API definition instead of writing them manually
|
|
17
16
|
|
|
18
17
|
### Recommended
|
|
19
18
|
|
|
20
19
|
- Registering multiple external APIs as namespaced tool sets in a single server
|
|
21
|
-
-
|
|
22
|
-
- Providing an inline OpenAPI spec for APIs without a hosted spec URL
|
|
20
|
+
- Setting up authentication, polling, or transforms for adapter-generated tools
|
|
23
21
|
|
|
24
22
|
### Skip When
|
|
25
23
|
|
|
26
|
-
- The external API has no
|
|
24
|
+
- The external API has no machine-readable spec and uses a custom protocol (see `create-adapter`)
|
|
27
25
|
- You need cross-cutting behavior like caching or logging (see `create-plugin` or `official-plugins`)
|
|
28
26
|
- You are building tools manually without an external spec (see `create-tool`)
|
|
29
27
|
|
|
30
|
-
> **Decision:** Use this skill when you have an
|
|
28
|
+
> **Decision:** Use this skill when you have an external API definition and want to automatically generate MCP primitives from it.
|
|
31
29
|
|
|
32
|
-
##
|
|
30
|
+
## Available Adapters
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
| Adapter | Package | Description | Dedicated Skill |
|
|
33
|
+
| ------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
|
|
34
|
+
| **OpenAPI Adapter** | `@frontmcp/adapters` | Converts OpenAPI 3.x specifications into MCP tools — one tool per operation. Supports authentication, spec polling, filtering, transforms, format resolution, and $ref security. | [`openapi-adapter`](openapi-adapter.md) |
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
> More adapters will be added in future releases. To build a custom adapter for a non-OpenAPI source, see `create-adapter`.
|
|
37
|
+
|
|
38
|
+
## Quick Start
|
|
37
39
|
|
|
38
40
|
```typescript
|
|
39
41
|
import { OpenapiAdapter } from '@frontmcp/adapters';
|
|
@@ -48,99 +50,10 @@ import { OpenapiAdapter } from '@frontmcp/adapters';
|
|
|
48
50
|
],
|
|
49
51
|
})
|
|
50
52
|
class MyApp {}
|
|
53
|
+
// Generated tools: petstore:addPet, petstore:getPetById, petstore:deletePet, etc.
|
|
51
54
|
```
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
### With Authentication
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
// API Key via static auth
|
|
59
|
-
OpenapiAdapter.init({
|
|
60
|
-
name: 'my-api',
|
|
61
|
-
url: 'https://api.example.com/openapi.json',
|
|
62
|
-
baseUrl: 'https://api.example.com',
|
|
63
|
-
staticAuth: {
|
|
64
|
-
apiKey: process.env.API_KEY!,
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// API Key via additional headers
|
|
69
|
-
OpenapiAdapter.init({
|
|
70
|
-
name: 'my-api',
|
|
71
|
-
url: 'https://api.example.com/openapi.json',
|
|
72
|
-
baseUrl: 'https://api.example.com',
|
|
73
|
-
additionalHeaders: {
|
|
74
|
-
'X-API-Key': process.env.API_KEY!,
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
// Bearer token via static auth
|
|
79
|
-
OpenapiAdapter.init({
|
|
80
|
-
name: 'my-api',
|
|
81
|
-
url: 'https://api.example.com/openapi.json',
|
|
82
|
-
baseUrl: 'https://api.example.com',
|
|
83
|
-
staticAuth: {
|
|
84
|
-
jwt: process.env.API_TOKEN!,
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// Dynamic auth per tool using securityResolver
|
|
89
|
-
OpenapiAdapter.init({
|
|
90
|
-
name: 'my-api',
|
|
91
|
-
url: 'https://api.example.com/openapi.json',
|
|
92
|
-
baseUrl: 'https://api.example.com',
|
|
93
|
-
securityResolver: (tool, ctx) => {
|
|
94
|
-
return { jwt: ctx.authInfo?.token };
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Spec Polling
|
|
100
|
-
|
|
101
|
-
Automatically refresh the OpenAPI spec at intervals:
|
|
102
|
-
|
|
103
|
-
```typescript
|
|
104
|
-
OpenapiAdapter.init({
|
|
105
|
-
name: 'evolving-api',
|
|
106
|
-
url: 'https://api.example.com/openapi.json',
|
|
107
|
-
polling: {
|
|
108
|
-
intervalMs: 300000, // Re-fetch every 5 minutes
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### Inline Spec
|
|
114
|
-
|
|
115
|
-
Provide the OpenAPI spec directly instead of fetching from URL:
|
|
116
|
-
|
|
117
|
-
```typescript
|
|
118
|
-
OpenapiAdapter.init({
|
|
119
|
-
name: 'my-api',
|
|
120
|
-
spec: {
|
|
121
|
-
openapi: '3.0.0',
|
|
122
|
-
info: { title: 'My API', version: '1.0.0' },
|
|
123
|
-
paths: { ... },
|
|
124
|
-
},
|
|
125
|
-
})
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Multiple Adapters
|
|
129
|
-
|
|
130
|
-
Register adapters from different APIs in the same app:
|
|
131
|
-
|
|
132
|
-
```typescript
|
|
133
|
-
@App({
|
|
134
|
-
name: 'IntegrationHub',
|
|
135
|
-
adapters: [
|
|
136
|
-
OpenapiAdapter.init({ name: 'github', url: 'https://api.github.com/openapi.json' }),
|
|
137
|
-
OpenapiAdapter.init({ name: 'jira', url: 'https://jira.example.com/openapi.json' }),
|
|
138
|
-
OpenapiAdapter.init({ name: 'slack', url: 'https://slack.com/openapi.json' }),
|
|
139
|
-
],
|
|
140
|
-
})
|
|
141
|
-
class IntegrationHub {}
|
|
142
|
-
// Tools: github:createIssue, jira:createTicket, slack:postMessage, etc.
|
|
143
|
-
```
|
|
56
|
+
For full configuration, authentication, security, and advanced features, see the [`openapi-adapter`](openapi-adapter.md) reference.
|
|
144
57
|
|
|
145
58
|
## Adapter vs Plugin
|
|
146
59
|
|
|
@@ -153,57 +66,15 @@ class IntegrationHub {}
|
|
|
153
66
|
|
|
154
67
|
## Common Patterns
|
|
155
68
|
|
|
156
|
-
| Pattern | Correct | Incorrect
|
|
157
|
-
| -------------------- | ---------------------------------------------------------------------------- |
|
|
158
|
-
| Adapter registration | `OpenapiAdapter.init({
|
|
159
|
-
| Tool naming | Tools auto-named as
|
|
160
|
-
|
|
|
161
|
-
| Spec source | Use `url` for hosted specs or `spec` for inline definitions | Using both `url` and `spec` simultaneously | Only one source should be provided; `spec` takes precedence and `url` is ignored |
|
|
162
|
-
| Multiple APIs | Register separate `OpenapiAdapter.init()` calls with unique `name` values | Using the same `name` for different adapters | Duplicate names cause tool naming collisions |
|
|
163
|
-
|
|
164
|
-
## Verification Checklist
|
|
165
|
-
|
|
166
|
-
### Configuration
|
|
167
|
-
|
|
168
|
-
- [ ] `@frontmcp/adapters` package is installed
|
|
169
|
-
- [ ] `OpenapiAdapter.init()` is in the `adapters` array of `@App`
|
|
170
|
-
- [ ] Adapter has a unique `name` for tool namespacing
|
|
171
|
-
- [ ] `url` points to a valid, reachable OpenAPI JSON/YAML endpoint (or `spec` is inline)
|
|
172
|
-
|
|
173
|
-
### Runtime
|
|
174
|
-
|
|
175
|
-
- [ ] Generated tools appear in `tools/list` with `<name>:<operationId>` naming
|
|
176
|
-
- [ ] Auth headers are sent correctly on API calls
|
|
177
|
-
- [ ] Spec polling refreshes tool definitions at the configured interval
|
|
178
|
-
- [ ] Invalid spec URL produces a clear startup error
|
|
179
|
-
|
|
180
|
-
### Production
|
|
181
|
-
|
|
182
|
-
- [ ] API tokens and secrets are loaded from environment variables
|
|
183
|
-
- [ ] Polling interval is appropriate for the API's update frequency
|
|
184
|
-
- [ ] Multiple adapter registrations use distinct names
|
|
185
|
-
|
|
186
|
-
## Troubleshooting
|
|
187
|
-
|
|
188
|
-
| Problem | Cause | Solution |
|
|
189
|
-
| ---------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
190
|
-
| No tools generated from spec | Spec URL returns non-OpenAPI content or is unreachable | Verify URL returns valid OpenAPI 3.x JSON; check network access |
|
|
191
|
-
| Authentication errors on API calls | Wrong auth config or missing credentials | Configure `staticAuth` for fixed credentials, `securityResolver`/`authProviderMapper` for dynamic auth, or `additionalHeaders` for header-based tokens; verify env vars are set |
|
|
192
|
-
| Duplicate tool name error | Two adapters registered with the same `name` | Give each adapter a unique `name` (e.g., `'github'`, `'jira'`) |
|
|
193
|
-
| Stale tools after API update | Spec polling not configured | Add `polling: { intervalMs: 300000 }` to refresh every 5 minutes |
|
|
194
|
-
| TypeScript error importing adapter | Wrong import path | Import from `@frontmcp/adapters`: `import { OpenapiAdapter } from '@frontmcp/adapters'` |
|
|
195
|
-
|
|
196
|
-
## Examples
|
|
197
|
-
|
|
198
|
-
| Example | Level | Description |
|
|
199
|
-
| ----------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
200
|
-
| [`authenticated-adapter-with-polling`](../examples/official-adapters/authenticated-adapter-with-polling.md) | Intermediate | Demonstrates configuring authentication (API key and bearer token) and automatic spec polling for OpenAPI adapters. |
|
|
201
|
-
| [`basic-openapi-adapter`](../examples/official-adapters/basic-openapi-adapter.md) | Basic | Demonstrates converting an OpenAPI specification into MCP tools automatically using `OpenapiAdapter` with minimal configuration. |
|
|
202
|
-
| [`multi-api-hub-with-inline-spec`](../examples/official-adapters/multi-api-hub-with-inline-spec.md) | Advanced | Demonstrates registering multiple OpenAPI adapters from different APIs in a single app, including one with an inline spec definition instead of a remote URL. |
|
|
203
|
-
|
|
204
|
-
> See all examples in [`examples/official-adapters/`](../examples/official-adapters/)
|
|
69
|
+
| Pattern | Correct | Incorrect | Why |
|
|
70
|
+
| -------------------- | ---------------------------------------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------ |
|
|
71
|
+
| Adapter registration | `OpenapiAdapter.init({ ... })` in `adapters` array | Placing adapter in `plugins` array | Adapters go in `adapters`, not `plugins`; they serve different purposes |
|
|
72
|
+
| Tool naming | Tools auto-named as `<name>:<operationId>` using adapter `name` as namespace | Expecting flat names like `listPets` | Adapter name is prepended to prevent collisions across multiple adapters |
|
|
73
|
+
| Multiple APIs | Register separate `OpenapiAdapter.init()` calls with unique `name` values | Using the same `name` for different adapters | Duplicate names cause tool naming collisions |
|
|
205
74
|
|
|
206
75
|
## Reference
|
|
207
76
|
|
|
77
|
+
- [`openapi-adapter`](openapi-adapter.md) — Full OpenAPI adapter reference
|
|
78
|
+
- `create-adapter` — Build a custom adapter for non-OpenAPI sources
|
|
79
|
+
- `create-plugin` — Build plugins for cross-cutting concerns
|
|
208
80
|
- [Adapter Overview Documentation](https://docs.agentfront.dev/frontmcp/adapters/overview)
|
|
209
|
-
- Related skills: `create-adapter`, `create-plugin`, `create-tool`
|