@frontmcp/skills 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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/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-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 +325 -3
- package/package.json +1 -1
|
@@ -120,6 +120,7 @@ weather-api/
|
|
|
120
120
|
|
|
121
121
|
```typescript
|
|
122
122
|
import { FrontMcp } from '@frontmcp/sdk';
|
|
123
|
+
|
|
123
124
|
import { WeatherApp } from './weather.app';
|
|
124
125
|
|
|
125
126
|
@FrontMcp({
|
|
@@ -132,8 +133,7 @@ export default class WeatherServer {}
|
|
|
132
133
|
**Tool** (`create-tool`):
|
|
133
134
|
|
|
134
135
|
```typescript
|
|
135
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
136
|
-
import { z } from 'zod';
|
|
136
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
137
137
|
|
|
138
138
|
@Tool({
|
|
139
139
|
name: 'get_weather',
|
|
@@ -225,8 +225,8 @@ export default class TaskManagerServer {}
|
|
|
225
225
|
**Provider for shared storage** (`create-provider`):
|
|
226
226
|
|
|
227
227
|
```typescript
|
|
228
|
-
import { Provider } from '@frontmcp/sdk';
|
|
229
228
|
import type { Token } from '@frontmcp/di';
|
|
229
|
+
import { Provider } from '@frontmcp/sdk';
|
|
230
230
|
|
|
231
231
|
export interface TaskStore {
|
|
232
232
|
create(task: Task): Promise<Task>;
|
|
@@ -21,10 +21,10 @@ Shows an autonomous research agent with inner tools and configurable depth, and
|
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
23
|
// src/research/agents/researcher.agent.ts
|
|
24
|
-
import { Agent, AgentContext } from '@frontmcp/sdk';
|
|
25
|
-
|
|
26
|
-
import { SearchDocsTool } from '../../search/tools/search-docs.tool';
|
|
24
|
+
import { Agent, AgentContext, z } from '@frontmcp/sdk';
|
|
25
|
+
|
|
27
26
|
import { IngestDocumentTool } from '../../ingestion/tools/ingest-document.tool';
|
|
27
|
+
import { SearchDocsTool } from '../../search/tools/search-docs.tool';
|
|
28
28
|
|
|
29
29
|
@Agent({
|
|
30
30
|
name: 'research_topic',
|
|
@@ -79,8 +79,7 @@ export class ResearcherAgent extends AgentContext {
|
|
|
79
79
|
|
|
80
80
|
```typescript
|
|
81
81
|
// src/plugins/audit-log.plugin.ts
|
|
82
|
-
import { Plugin } from '@frontmcp/sdk';
|
|
83
|
-
import type { PluginHookContext } from '@frontmcp/sdk';
|
|
82
|
+
import { Plugin, type PluginHookContext } from '@frontmcp/sdk';
|
|
84
83
|
|
|
85
84
|
@Plugin({
|
|
86
85
|
name: 'AuditLog',
|
package/catalog/frontmcp-guides/examples/example-knowledge-base/vector-search-and-resources.md
CHANGED
|
@@ -20,8 +20,8 @@ Shows a semantic search tool with embedding generation and a resource template f
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
// src/search/tools/search-docs.tool.ts
|
|
23
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
24
|
-
|
|
23
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
|
+
|
|
25
25
|
import { VECTOR_STORE } from '../../ingestion/providers/vector-store.provider';
|
|
26
26
|
|
|
27
27
|
@Tool({
|
|
@@ -81,8 +81,9 @@ export class SearchDocsTool extends ToolContext {
|
|
|
81
81
|
|
|
82
82
|
```typescript
|
|
83
83
|
// src/search/resources/doc.resource.ts
|
|
84
|
-
import { ResourceTemplate, ResourceContext } from '@frontmcp/sdk';
|
|
85
84
|
import type { ReadResourceResult } from '@frontmcp/protocol';
|
|
85
|
+
import { ResourceContext, ResourceTemplate } from '@frontmcp/sdk';
|
|
86
|
+
|
|
86
87
|
import { VECTOR_STORE } from '../../ingestion/providers/vector-store.provider';
|
|
87
88
|
|
|
88
89
|
@ResourceTemplate({
|
|
@@ -20,8 +20,8 @@ Shows how to create CRUD tools with authentication, using `this.context.session`
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
// src/tools/create-task.tool.ts
|
|
23
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
24
|
-
|
|
23
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
|
+
|
|
25
25
|
import { TASK_STORE } from '../providers/task-store.provider';
|
|
26
26
|
|
|
27
27
|
@Tool({
|
|
@@ -70,8 +70,8 @@ export class CreateTaskTool extends ToolContext {
|
|
|
70
70
|
|
|
71
71
|
```typescript
|
|
72
72
|
// src/tools/list-tasks.tool.ts
|
|
73
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
74
|
-
|
|
73
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
74
|
+
|
|
75
75
|
import { TASK_STORE } from '../providers/task-store.provider';
|
|
76
76
|
|
|
77
77
|
@Tool({
|
|
@@ -20,8 +20,7 @@ Shows how to create a tool with Zod input and output schemas, use `this.fetch()`
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
// src/tools/get-weather.tool.ts
|
|
23
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
24
|
-
import { z } from 'zod';
|
|
23
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
25
24
|
|
|
26
25
|
@Tool({
|
|
27
26
|
name: 'get_weather',
|
|
@@ -16,10 +16,11 @@ A multi-app knowledge base MCP server with three composed apps: document ingesti
|
|
|
16
16
|
```typescript
|
|
17
17
|
// src/main.ts
|
|
18
18
|
import { FrontMcp } from '@frontmcp/sdk';
|
|
19
|
+
|
|
19
20
|
import { IngestionApp } from './ingestion/ingestion.app';
|
|
20
|
-
import { SearchApp } from './search/search.app';
|
|
21
|
-
import { ResearchApp } from './research/research.app';
|
|
22
21
|
import { AuditLogPlugin } from './plugins/audit-log.plugin';
|
|
22
|
+
import { ResearchApp } from './research/research.app';
|
|
23
|
+
import { SearchApp } from './search/search.app';
|
|
23
24
|
|
|
24
25
|
@FrontMcp({
|
|
25
26
|
info: { name: 'knowledge-base', version: '1.0.0' },
|
|
@@ -40,6 +41,7 @@ export default class KnowledgeBaseServer {}
|
|
|
40
41
|
```typescript
|
|
41
42
|
// src/ingestion/ingestion.app.ts
|
|
42
43
|
import { App } from '@frontmcp/sdk';
|
|
44
|
+
|
|
43
45
|
import { VectorStoreProvider } from './providers/vector-store.provider';
|
|
44
46
|
import { IngestDocumentTool } from './tools/ingest-document.tool';
|
|
45
47
|
|
|
@@ -56,8 +58,8 @@ export class IngestionApp {}
|
|
|
56
58
|
|
|
57
59
|
```typescript
|
|
58
60
|
// src/ingestion/providers/vector-store.provider.ts
|
|
59
|
-
import { Provider } from '@frontmcp/sdk';
|
|
60
61
|
import type { Token } from '@frontmcp/di';
|
|
62
|
+
import { Provider } from '@frontmcp/sdk';
|
|
61
63
|
|
|
62
64
|
export interface DocumentChunk {
|
|
63
65
|
id: string;
|
|
@@ -142,10 +144,9 @@ export class VectorStoreProvider implements VectorStore {
|
|
|
142
144
|
|
|
143
145
|
```typescript
|
|
144
146
|
// src/ingestion/tools/ingest-document.tool.ts
|
|
145
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
146
|
-
|
|
147
|
-
import { VECTOR_STORE } from '../providers/vector-store.provider';
|
|
148
|
-
import type { DocumentChunk } from '../providers/vector-store.provider';
|
|
147
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
148
|
+
|
|
149
|
+
import { VECTOR_STORE, type DocumentChunk } from '../providers/vector-store.provider';
|
|
149
150
|
|
|
150
151
|
@Tool({
|
|
151
152
|
name: 'ingest_document',
|
|
@@ -238,9 +239,10 @@ export class IngestDocumentTool extends ToolContext {
|
|
|
238
239
|
```typescript
|
|
239
240
|
// src/search/search.app.ts
|
|
240
241
|
import { App } from '@frontmcp/sdk';
|
|
242
|
+
|
|
241
243
|
import { VectorStoreProvider } from '../ingestion/providers/vector-store.provider';
|
|
242
|
-
import { SearchDocsTool } from './tools/search-docs.tool';
|
|
243
244
|
import { DocResource } from './resources/doc.resource';
|
|
245
|
+
import { SearchDocsTool } from './tools/search-docs.tool';
|
|
244
246
|
|
|
245
247
|
@App({
|
|
246
248
|
name: 'Search',
|
|
@@ -256,8 +258,8 @@ export class SearchApp {}
|
|
|
256
258
|
|
|
257
259
|
```typescript
|
|
258
260
|
// src/search/tools/search-docs.tool.ts
|
|
259
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
260
|
-
|
|
261
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
262
|
+
|
|
261
263
|
import { VECTOR_STORE } from '../../ingestion/providers/vector-store.provider';
|
|
262
264
|
|
|
263
265
|
@Tool({
|
|
@@ -318,8 +320,9 @@ export class SearchDocsTool extends ToolContext {
|
|
|
318
320
|
|
|
319
321
|
```typescript
|
|
320
322
|
// src/search/resources/doc.resource.ts
|
|
321
|
-
import { ResourceTemplate, ResourceContext } from '@frontmcp/sdk';
|
|
322
323
|
import type { ReadResourceResult } from '@frontmcp/protocol';
|
|
324
|
+
import { ResourceContext, ResourceTemplate } from '@frontmcp/sdk';
|
|
325
|
+
|
|
323
326
|
import { VECTOR_STORE } from '../../ingestion/providers/vector-store.provider';
|
|
324
327
|
|
|
325
328
|
@ResourceTemplate({
|
|
@@ -368,6 +371,7 @@ export class DocResource extends ResourceContext<{ documentId: string }> {
|
|
|
368
371
|
```typescript
|
|
369
372
|
// src/research/research.app.ts
|
|
370
373
|
import { App } from '@frontmcp/sdk';
|
|
374
|
+
|
|
371
375
|
import { ResearcherAgent } from './agents/researcher.agent';
|
|
372
376
|
|
|
373
377
|
@App({
|
|
@@ -382,10 +386,10 @@ export class ResearchApp {}
|
|
|
382
386
|
|
|
383
387
|
```typescript
|
|
384
388
|
// src/research/agents/researcher.agent.ts
|
|
385
|
-
import { Agent, AgentContext } from '@frontmcp/sdk';
|
|
386
|
-
|
|
387
|
-
import { SearchDocsTool } from '../../search/tools/search-docs.tool';
|
|
389
|
+
import { Agent, AgentContext, z } from '@frontmcp/sdk';
|
|
390
|
+
|
|
388
391
|
import { IngestDocumentTool } from '../../ingestion/tools/ingest-document.tool';
|
|
392
|
+
import { SearchDocsTool } from '../../search/tools/search-docs.tool';
|
|
389
393
|
|
|
390
394
|
@Agent({
|
|
391
395
|
name: 'research_topic',
|
|
@@ -442,8 +446,7 @@ export class ResearcherAgent extends AgentContext {
|
|
|
442
446
|
|
|
443
447
|
```typescript
|
|
444
448
|
// src/plugins/audit-log.plugin.ts
|
|
445
|
-
import { Plugin } from '@frontmcp/sdk';
|
|
446
|
-
import type { PluginHookContext } from '@frontmcp/sdk';
|
|
449
|
+
import { Plugin, type PluginHookContext } from '@frontmcp/sdk';
|
|
447
450
|
|
|
448
451
|
@Plugin({
|
|
449
452
|
name: 'AuditLog',
|
|
@@ -515,6 +518,7 @@ export class AuditLogPlugin {
|
|
|
515
518
|
```typescript
|
|
516
519
|
// test/researcher.agent.spec.ts
|
|
517
520
|
import { AgentContext } from '@frontmcp/sdk';
|
|
521
|
+
|
|
518
522
|
import { ResearcherAgent } from '../src/research/agents/researcher.agent';
|
|
519
523
|
|
|
520
524
|
describe('ResearcherAgent', () => {
|
|
@@ -590,9 +594,10 @@ describe('ResearcherAgent', () => {
|
|
|
590
594
|
|
|
591
595
|
```typescript
|
|
592
596
|
// test/audit-log.plugin.spec.ts
|
|
593
|
-
import { AuditLogPlugin } from '../src/plugins/audit-log.plugin';
|
|
594
597
|
import type { PluginHookContext } from '@frontmcp/sdk';
|
|
595
598
|
|
|
599
|
+
import { AuditLogPlugin } from '../src/plugins/audit-log.plugin';
|
|
600
|
+
|
|
596
601
|
describe('AuditLogPlugin', () => {
|
|
597
602
|
let plugin: AuditLogPlugin;
|
|
598
603
|
|
|
@@ -45,6 +45,7 @@ An authenticated task management MCP server with CRUD tools, a Redis-backed prov
|
|
|
45
45
|
```typescript
|
|
46
46
|
// src/main.ts
|
|
47
47
|
import { FrontMcp } from '@frontmcp/sdk';
|
|
48
|
+
|
|
48
49
|
import { TasksApp } from './tasks.app';
|
|
49
50
|
|
|
50
51
|
@FrontMcp({
|
|
@@ -63,11 +64,12 @@ export default class TaskManagerServer {}
|
|
|
63
64
|
```typescript
|
|
64
65
|
// src/tasks.app.ts
|
|
65
66
|
import { App } from '@frontmcp/sdk';
|
|
67
|
+
|
|
66
68
|
import { RedisTaskStoreProvider } from './providers/task-store.provider';
|
|
67
69
|
import { CreateTaskTool } from './tools/create-task.tool';
|
|
70
|
+
import { DeleteTaskTool } from './tools/delete-task.tool';
|
|
68
71
|
import { ListTasksTool } from './tools/list-tasks.tool';
|
|
69
72
|
import { UpdateTaskTool } from './tools/update-task.tool';
|
|
70
|
-
import { DeleteTaskTool } from './tools/delete-task.tool';
|
|
71
73
|
|
|
72
74
|
@App({
|
|
73
75
|
name: 'Tasks',
|
|
@@ -100,8 +102,9 @@ export interface Task {
|
|
|
100
102
|
|
|
101
103
|
```typescript
|
|
102
104
|
// src/providers/task-store.provider.ts
|
|
103
|
-
import { Provider } from '@frontmcp/sdk';
|
|
104
105
|
import type { Token } from '@frontmcp/di';
|
|
106
|
+
import { Provider } from '@frontmcp/sdk';
|
|
107
|
+
|
|
105
108
|
import type { Task } from '../types/task';
|
|
106
109
|
|
|
107
110
|
export interface TaskStore {
|
|
@@ -167,8 +170,8 @@ export class RedisTaskStoreProvider implements TaskStore {
|
|
|
167
170
|
|
|
168
171
|
```typescript
|
|
169
172
|
// src/tools/create-task.tool.ts
|
|
170
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
171
|
-
|
|
173
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
174
|
+
|
|
172
175
|
import { TASK_STORE } from '../providers/task-store.provider';
|
|
173
176
|
|
|
174
177
|
@Tool({
|
|
@@ -219,8 +222,8 @@ export class CreateTaskTool extends ToolContext {
|
|
|
219
222
|
|
|
220
223
|
```typescript
|
|
221
224
|
// src/tools/list-tasks.tool.ts
|
|
222
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
223
|
-
|
|
225
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
226
|
+
|
|
224
227
|
import { TASK_STORE } from '../providers/task-store.provider';
|
|
225
228
|
|
|
226
229
|
@Tool({
|
|
@@ -277,8 +280,8 @@ export class ListTasksTool extends ToolContext {
|
|
|
277
280
|
|
|
278
281
|
```typescript
|
|
279
282
|
// src/tools/update-task.tool.ts
|
|
280
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
281
|
-
|
|
283
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
284
|
+
|
|
282
285
|
import { TASK_STORE } from '../providers/task-store.provider';
|
|
283
286
|
|
|
284
287
|
@Tool({
|
|
@@ -331,8 +334,8 @@ export class UpdateTaskTool extends ToolContext {
|
|
|
331
334
|
|
|
332
335
|
```typescript
|
|
333
336
|
// src/tools/delete-task.tool.ts
|
|
334
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
335
|
-
|
|
337
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
338
|
+
|
|
336
339
|
import { TASK_STORE } from '../providers/task-store.provider';
|
|
337
340
|
|
|
338
341
|
@Tool({
|
|
@@ -385,8 +388,9 @@ export class DeleteTaskTool extends ToolContext {
|
|
|
385
388
|
```typescript
|
|
386
389
|
// test/create-task.tool.spec.ts
|
|
387
390
|
import { ToolContext } from '@frontmcp/sdk';
|
|
388
|
-
|
|
391
|
+
|
|
389
392
|
import { TASK_STORE, type TaskStore } from '../src/providers/task-store.provider';
|
|
393
|
+
import { CreateTaskTool } from '../src/tools/create-task.tool';
|
|
390
394
|
import type { Task } from '../src/types/task';
|
|
391
395
|
|
|
392
396
|
describe('CreateTaskTool', () => {
|
|
@@ -465,6 +469,7 @@ describe('CreateTaskTool', () => {
|
|
|
465
469
|
```typescript
|
|
466
470
|
// test/tasks.e2e.spec.ts
|
|
467
471
|
import { McpTestClient, TestServer, TestTokenFactory } from '@frontmcp/testing';
|
|
472
|
+
|
|
468
473
|
import Server from '../src/main';
|
|
469
474
|
|
|
470
475
|
describe('Task Manager E2E', () => {
|
|
@@ -44,6 +44,7 @@ A complete beginner MCP server that exposes a weather lookup tool and a static r
|
|
|
44
44
|
```typescript
|
|
45
45
|
// src/main.ts
|
|
46
46
|
import { FrontMcp } from '@frontmcp/sdk';
|
|
47
|
+
|
|
47
48
|
import { WeatherApp } from './weather.app';
|
|
48
49
|
|
|
49
50
|
@FrontMcp({
|
|
@@ -60,8 +61,9 @@ export default class WeatherServer {}
|
|
|
60
61
|
```typescript
|
|
61
62
|
// src/weather.app.ts
|
|
62
63
|
import { App } from '@frontmcp/sdk';
|
|
63
|
-
|
|
64
|
+
|
|
64
65
|
import { CitiesResource } from './resources/cities.resource';
|
|
66
|
+
import { GetWeatherTool } from './tools/get-weather.tool';
|
|
65
67
|
|
|
66
68
|
@App({
|
|
67
69
|
name: 'Weather',
|
|
@@ -78,8 +80,7 @@ export class WeatherApp {}
|
|
|
78
80
|
|
|
79
81
|
```typescript
|
|
80
82
|
// src/tools/get-weather.tool.ts
|
|
81
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
82
|
-
import { z } from 'zod';
|
|
83
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
83
84
|
|
|
84
85
|
@Tool({
|
|
85
86
|
name: 'get_weather',
|
|
@@ -149,6 +150,7 @@ export class CitiesResource extends ResourceContext {
|
|
|
149
150
|
```typescript
|
|
150
151
|
// test/get-weather.tool.spec.ts
|
|
151
152
|
import { ToolContext } from '@frontmcp/sdk';
|
|
153
|
+
|
|
152
154
|
import { GetWeatherTool } from '../src/tools/get-weather.tool';
|
|
153
155
|
|
|
154
156
|
describe('GetWeatherTool', () => {
|
|
@@ -239,6 +241,7 @@ describe('GetWeatherTool', () => {
|
|
|
239
241
|
```typescript
|
|
240
242
|
// test/weather.e2e.spec.ts
|
|
241
243
|
import { McpTestClient, TestServer } from '@frontmcp/testing';
|
|
244
|
+
|
|
242
245
|
import Server from '../src/main';
|
|
243
246
|
|
|
244
247
|
describe('Weather Server E2E', () => {
|
|
@@ -19,15 +19,14 @@ Create child spans, events, and attributes inside a tool's execute method using
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/apps/my-app/tools/weather.tool.ts
|
|
22
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
23
|
-
import { z } from 'zod';
|
|
22
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
23
|
|
|
25
24
|
@Tool({
|
|
26
25
|
name: 'get_weather',
|
|
27
26
|
description: 'Get weather for a city',
|
|
28
27
|
inputSchema: { city: z.string() },
|
|
29
28
|
})
|
|
30
|
-
export class GetWeatherTool extends ToolContext
|
|
29
|
+
export class GetWeatherTool extends ToolContext {
|
|
31
30
|
async execute({ city }: { city: string }) {
|
|
32
31
|
// Event on the "tool get_weather" span
|
|
33
32
|
this.telemetry.addEvent('request-received', { city });
|
|
@@ -27,7 +27,9 @@ setupOTel({ serviceName: 'my-server', exporter: 'console' });
|
|
|
27
27
|
```typescript
|
|
28
28
|
// src/server.ts
|
|
29
29
|
import './setup-otel'; // Must be first import
|
|
30
|
+
|
|
30
31
|
import { FrontMcp } from '@frontmcp/sdk';
|
|
32
|
+
|
|
31
33
|
import { MyApp } from './apps/my-app';
|
|
32
34
|
|
|
33
35
|
@FrontMcp({
|
|
@@ -40,15 +42,14 @@ export default class Server {}
|
|
|
40
42
|
|
|
41
43
|
```typescript
|
|
42
44
|
// src/apps/my-app/tools/hello.tool.ts
|
|
43
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
44
|
-
import { z } from 'zod';
|
|
45
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
45
46
|
|
|
46
47
|
@Tool({
|
|
47
48
|
name: 'hello',
|
|
48
49
|
description: 'Say hello',
|
|
49
50
|
inputSchema: { name: z.string() },
|
|
50
51
|
})
|
|
51
|
-
export class HelloTool extends ToolContext
|
|
52
|
+
export class HelloTool extends ToolContext {
|
|
52
53
|
async execute({ name }: { name: string }) {
|
|
53
54
|
return { greeting: `Hello, ${name}!` };
|
|
54
55
|
}
|
|
@@ -22,15 +22,14 @@ Every execution context (tools, resources, prompts, agents) gets a `this.telemet
|
|
|
22
22
|
## Usage in Tools
|
|
23
23
|
|
|
24
24
|
```typescript
|
|
25
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
26
|
-
import { z } from 'zod';
|
|
25
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
27
26
|
|
|
28
27
|
@Tool({
|
|
29
28
|
name: 'analyze_data',
|
|
30
29
|
description: 'Analyze dataset with custom telemetry',
|
|
31
30
|
inputSchema: { datasetId: z.string() },
|
|
32
31
|
})
|
|
33
|
-
class AnalyzeDataTool extends ToolContext
|
|
32
|
+
class AnalyzeDataTool extends ToolContext {
|
|
34
33
|
async execute({ datasetId }: { datasetId: string }) {
|
|
35
34
|
// Events go on the "tool analyze_data" span
|
|
36
35
|
this.telemetry.addEvent('analysis-started', { datasetId });
|
package/catalog/frontmcp-production-readiness/examples/common-checklist/observability-setup.md
CHANGED
|
@@ -19,8 +19,7 @@ Shows how to configure structured logging, error handling with MCP error codes,
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/tools/monitored-tool.tool.ts
|
|
22
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
23
|
-
import { z } from 'zod';
|
|
22
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
23
|
|
|
25
24
|
@Tool({
|
|
26
25
|
name: 'monitored_operation',
|
package/catalog/frontmcp-production-readiness/examples/common-checklist/security-hardening.md
CHANGED
|
@@ -19,8 +19,8 @@ Shows how to configure authentication, CORS, input validation, and rate limiting
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/main.ts
|
|
22
|
-
import { FrontMcp } from '@frontmcp/sdk';
|
|
23
|
-
|
|
22
|
+
import { FrontMcp, z } from '@frontmcp/sdk';
|
|
23
|
+
|
|
24
24
|
import { MyApp } from './my.app';
|
|
25
25
|
|
|
26
26
|
@FrontMcp({
|
|
@@ -59,8 +59,7 @@ export default class SecureServer {}
|
|
|
59
59
|
|
|
60
60
|
```typescript
|
|
61
61
|
// src/tools/safe-query.tool.ts
|
|
62
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
63
|
-
import { z } from 'zod';
|
|
62
|
+
import { Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
64
63
|
|
|
65
64
|
@Tool({
|
|
66
65
|
name: 'safe_query',
|