@frontmcp/skills 0.0.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/LICENSE +201 -0
- package/README.md +135 -0
- package/catalog/TEMPLATE.md +49 -0
- package/catalog/adapters/create-adapter/SKILL.md +127 -0
- package/catalog/adapters/official-adapters/SKILL.md +136 -0
- package/catalog/auth/configure-auth/SKILL.md +250 -0
- package/catalog/auth/configure-auth/references/auth-modes.md +77 -0
- package/catalog/auth/configure-session/SKILL.md +201 -0
- package/catalog/config/configure-elicitation/SKILL.md +136 -0
- package/catalog/config/configure-http/SKILL.md +167 -0
- package/catalog/config/configure-throttle/SKILL.md +189 -0
- package/catalog/config/configure-throttle/references/guard-config.md +68 -0
- package/catalog/config/configure-transport/SKILL.md +151 -0
- package/catalog/config/configure-transport/references/protocol-presets.md +57 -0
- package/catalog/deployment/build-for-browser/SKILL.md +95 -0
- package/catalog/deployment/build-for-cli/SKILL.md +100 -0
- package/catalog/deployment/build-for-sdk/SKILL.md +218 -0
- package/catalog/deployment/deploy-to-cloudflare/SKILL.md +192 -0
- package/catalog/deployment/deploy-to-lambda/SKILL.md +304 -0
- package/catalog/deployment/deploy-to-node/SKILL.md +229 -0
- package/catalog/deployment/deploy-to-node/references/Dockerfile.example +45 -0
- package/catalog/deployment/deploy-to-vercel/SKILL.md +196 -0
- package/catalog/deployment/deploy-to-vercel/references/vercel.json.example +60 -0
- package/catalog/development/create-agent/SKILL.md +563 -0
- package/catalog/development/create-agent/references/llm-config.md +46 -0
- package/catalog/development/create-job/SKILL.md +566 -0
- package/catalog/development/create-prompt/SKILL.md +400 -0
- package/catalog/development/create-provider/SKILL.md +233 -0
- package/catalog/development/create-resource/SKILL.md +437 -0
- package/catalog/development/create-skill/SKILL.md +526 -0
- package/catalog/development/create-skill-with-tools/SKILL.md +579 -0
- package/catalog/development/create-tool/SKILL.md +418 -0
- package/catalog/development/create-tool/references/output-schema-types.md +56 -0
- package/catalog/development/create-tool/references/tool-annotations.md +34 -0
- package/catalog/development/create-workflow/SKILL.md +709 -0
- package/catalog/development/decorators-guide/SKILL.md +598 -0
- package/catalog/plugins/create-plugin/SKILL.md +336 -0
- package/catalog/plugins/create-plugin-hooks/SKILL.md +282 -0
- package/catalog/plugins/official-plugins/SKILL.md +667 -0
- package/catalog/setup/frontmcp-skills-usage/SKILL.md +200 -0
- package/catalog/setup/multi-app-composition/SKILL.md +358 -0
- package/catalog/setup/nx-workflow/SKILL.md +357 -0
- package/catalog/setup/project-structure-nx/SKILL.md +186 -0
- package/catalog/setup/project-structure-standalone/SKILL.md +153 -0
- package/catalog/setup/setup-project/SKILL.md +493 -0
- package/catalog/setup/setup-redis/SKILL.md +385 -0
- package/catalog/setup/setup-sqlite/SKILL.md +359 -0
- package/catalog/skills-manifest.json +414 -0
- package/catalog/testing/setup-testing/SKILL.md +539 -0
- package/catalog/testing/setup-testing/references/test-auth.md +88 -0
- package/catalog/testing/setup-testing/references/test-browser-build.md +57 -0
- package/catalog/testing/setup-testing/references/test-cli-binary.md +48 -0
- package/catalog/testing/setup-testing/references/test-direct-client.md +62 -0
- package/catalog/testing/setup-testing/references/test-e2e-handler.md +51 -0
- package/catalog/testing/setup-testing/references/test-tool-unit.md +41 -0
- package/package.json +34 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +16 -0
- package/src/index.js.map +1 -0
- package/src/loader.d.ts +46 -0
- package/src/loader.js +75 -0
- package/src/loader.js.map +1 -0
- package/src/manifest.d.ts +81 -0
- package/src/manifest.js +26 -0
- package/src/manifest.js.map +1 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontmcp-skills-usage
|
|
3
|
+
description: Search, install, and manage FrontMCP development skills for Claude Code and Codex. Use when setting up skills for AI-assisted development, choosing between static and dynamic skill delivery, or configuring skill providers.
|
|
4
|
+
tags: [skills, cli, install, claude, codex, search, catalog]
|
|
5
|
+
priority: 10
|
|
6
|
+
visibility: both
|
|
7
|
+
license: Apache-2.0
|
|
8
|
+
metadata:
|
|
9
|
+
docs: https://docs.agentfront.dev/frontmcp/servers/skills
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# FrontMCP Skills — Search, Install, and Usage
|
|
13
|
+
|
|
14
|
+
FrontMCP ships with a catalog of development skills that teach AI agents (Claude Code, Codex) how to build FrontMCP servers. You can deliver these skills **statically** (copy to disk) or **dynamically** (search on demand via CLI).
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Search for skills about tools
|
|
20
|
+
frontmcp skills search "create tool"
|
|
21
|
+
|
|
22
|
+
# List all skills
|
|
23
|
+
frontmcp skills list
|
|
24
|
+
|
|
25
|
+
# Show full skill content
|
|
26
|
+
frontmcp skills show create-tool
|
|
27
|
+
|
|
28
|
+
# Install a skill for Claude Code
|
|
29
|
+
frontmcp skills install create-tool --provider claude
|
|
30
|
+
|
|
31
|
+
# Install a skill for Codex
|
|
32
|
+
frontmcp skills install create-tool --provider codex
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## CLI Commands
|
|
36
|
+
|
|
37
|
+
### `frontmcp skills search <query>`
|
|
38
|
+
|
|
39
|
+
Semantic search through the catalog using weighted text matching (description 3x, tags 2x, name 1x):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
frontmcp skills search "authentication oauth"
|
|
43
|
+
frontmcp skills search "deploy vercel" --category deployment
|
|
44
|
+
frontmcp skills search "plugin hooks" --tag middleware --limit 5
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### `frontmcp skills list`
|
|
48
|
+
|
|
49
|
+
List all skills, optionally filtered:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
frontmcp skills list # All skills
|
|
53
|
+
frontmcp skills list --category development # Development skills only
|
|
54
|
+
frontmcp skills list --tag redis # Skills tagged with redis
|
|
55
|
+
frontmcp skills list --bundle recommended # Recommended bundle
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `frontmcp skills show <name>`
|
|
59
|
+
|
|
60
|
+
Print the full SKILL.md content to stdout — useful for piping to AI context:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
frontmcp skills show create-tool # Print full skill
|
|
64
|
+
frontmcp skills show configure-auth # Print auth skill
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### `frontmcp skills install <name>`
|
|
68
|
+
|
|
69
|
+
Copy a skill to a provider-specific directory:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Claude Code — installs to .claude/skills/<name>/SKILL.md
|
|
73
|
+
frontmcp skills install create-tool --provider claude
|
|
74
|
+
|
|
75
|
+
# Codex — installs to .codex/skills/<name>/SKILL.md
|
|
76
|
+
frontmcp skills install decorators-guide --provider codex
|
|
77
|
+
|
|
78
|
+
# Custom directory
|
|
79
|
+
frontmcp skills install setup-project --dir ./my-skills
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Two Approaches: Static vs Dynamic
|
|
83
|
+
|
|
84
|
+
### Static Installation (Copy to Disk)
|
|
85
|
+
|
|
86
|
+
Install skills once — they live in your project and are always available:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Install for Claude Code
|
|
90
|
+
frontmcp skills install create-tool --provider claude
|
|
91
|
+
frontmcp skills install create-resource --provider claude
|
|
92
|
+
frontmcp skills install configure-auth --provider claude
|
|
93
|
+
|
|
94
|
+
# Install for Codex
|
|
95
|
+
frontmcp skills install decorators-guide --provider codex
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Directory structure after install:**
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
my-project/
|
|
102
|
+
├── .claude/
|
|
103
|
+
│ └── skills/
|
|
104
|
+
│ ├── create-tool/
|
|
105
|
+
│ │ ├── SKILL.md
|
|
106
|
+
│ │ └── references/
|
|
107
|
+
│ ├── create-resource/
|
|
108
|
+
│ │ └── SKILL.md
|
|
109
|
+
│ └── configure-auth/
|
|
110
|
+
│ ├── SKILL.md
|
|
111
|
+
│ └── references/
|
|
112
|
+
├── .codex/
|
|
113
|
+
│ └── skills/
|
|
114
|
+
│ └── decorators-guide/
|
|
115
|
+
│ └── SKILL.md
|
|
116
|
+
└── src/
|
|
117
|
+
└── ...
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Dynamic Search (On-Demand via CLI)
|
|
121
|
+
|
|
122
|
+
Use the CLI to search and show skills on demand — no installation needed:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Search for what you need
|
|
126
|
+
frontmcp skills search "how to create a tool with zod"
|
|
127
|
+
|
|
128
|
+
# Pipe skill content directly into context
|
|
129
|
+
frontmcp skills show create-tool
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
This works because `frontmcp skills show` outputs the full SKILL.md content to stdout.
|
|
133
|
+
|
|
134
|
+
## Comparison: Static vs Dynamic
|
|
135
|
+
|
|
136
|
+
| Aspect | Static Install | Dynamic CLI Search |
|
|
137
|
+
| ----------------- | ------------------------------------- | -------------------------------------------- |
|
|
138
|
+
| **Setup** | `frontmcp skills install <name>` once | No setup — just use `frontmcp skills search` |
|
|
139
|
+
| **Availability** | Always loaded by AI agent | On-demand, requires CLI invocation |
|
|
140
|
+
| **Context usage** | Skills in system prompt (uses tokens) | Only loaded when searched (saves tokens) |
|
|
141
|
+
| **Updates** | Re-install to update | Always uses latest catalog |
|
|
142
|
+
| **Offline** | Works offline after install | Needs catalog available |
|
|
143
|
+
| **Best for** | Core skills you use daily | Occasional reference, exploration |
|
|
144
|
+
| **Token cost** | Higher (all installed skills loaded) | Lower (only searched skills loaded) |
|
|
145
|
+
|
|
146
|
+
### Recommended Approach
|
|
147
|
+
|
|
148
|
+
**Install 5-10 core skills statically** for your most common workflows, and use dynamic search for everything else:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Core skills — install statically
|
|
152
|
+
frontmcp skills install setup-project --provider claude
|
|
153
|
+
frontmcp skills install create-tool --provider claude
|
|
154
|
+
frontmcp skills install decorators-guide --provider claude
|
|
155
|
+
frontmcp skills install configure-auth --provider claude
|
|
156
|
+
frontmcp skills install project-structure-standalone --provider claude
|
|
157
|
+
|
|
158
|
+
# Everything else — search on demand
|
|
159
|
+
frontmcp skills search "deploy to vercel"
|
|
160
|
+
frontmcp skills search "rate limiting"
|
|
161
|
+
frontmcp skills show configure-throttle
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Provider Directories
|
|
165
|
+
|
|
166
|
+
| Provider | Install directory | Auto-loaded by |
|
|
167
|
+
| ----------- | -------------------------------- | ------------------------- |
|
|
168
|
+
| Claude Code | `.claude/skills/<name>/SKILL.md` | Claude Code system prompt |
|
|
169
|
+
| Codex | `.codex/skills/<name>/SKILL.md` | Codex agent context |
|
|
170
|
+
|
|
171
|
+
## Bundle Presets
|
|
172
|
+
|
|
173
|
+
When scaffolding a project, use `--skills` to install a preset bundle:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Recommended bundle (core skills for the deployment target)
|
|
177
|
+
frontmcp create my-app --skills recommended
|
|
178
|
+
|
|
179
|
+
# Minimal bundle (just project setup + create-tool)
|
|
180
|
+
frontmcp create my-app --skills minimal
|
|
181
|
+
|
|
182
|
+
# Full bundle (all skills)
|
|
183
|
+
frontmcp create my-app --skills full
|
|
184
|
+
|
|
185
|
+
# No skills
|
|
186
|
+
frontmcp create my-app --skills none
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Available Categories
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
frontmcp skills list --category setup # Project setup and configuration
|
|
193
|
+
frontmcp skills list --category config # Server configuration (transport, HTTP, throttle, elicitation)
|
|
194
|
+
frontmcp skills list --category development # Creating tools, resources, prompts, agents, skills, providers
|
|
195
|
+
frontmcp skills list --category deployment # Build and deploy (node, vercel, lambda, cli, browser, sdk)
|
|
196
|
+
frontmcp skills list --category auth # Authentication and session management
|
|
197
|
+
frontmcp skills list --category plugins # Official and custom plugins
|
|
198
|
+
frontmcp skills list --category adapters # OpenAPI and custom adapters
|
|
199
|
+
frontmcp skills list --category testing # Testing with Jest and @frontmcp/testing
|
|
200
|
+
```
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: multi-app-composition
|
|
3
|
+
description: Compose multiple apps in a single server with shared tools, scoped auth, and external app loading. Use when building multi-app servers, sharing tools between apps, loading ESM or remote apps, or configuring per-app auth.
|
|
4
|
+
tags: [multi-app, composition, architecture, scope, shared-tools]
|
|
5
|
+
priority: 9
|
|
6
|
+
visibility: both
|
|
7
|
+
license: Apache-2.0
|
|
8
|
+
metadata:
|
|
9
|
+
docs: https://docs.agentfront.dev/frontmcp/features/multi-app-composition
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Multi-App Composition
|
|
13
|
+
|
|
14
|
+
Compose multiple `@App` classes into a single `@FrontMcp` server. Each app contributes its own tools, resources, prompts, skills, and plugins. Apps can be local classes, npm packages loaded at runtime, or remote MCP servers proxied through your gateway.
|
|
15
|
+
|
|
16
|
+
## When to Use Multi-App
|
|
17
|
+
|
|
18
|
+
**Single app** is sufficient when your server has one logical domain (e.g., a calculator, a file manager). Define one `@App` class with all tools and resources:
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
@App({ name: 'Calculator', tools: [AddTool, SubtractTool] })
|
|
22
|
+
class CalcApp {}
|
|
23
|
+
|
|
24
|
+
@FrontMcp({
|
|
25
|
+
info: { name: 'my-server', version: '1.0.0' },
|
|
26
|
+
apps: [CalcApp],
|
|
27
|
+
})
|
|
28
|
+
export default class Server {}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Multi-app** is needed when you have multiple domains, separate auth requirements, external MCP servers to aggregate, or npm packages to compose at runtime. The `apps` array in `@FrontMcp` accepts any combination of local classes, ESM packages, and remote servers.
|
|
32
|
+
|
|
33
|
+
## Local Apps
|
|
34
|
+
|
|
35
|
+
A local app is a TypeScript class decorated with `@App`. It declares tools, resources, prompts, skills, plugins, providers, agents, jobs, and workflows inline.
|
|
36
|
+
|
|
37
|
+
The `@App` decorator accepts `LocalAppMetadata`:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { App } from '@frontmcp/sdk';
|
|
41
|
+
|
|
42
|
+
@App({
|
|
43
|
+
id: 'billing', // string (optional) - unique identifier
|
|
44
|
+
name: 'Billing', // string (required) - display name
|
|
45
|
+
description: 'Payment tools', // string (optional)
|
|
46
|
+
tools: [ChargeCardTool, RefundTool],
|
|
47
|
+
resources: [InvoiceResource],
|
|
48
|
+
prompts: [BillingSummaryPrompt],
|
|
49
|
+
skills: [BillingWorkflowSkill],
|
|
50
|
+
plugins: [AuditLogPlugin], // scoped to this app only
|
|
51
|
+
providers: [StripeProvider],
|
|
52
|
+
agents: [BillingAgent],
|
|
53
|
+
jobs: [ReconcileJob],
|
|
54
|
+
workflows: [MonthlyBillingWorkflow],
|
|
55
|
+
auth: { mode: 'remote', idpProviderUrl: 'https://auth.billing.com' },
|
|
56
|
+
standalone: false, // default - included in multi-app server
|
|
57
|
+
})
|
|
58
|
+
export class BillingApp {}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Register it in the server:
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
@FrontMcp({
|
|
65
|
+
info: { name: 'gateway', version: '1.0.0' },
|
|
66
|
+
apps: [BillingApp, InventoryApp, SupportApp],
|
|
67
|
+
})
|
|
68
|
+
export default class Server {}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## ESM Apps (npm Packages)
|
|
72
|
+
|
|
73
|
+
Load an `@App`-decorated class from an npm package at runtime using `app.esm()`. The package is fetched, cached, and its default export is treated as a local app.
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { FrontMcp, app } from '@frontmcp/sdk';
|
|
77
|
+
|
|
78
|
+
@FrontMcp({
|
|
79
|
+
info: { name: 'gateway', version: '1.0.0' },
|
|
80
|
+
apps: [app.esm('@acme/tools@^1.0.0', { namespace: 'acme' }), app.esm('@org/analytics@latest')],
|
|
81
|
+
})
|
|
82
|
+
export default class Server {}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`app.esm(specifier, options?)` accepts a package specifier (e.g., `'@acme/tools@^1.0.0'`) and optional `EsmAppOptions`:
|
|
86
|
+
|
|
87
|
+
| Option | Type | Description |
|
|
88
|
+
| ------------- | ------------------------------------------- | -------------------------------------------------- |
|
|
89
|
+
| `name` | `string` | Override the auto-derived app name |
|
|
90
|
+
| `namespace` | `string` | Namespace prefix for tools, resources, and prompts |
|
|
91
|
+
| `description` | `string` | Human-readable description |
|
|
92
|
+
| `standalone` | `boolean \| 'includeInParent'` | Scope isolation mode (default: `false`) |
|
|
93
|
+
| `loader` | `PackageLoader` | Custom registry/bundle URLs and auth token |
|
|
94
|
+
| `autoUpdate` | `{ enabled: boolean; intervalMs?: number }` | Background version polling |
|
|
95
|
+
| `importMap` | `Record<string, string>` | Import map overrides for ESM resolution |
|
|
96
|
+
| `filter` | `AppFilterConfig` | Include/exclude filter for primitives |
|
|
97
|
+
|
|
98
|
+
Example with custom loader and auto-update:
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
app.esm('@internal/tools@^2.0.0', {
|
|
102
|
+
namespace: 'internal',
|
|
103
|
+
loader: {
|
|
104
|
+
url: 'https://npm.internal.corp',
|
|
105
|
+
token: process.env['NPM_TOKEN'],
|
|
106
|
+
},
|
|
107
|
+
autoUpdate: { enabled: true, intervalMs: 300_000 },
|
|
108
|
+
});
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Remote Apps (External MCP Servers)
|
|
112
|
+
|
|
113
|
+
Proxy tools, resources, and prompts from an external MCP server using `app.remote()`. The gateway connects via Streamable HTTP (with SSE fallback) and exposes the remote primitives as if they were local.
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
import { FrontMcp, app } from '@frontmcp/sdk';
|
|
117
|
+
|
|
118
|
+
@FrontMcp({
|
|
119
|
+
info: { name: 'gateway', version: '1.0.0' },
|
|
120
|
+
apps: [
|
|
121
|
+
app.remote('https://api.example.com/mcp', { namespace: 'api' }),
|
|
122
|
+
app.remote('https://slack-mcp.internal/mcp', {
|
|
123
|
+
namespace: 'slack',
|
|
124
|
+
remoteAuth: {
|
|
125
|
+
mode: 'static',
|
|
126
|
+
credentials: { type: 'bearer', value: process.env['SLACK_TOKEN']! },
|
|
127
|
+
},
|
|
128
|
+
}),
|
|
129
|
+
],
|
|
130
|
+
})
|
|
131
|
+
export default class Server {}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`app.remote(url, options?)` accepts a URL and optional `RemoteUrlAppOptions`:
|
|
135
|
+
|
|
136
|
+
| Option | Type | Description |
|
|
137
|
+
| ------------------ | ------------------------------ | --------------------------------------------------------- |
|
|
138
|
+
| `name` | `string` | Override the auto-derived app name (defaults to hostname) |
|
|
139
|
+
| `namespace` | `string` | Namespace prefix for tools, resources, and prompts |
|
|
140
|
+
| `description` | `string` | Human-readable description |
|
|
141
|
+
| `standalone` | `boolean \| 'includeInParent'` | Scope isolation mode (default: `false`) |
|
|
142
|
+
| `transportOptions` | `RemoteTransportOptions` | Timeout, retries, headers, SSE fallback |
|
|
143
|
+
| `remoteAuth` | `RemoteAuthConfig` | Auth config: `'static'`, `'forward'`, or `'oauth'` |
|
|
144
|
+
| `refreshInterval` | `number` | Interval (ms) to refresh capabilities from remote |
|
|
145
|
+
| `cacheTTL` | `number` | TTL (ms) for cached capabilities (default: 60000) |
|
|
146
|
+
| `filter` | `AppFilterConfig` | Include/exclude filter for primitives |
|
|
147
|
+
|
|
148
|
+
`RemoteTransportOptions` fields:
|
|
149
|
+
|
|
150
|
+
| Field | Type | Default | Description |
|
|
151
|
+
| --------------- | ------------------------ | ------- | ---------------------------------------- |
|
|
152
|
+
| `timeout` | `number` | `30000` | Request timeout in ms |
|
|
153
|
+
| `retryAttempts` | `number` | `3` | Retry attempts for failed requests |
|
|
154
|
+
| `retryDelayMs` | `number` | `1000` | Delay between retries in ms |
|
|
155
|
+
| `fallbackToSSE` | `boolean` | `true` | Fallback to SSE if Streamable HTTP fails |
|
|
156
|
+
| `headers` | `Record<string, string>` | - | Additional headers for all requests |
|
|
157
|
+
|
|
158
|
+
`RemoteAuthConfig` modes:
|
|
159
|
+
|
|
160
|
+
- `{ mode: 'static', credentials: { type: 'bearer' | 'basic' | 'apiKey', value: string } }` -- static credentials for trusted internal services
|
|
161
|
+
- `{ mode: 'forward', tokenClaim?: string, headerName?: string }` -- forward the gateway user's token to the remote server
|
|
162
|
+
- `{ mode: 'oauth' }` -- let the remote server handle its own OAuth flow
|
|
163
|
+
|
|
164
|
+
## Scope Isolation
|
|
165
|
+
|
|
166
|
+
Each `@App` gets its own Scope. The `standalone` property on `LocalAppMetadata` (and on ESM/remote options) controls how that scope relates to the parent server:
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
// standalone: false (default)
|
|
170
|
+
// App is included in the multi-app server. Its tools are merged
|
|
171
|
+
// into the unified tool list and namespaced by app id.
|
|
172
|
+
@App({ name: 'Billing', standalone: false, tools: [ChargeTool] })
|
|
173
|
+
class BillingApp {}
|
|
174
|
+
|
|
175
|
+
// standalone: true
|
|
176
|
+
// App runs as a completely separate scope. It is NOT visible
|
|
177
|
+
// in the parent server's tool/resource lists. Useful for apps
|
|
178
|
+
// that need total isolation (separate auth, separate session).
|
|
179
|
+
@App({ name: 'Admin', standalone: true, tools: [ResetTool] })
|
|
180
|
+
class AdminApp {}
|
|
181
|
+
|
|
182
|
+
// standalone: 'includeInParent'
|
|
183
|
+
// App gets its own separate scope but its tools ARE visible
|
|
184
|
+
// in the parent server under the app name prefix. Best of both worlds:
|
|
185
|
+
// isolation with visibility.
|
|
186
|
+
@App({ name: 'Analytics', standalone: 'includeInParent', tools: [QueryTool] })
|
|
187
|
+
class AnalyticsApp {}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The type is: `standalone?: 'includeInParent' | boolean` (defaults to `false`).
|
|
191
|
+
|
|
192
|
+
## Tool Namespacing
|
|
193
|
+
|
|
194
|
+
When multiple apps are composed, tools are automatically namespaced by app id to prevent naming collisions. The format is `appId:toolName`.
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
@App({ id: 'billing', name: 'Billing', tools: [ChargeTool] })
|
|
198
|
+
class BillingApp {}
|
|
199
|
+
// Tool is exposed as: billing:charge_card
|
|
200
|
+
|
|
201
|
+
@App({ id: 'inventory', name: 'Inventory', tools: [CheckStockTool] })
|
|
202
|
+
class InventoryApp {}
|
|
203
|
+
// Tool is exposed as: inventory:check_stock
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
For remote and ESM apps, the `namespace` option controls the prefix:
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
app.remote('https://api.example.com/mcp', { namespace: 'api' });
|
|
210
|
+
// Remote tools are exposed as: api:tool_name
|
|
211
|
+
|
|
212
|
+
app.esm('@acme/tools@^1.0.0', { namespace: 'acme' });
|
|
213
|
+
// ESM tools are exposed as: acme:tool_name
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Shared Tools
|
|
217
|
+
|
|
218
|
+
Tools declared directly on `@FrontMcp` (not inside an `@App`) are shared across all apps. They are merged additively with app-specific tools and are available without a namespace prefix.
|
|
219
|
+
|
|
220
|
+
```typescript
|
|
221
|
+
@FrontMcp({
|
|
222
|
+
info: { name: 'gateway', version: '1.0.0' },
|
|
223
|
+
apps: [BillingApp, InventoryApp],
|
|
224
|
+
tools: [HealthCheckTool, WhoAmITool], // shared tools - available to all apps
|
|
225
|
+
})
|
|
226
|
+
export default class Server {}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
The same pattern works for shared resources and shared skills:
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
@FrontMcp({
|
|
233
|
+
info: { name: 'gateway', version: '1.0.0' },
|
|
234
|
+
apps: [BillingApp],
|
|
235
|
+
tools: [HealthCheckTool], // shared tools
|
|
236
|
+
resources: [ConfigResource], // shared resources
|
|
237
|
+
skills: [OnboardingSkill], // shared skills
|
|
238
|
+
})
|
|
239
|
+
export default class Server {}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Shared Plugins
|
|
243
|
+
|
|
244
|
+
Plugins declared on `@FrontMcp` are server-level plugins instantiated per scope. Every app in the server sees these plugins. Use them for cross-cutting concerns like logging, tracing, PII reduction, and policy enforcement.
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
@FrontMcp({
|
|
248
|
+
info: { name: 'gateway', version: '1.0.0' },
|
|
249
|
+
apps: [BillingApp, InventoryApp],
|
|
250
|
+
plugins: [TracingPlugin, PiiRedactionPlugin], // all apps see these
|
|
251
|
+
})
|
|
252
|
+
export default class Server {}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Per-App Auth
|
|
256
|
+
|
|
257
|
+
Each `@App` can have its own `auth` configuration, overriding the server-level auth. This allows mixed authentication modes within a single server -- for example, one app public and another requiring OAuth.
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
// Public app - no auth required
|
|
261
|
+
@App({
|
|
262
|
+
name: 'Public',
|
|
263
|
+
tools: [EchoTool, HealthTool],
|
|
264
|
+
auth: { mode: 'public' },
|
|
265
|
+
})
|
|
266
|
+
class PublicApp {}
|
|
267
|
+
|
|
268
|
+
// Protected app - requires OAuth
|
|
269
|
+
@App({
|
|
270
|
+
name: 'Admin',
|
|
271
|
+
tools: [UserManagementTool, AuditLogTool],
|
|
272
|
+
auth: {
|
|
273
|
+
mode: 'remote',
|
|
274
|
+
idpProviderUrl: 'https://auth.example.com',
|
|
275
|
+
idpExpectedAudience: 'admin-api',
|
|
276
|
+
},
|
|
277
|
+
})
|
|
278
|
+
class AdminApp {}
|
|
279
|
+
|
|
280
|
+
@FrontMcp({
|
|
281
|
+
info: { name: 'gateway', version: '1.0.0' },
|
|
282
|
+
apps: [PublicApp, AdminApp],
|
|
283
|
+
// Server-level auth acts as the default for apps without their own auth
|
|
284
|
+
auth: { mode: 'public' },
|
|
285
|
+
})
|
|
286
|
+
export default class Server {}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
If an app does not specify `auth`, it inherits the server-level configuration. The `auth` field accepts `AuthOptionsInput`.
|
|
290
|
+
|
|
291
|
+
## Per-App Plugins
|
|
292
|
+
|
|
293
|
+
Plugins declared on `@App` are scoped to that app only. They do not affect other apps in the server. Use per-app plugins for app-specific middleware, caching, or domain logic.
|
|
294
|
+
|
|
295
|
+
```typescript
|
|
296
|
+
@App({
|
|
297
|
+
name: 'Billing',
|
|
298
|
+
tools: [ChargeTool],
|
|
299
|
+
plugins: [BillingAuditPlugin, RateLimitPlugin], // only Billing sees these
|
|
300
|
+
})
|
|
301
|
+
class BillingApp {}
|
|
302
|
+
|
|
303
|
+
@App({
|
|
304
|
+
name: 'Inventory',
|
|
305
|
+
tools: [CheckStockTool],
|
|
306
|
+
plugins: [InventoryCachePlugin], // only Inventory sees this
|
|
307
|
+
})
|
|
308
|
+
class InventoryApp {}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## Full Composition Example
|
|
312
|
+
|
|
313
|
+
Combining all patterns into a single server:
|
|
314
|
+
|
|
315
|
+
```typescript
|
|
316
|
+
import 'reflect-metadata';
|
|
317
|
+
import { FrontMcp, App, app } from '@frontmcp/sdk';
|
|
318
|
+
|
|
319
|
+
// Local app with per-app auth and plugins
|
|
320
|
+
@App({
|
|
321
|
+
name: 'Billing',
|
|
322
|
+
tools: [ChargeTool, RefundTool],
|
|
323
|
+
plugins: [BillingAuditPlugin],
|
|
324
|
+
auth: { mode: 'remote', idpProviderUrl: 'https://auth.billing.com' },
|
|
325
|
+
})
|
|
326
|
+
class BillingApp {}
|
|
327
|
+
|
|
328
|
+
// Local public app
|
|
329
|
+
@App({
|
|
330
|
+
name: 'Public',
|
|
331
|
+
tools: [EchoTool],
|
|
332
|
+
auth: { mode: 'public' },
|
|
333
|
+
})
|
|
334
|
+
class PublicApp {}
|
|
335
|
+
|
|
336
|
+
// Standalone app with its own isolated scope
|
|
337
|
+
@App({
|
|
338
|
+
name: 'Admin',
|
|
339
|
+
tools: [ResetTool],
|
|
340
|
+
standalone: true,
|
|
341
|
+
})
|
|
342
|
+
class AdminApp {}
|
|
343
|
+
|
|
344
|
+
@FrontMcp({
|
|
345
|
+
info: { name: 'gateway', version: '1.0.0' },
|
|
346
|
+
apps: [
|
|
347
|
+
BillingApp,
|
|
348
|
+
PublicApp,
|
|
349
|
+
AdminApp,
|
|
350
|
+
app.esm('@acme/crm@^2.0.0', { namespace: 'crm' }),
|
|
351
|
+
app.remote('https://slack-mcp.example.com/mcp', { namespace: 'slack' }),
|
|
352
|
+
],
|
|
353
|
+
tools: [HealthCheckTool], // shared across all apps
|
|
354
|
+
plugins: [TracingPlugin, PiiPlugin], // shared across all apps
|
|
355
|
+
providers: [DatabaseProvider], // shared across all apps
|
|
356
|
+
})
|
|
357
|
+
export default class Server {}
|
|
358
|
+
```
|