@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
package/catalog/frontmcp-config/examples/configure-deployment-targets/json-schema-ide-support.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: json-schema-ide-support
|
|
3
|
+
reference: configure-deployment-targets
|
|
4
|
+
level: basic
|
|
5
|
+
description: Use frontmcp.config.json with JSON Schema for VS Code and WebStorm autocomplete
|
|
6
|
+
tags: [config, deployment, json, schema, ide, autocomplete]
|
|
7
|
+
features:
|
|
8
|
+
- Adding $schema field for IDE autocomplete in JSON config files
|
|
9
|
+
- Configuring multiple deployment targets in JSON format
|
|
10
|
+
- Using the frontmcp.schema.json for property validation and hover docs
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# JSON Config with IDE Autocomplete
|
|
14
|
+
|
|
15
|
+
Use frontmcp.config.json with JSON Schema for VS Code and WebStorm autocomplete
|
|
16
|
+
|
|
17
|
+
## Code
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"$schema": "./node_modules/@frontmcp/cli/frontmcp.schema.json",
|
|
22
|
+
"name": "my-server",
|
|
23
|
+
"version": "1.0.0",
|
|
24
|
+
"deployments": [
|
|
25
|
+
{
|
|
26
|
+
"target": "node",
|
|
27
|
+
"server": {
|
|
28
|
+
"http": { "port": 3000 },
|
|
29
|
+
"headers": {
|
|
30
|
+
"hsts": "max-age=31536000",
|
|
31
|
+
"contentTypeOptions": "nosniff",
|
|
32
|
+
"frameOptions": "DENY"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"target": "distributed",
|
|
38
|
+
"ha": {
|
|
39
|
+
"heartbeatIntervalMs": 10000,
|
|
40
|
+
"heartbeatTtlMs": 30000
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Verify
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Build all targets defined in config (no -t flag needed)
|
|
51
|
+
frontmcp build
|
|
52
|
+
# [build] Building 2 target(s) from frontmcp.config: node, distributed
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## What This Demonstrates
|
|
56
|
+
|
|
57
|
+
- Adding $schema field for IDE autocomplete in JSON config files
|
|
58
|
+
- Configuring multiple deployment targets in JSON format
|
|
59
|
+
- Using the frontmcp.schema.json for property validation and hover docs
|
|
60
|
+
|
|
61
|
+
## Related
|
|
62
|
+
|
|
63
|
+
- See `configure-deployment-targets` for the full configuration reference
|
|
64
|
+
- See `multi-target-with-security` for the TypeScript `defineConfig()` approach
|
package/catalog/frontmcp-config/examples/configure-deployment-targets/multi-target-with-security.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: multi-target-with-security
|
|
3
|
+
reference: configure-deployment-targets
|
|
4
|
+
level: intermediate
|
|
5
|
+
description: Configure a FrontMCP project with node + distributed targets, CSP headers, and HSTS
|
|
6
|
+
tags: [config, deployment, csp, security, distributed, hsts, multi-target]
|
|
7
|
+
features:
|
|
8
|
+
- Using defineConfig() for typed configuration with IDE autocomplete
|
|
9
|
+
- Multi-target deployments with per-target server settings
|
|
10
|
+
- CSP directives including value-less directives like upgrade-insecure-requests
|
|
11
|
+
- Security headers (HSTS, X-Frame-Options, X-Content-Type-Options)
|
|
12
|
+
- HA configuration for the distributed target
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Multi-Target Configuration with Security Headers
|
|
16
|
+
|
|
17
|
+
Configure a FrontMCP project with node + distributed targets, CSP headers, and HSTS
|
|
18
|
+
|
|
19
|
+
## Code
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
// frontmcp.config.ts
|
|
23
|
+
import { defineConfig } from '@frontmcp/cli';
|
|
24
|
+
|
|
25
|
+
export default defineConfig({
|
|
26
|
+
name: 'secure-server',
|
|
27
|
+
version: '1.0.0',
|
|
28
|
+
deployments: [
|
|
29
|
+
// Target 1: Standalone Node.js for development and single-server production
|
|
30
|
+
{
|
|
31
|
+
target: 'node',
|
|
32
|
+
server: {
|
|
33
|
+
http: { port: 3000 },
|
|
34
|
+
csp: {
|
|
35
|
+
enabled: true,
|
|
36
|
+
directives: [
|
|
37
|
+
"default-src 'self'",
|
|
38
|
+
"script-src 'self' https://cdn.example.com",
|
|
39
|
+
"style-src 'self' 'unsafe-inline'",
|
|
40
|
+
'img-src * data:',
|
|
41
|
+
'upgrade-insecure-requests',
|
|
42
|
+
].join('; '),
|
|
43
|
+
},
|
|
44
|
+
headers: {
|
|
45
|
+
hsts: 'max-age=31536000; includeSubDomains; preload',
|
|
46
|
+
contentTypeOptions: 'nosniff',
|
|
47
|
+
frameOptions: 'SAMEORIGIN',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
// Target 2: Distributed deployment with HA for Kubernetes
|
|
53
|
+
{
|
|
54
|
+
target: 'distributed',
|
|
55
|
+
ha: {
|
|
56
|
+
heartbeatIntervalMs: 5000,
|
|
57
|
+
heartbeatTtlMs: 15000,
|
|
58
|
+
takeoverGracePeriodMs: 3000,
|
|
59
|
+
},
|
|
60
|
+
server: {
|
|
61
|
+
csp: {
|
|
62
|
+
enabled: true,
|
|
63
|
+
directives: "default-src 'self'; upgrade-insecure-requests",
|
|
64
|
+
reportUri: 'https://report.example.com/csp',
|
|
65
|
+
reportOnly: false,
|
|
66
|
+
},
|
|
67
|
+
headers: {
|
|
68
|
+
hsts: 'max-age=63072000; includeSubDomains; preload',
|
|
69
|
+
contentTypeOptions: 'nosniff',
|
|
70
|
+
frameOptions: 'DENY',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Build Commands
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Build for standalone Node.js
|
|
82
|
+
frontmcp build --target node
|
|
83
|
+
|
|
84
|
+
# Build for distributed deployment
|
|
85
|
+
FRONTMCP_DEPLOYMENT_MODE=distributed frontmcp build --target distributed
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Verify Security Headers
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Check headers on standalone
|
|
92
|
+
curl -I http://localhost:3000/healthz
|
|
93
|
+
|
|
94
|
+
# Expected:
|
|
95
|
+
# Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.example.com; ...
|
|
96
|
+
# Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
|
|
97
|
+
# X-Content-Type-Options: nosniff
|
|
98
|
+
# X-Frame-Options: SAMEORIGIN
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## What This Demonstrates
|
|
102
|
+
|
|
103
|
+
- Using defineConfig() for typed configuration with IDE autocomplete
|
|
104
|
+
- Multi-target deployments with per-target server settings
|
|
105
|
+
- CSP directives including value-less directives like upgrade-insecure-requests
|
|
106
|
+
- Security headers (HSTS, X-Frame-Options, X-Content-Type-Options)
|
|
107
|
+
- HA configuration for the distributed target
|
|
108
|
+
|
|
109
|
+
## Related
|
|
110
|
+
|
|
111
|
+
- See `configure-deployment-targets` for the full configuration reference
|
|
112
|
+
- See `distributed-ha` for the HA architecture deep dive
|
|
113
|
+
- See `deploy-to-node` for Docker and PM2 deployment
|
|
@@ -19,8 +19,7 @@ Request user confirmation before executing a destructive action.
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/server.ts
|
|
22
|
-
import {
|
|
23
|
-
import { z } from 'zod';
|
|
22
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
23
|
|
|
25
24
|
@Tool({
|
|
26
25
|
name: 'delete_records',
|
package/catalog/frontmcp-config/examples/configure-elicitation/distributed-elicitation-redis.md
CHANGED
|
@@ -19,8 +19,7 @@ Configure elicitation with Redis storage for multi-instance production deploymen
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/server.ts
|
|
22
|
-
import {
|
|
23
|
-
import { z } from 'zod';
|
|
22
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
23
|
|
|
25
24
|
@Tool({
|
|
26
25
|
name: 'deploy_service',
|
|
@@ -19,8 +19,7 @@ Mount the MCP server under a URL prefix for reverse proxy or multi-service setup
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/server.ts
|
|
22
|
-
import {
|
|
23
|
-
import { z } from 'zod';
|
|
22
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
23
|
|
|
25
24
|
@Tool({
|
|
26
25
|
name: 'health_check',
|
|
@@ -19,8 +19,7 @@ Bind the server to a unix socket instead of a TCP port for local-only communicat
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/server.ts
|
|
22
|
-
import {
|
|
23
|
-
import { z } from 'zod';
|
|
22
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
23
|
|
|
25
24
|
@Tool({
|
|
26
25
|
name: 'system_status',
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: csp-report-only
|
|
3
|
+
reference: configure-security-headers
|
|
4
|
+
level: basic
|
|
5
|
+
description: Test CSP policies in report-only mode to identify violations before enforcement
|
|
6
|
+
tags: [config, csp, security, report-only, headers]
|
|
7
|
+
features:
|
|
8
|
+
- Enabling CSP in report-only mode with reportUri for violation monitoring
|
|
9
|
+
- Using the object-format directives in frontmcp.config
|
|
10
|
+
- Verifying report-only header is emitted instead of enforcement header
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# CSP Report-Only Mode
|
|
14
|
+
|
|
15
|
+
Test CSP policies in report-only mode to identify violations before enforcement
|
|
16
|
+
|
|
17
|
+
## Code
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
// frontmcp.config.ts
|
|
21
|
+
import { defineConfig } from '@frontmcp/cli';
|
|
22
|
+
|
|
23
|
+
export default defineConfig({
|
|
24
|
+
name: 'csp-test-server',
|
|
25
|
+
deployments: [
|
|
26
|
+
{
|
|
27
|
+
target: 'node',
|
|
28
|
+
server: {
|
|
29
|
+
csp: {
|
|
30
|
+
enabled: true,
|
|
31
|
+
reportOnly: true, // Key: report violations, don't block
|
|
32
|
+
directives: {
|
|
33
|
+
'default-src': "'self'",
|
|
34
|
+
'script-src': "'self'",
|
|
35
|
+
'style-src': "'self'",
|
|
36
|
+
'img-src': "'self' data:",
|
|
37
|
+
'connect-src': "'self'",
|
|
38
|
+
},
|
|
39
|
+
reportUri: 'https://report.example.com/csp-violations',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Verify
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
frontmcp build --target node && node dist/node/main.js
|
|
51
|
+
|
|
52
|
+
# Check which header is emitted
|
|
53
|
+
curl -sI http://localhost:3000/healthz | grep -i content-security-policy
|
|
54
|
+
# Content-Security-Policy-Report-Only: default-src 'self'; script-src 'self'; ...
|
|
55
|
+
|
|
56
|
+
# Once violations are resolved, switch to enforcement:
|
|
57
|
+
# reportOnly: false
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## What This Demonstrates
|
|
61
|
+
|
|
62
|
+
- Enabling CSP in report-only mode with reportUri for violation monitoring
|
|
63
|
+
- Using the object-format directives in frontmcp.config
|
|
64
|
+
- Verifying report-only header is emitted instead of enforcement header
|
|
65
|
+
|
|
66
|
+
## Related
|
|
67
|
+
|
|
68
|
+
- See `configure-security-headers` for the full CSP configuration reference
|
|
69
|
+
- See `full-production-headers` for the enforcement version with all security headers
|
package/catalog/frontmcp-config/examples/configure-security-headers/full-production-headers.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: full-production-headers
|
|
3
|
+
reference: configure-security-headers
|
|
4
|
+
level: intermediate
|
|
5
|
+
description: Complete security headers configuration for production with CSP enforcement, HSTS preload, and clickjacking protection
|
|
6
|
+
tags: [config, csp, security, hsts, production, headers, frame-options]
|
|
7
|
+
features:
|
|
8
|
+
- Full CSP enforcement with multiple directive types including value-less directives
|
|
9
|
+
- HSTS with preload and includeSubDomains for HTTPS enforcement
|
|
10
|
+
- X-Frame-Options DENY for clickjacking protection
|
|
11
|
+
- Custom headers for additional security controls
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Full Production Security Headers
|
|
15
|
+
|
|
16
|
+
Complete security headers configuration for production with CSP enforcement, HSTS preload, and clickjacking protection
|
|
17
|
+
|
|
18
|
+
## Code
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// frontmcp.config.ts
|
|
22
|
+
import { defineConfig } from '@frontmcp/cli';
|
|
23
|
+
|
|
24
|
+
export default defineConfig({
|
|
25
|
+
name: 'production-server',
|
|
26
|
+
version: '1.0.0',
|
|
27
|
+
deployments: [
|
|
28
|
+
{
|
|
29
|
+
target: 'distributed',
|
|
30
|
+
ha: {
|
|
31
|
+
heartbeatIntervalMs: 10000,
|
|
32
|
+
heartbeatTtlMs: 30000,
|
|
33
|
+
},
|
|
34
|
+
server: {
|
|
35
|
+
http: { port: 3000 },
|
|
36
|
+
csp: {
|
|
37
|
+
enabled: true,
|
|
38
|
+
reportOnly: false, // Enforce (not just report)
|
|
39
|
+
directives: {
|
|
40
|
+
'default-src': "'self'",
|
|
41
|
+
'script-src': "'self' https://cdn.example.com",
|
|
42
|
+
'style-src': "'self' 'unsafe-inline'",
|
|
43
|
+
'img-src': '* data: blob:',
|
|
44
|
+
'font-src': "'self' https://fonts.gstatic.com",
|
|
45
|
+
'connect-src': "'self' https://api.example.com wss://ws.example.com",
|
|
46
|
+
'frame-ancestors': "'none'",
|
|
47
|
+
'base-uri': "'self'",
|
|
48
|
+
'form-action': "'self'",
|
|
49
|
+
'upgrade-insecure-requests': '', // Value-less directive
|
|
50
|
+
},
|
|
51
|
+
reportUri: 'https://report.example.com/csp',
|
|
52
|
+
},
|
|
53
|
+
headers: {
|
|
54
|
+
hsts: 'max-age=63072000; includeSubDomains; preload',
|
|
55
|
+
contentTypeOptions: 'nosniff',
|
|
56
|
+
frameOptions: 'DENY',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Verify
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
FRONTMCP_DEPLOYMENT_MODE=distributed frontmcp build --target distributed
|
|
68
|
+
node dist/distributed/main.js
|
|
69
|
+
|
|
70
|
+
# Verify all headers
|
|
71
|
+
curl -sI http://localhost:3000/healthz
|
|
72
|
+
|
|
73
|
+
# Expected headers:
|
|
74
|
+
# Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.example.com; ...
|
|
75
|
+
# Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
|
|
76
|
+
# X-Content-Type-Options: nosniff
|
|
77
|
+
# X-Frame-Options: DENY
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## What This Demonstrates
|
|
81
|
+
|
|
82
|
+
- Full CSP enforcement with multiple directive types including value-less directives
|
|
83
|
+
- HSTS with preload and includeSubDomains for HTTPS enforcement
|
|
84
|
+
- X-Frame-Options DENY for clickjacking protection
|
|
85
|
+
- Custom headers for additional security controls
|
|
86
|
+
|
|
87
|
+
## Related
|
|
88
|
+
|
|
89
|
+
- See `configure-security-headers` for the full configuration reference
|
|
90
|
+
- See `csp-report-only` for testing CSP before enforcement
|
|
91
|
+
- See `distributed-ha` for the HA architecture reference
|
|
@@ -19,8 +19,7 @@ Configure Redis-backed rate limiting for multi-instance deployments behind a loa
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/server.ts
|
|
22
|
-
import {
|
|
23
|
-
import { z } from 'zod';
|
|
22
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
23
|
|
|
25
24
|
@Tool({
|
|
26
25
|
name: 'process_payment',
|
|
@@ -19,8 +19,7 @@ Override server defaults with per-tool rate limits and concurrency caps.
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/server.ts
|
|
22
|
-
import {
|
|
23
|
-
import { z } from 'zod';
|
|
22
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
23
|
|
|
25
24
|
@Tool({
|
|
26
25
|
name: 'expensive_query',
|
|
@@ -20,8 +20,7 @@ Configure global rate limits and IP filtering at the server level.
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
// src/server.ts
|
|
23
|
-
import {
|
|
24
|
-
import { z } from 'zod';
|
|
23
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
25
24
|
|
|
26
25
|
@Tool({
|
|
27
26
|
name: 'search',
|
|
@@ -20,8 +20,7 @@ Override individual protocol flags instead of using a preset for fine-grained co
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
// src/server.ts
|
|
23
|
-
import {
|
|
24
|
-
import { z } from 'zod';
|
|
23
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
25
24
|
|
|
26
25
|
@Tool({
|
|
27
26
|
name: 'stream_logs',
|
|
@@ -20,8 +20,7 @@ Configure transport with Redis persistence for multi-instance load-balanced depl
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
// src/server.ts
|
|
23
|
-
import {
|
|
24
|
-
import { z } from 'zod';
|
|
23
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
25
24
|
|
|
26
25
|
@Tool({
|
|
27
26
|
name: 'get_report',
|
|
@@ -19,8 +19,7 @@ Configure stateless transport for Vercel, Lambda, or Cloudflare deployments.
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/server.ts
|
|
22
|
-
import {
|
|
23
|
-
import { z } from 'zod';
|
|
22
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
23
|
|
|
25
24
|
@Tool({
|
|
26
25
|
name: 'convert_currency',
|
|
@@ -19,8 +19,7 @@ Use the default legacy preset for maximum compatibility with all MCP clients.
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/server.ts
|
|
22
|
-
import {
|
|
23
|
-
import { z } from 'zod';
|
|
22
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
23
|
|
|
25
24
|
@Tool({
|
|
26
25
|
name: 'hello',
|
|
@@ -19,8 +19,7 @@ Use the stateless-api preset for Vercel, Lambda, or Cloudflare Workers.
|
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
// src/server.ts
|
|
22
|
-
import {
|
|
23
|
-
import { z } from 'zod';
|
|
22
|
+
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';
|
|
24
23
|
|
|
25
24
|
@Tool({
|
|
26
25
|
name: 'translate',
|