@frontmcp/skills 0.0.1 → 1.0.0-beta.11
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/README.md +2 -2
- package/catalog/TEMPLATE.md +58 -13
- package/catalog/frontmcp-config/SKILL.md +156 -0
- package/catalog/{auth/configure-auth/references/auth-modes.md → frontmcp-config/references/configure-auth-modes.md} +5 -0
- package/catalog/frontmcp-config/references/configure-auth.md +243 -0
- package/catalog/frontmcp-config/references/configure-elicitation.md +183 -0
- package/catalog/frontmcp-config/references/configure-http.md +210 -0
- package/catalog/frontmcp-config/references/configure-session.md +210 -0
- package/catalog/{config/configure-throttle/references/guard-config.md → frontmcp-config/references/configure-throttle-guard-config.md} +5 -0
- package/catalog/frontmcp-config/references/configure-throttle.md +234 -0
- package/catalog/{config/configure-transport/references/protocol-presets.md → frontmcp-config/references/configure-transport-protocol-presets.md} +5 -0
- package/catalog/frontmcp-config/references/configure-transport.md +200 -0
- package/catalog/frontmcp-config/references/setup-redis.md +9 -0
- package/catalog/frontmcp-config/references/setup-sqlite.md +9 -0
- package/catalog/frontmcp-deployment/SKILL.md +152 -0
- package/catalog/frontmcp-deployment/references/build-for-browser.md +143 -0
- package/catalog/frontmcp-deployment/references/build-for-cli.md +191 -0
- package/catalog/{deployment/build-for-sdk/SKILL.md → frontmcp-deployment/references/build-for-sdk.md} +66 -20
- package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +218 -0
- package/catalog/{deployment/deploy-to-lambda/SKILL.md → frontmcp-deployment/references/deploy-to-lambda.md} +77 -59
- package/catalog/{deployment/deploy-to-node/references/Dockerfile.example → frontmcp-deployment/references/deploy-to-node-dockerfile.md} +18 -4
- package/catalog/{deployment/deploy-to-node/SKILL.md → frontmcp-deployment/references/deploy-to-node.md} +69 -36
- package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +65 -0
- package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +229 -0
- package/catalog/frontmcp-development/SKILL.md +126 -0
- package/catalog/frontmcp-development/references/create-adapter.md +170 -0
- package/catalog/{development/create-agent/references/llm-config.md → frontmcp-development/references/create-agent-llm-config.md} +10 -5
- package/catalog/{development/create-agent/SKILL.md → frontmcp-development/references/create-agent.md} +83 -40
- package/catalog/{development/create-job/SKILL.md → frontmcp-development/references/create-job.md} +62 -15
- package/catalog/{plugins/create-plugin-hooks/SKILL.md → frontmcp-development/references/create-plugin-hooks.md} +100 -7
- package/catalog/frontmcp-development/references/create-plugin.md +506 -0
- package/catalog/{development/create-prompt/SKILL.md → frontmcp-development/references/create-prompt.md} +65 -22
- package/catalog/{development/create-provider/SKILL.md → frontmcp-development/references/create-provider.md} +63 -23
- package/catalog/{development/create-resource/SKILL.md → frontmcp-development/references/create-resource.md} +148 -26
- package/catalog/{development/create-skill-with-tools/SKILL.md → frontmcp-development/references/create-skill-with-tools.md} +174 -20
- package/catalog/{development/create-skill/SKILL.md → frontmcp-development/references/create-skill.md} +114 -28
- package/catalog/{development/create-tool/references/tool-annotations.md → frontmcp-development/references/create-tool-annotations.md} +5 -0
- package/catalog/{development/create-tool/references/output-schema-types.md → frontmcp-development/references/create-tool-output-schema-types.md} +5 -0
- package/catalog/{development/create-tool/SKILL.md → frontmcp-development/references/create-tool.md} +172 -23
- package/catalog/{development/create-workflow/SKILL.md → frontmcp-development/references/create-workflow.md} +61 -14
- package/catalog/frontmcp-development/references/decorators-guide.md +754 -0
- package/catalog/frontmcp-development/references/official-adapters.md +199 -0
- package/catalog/{plugins/official-plugins/SKILL.md → frontmcp-development/references/official-plugins.md} +97 -27
- package/catalog/frontmcp-extensibility/SKILL.md +103 -0
- package/catalog/frontmcp-extensibility/references/vectoriadb.md +289 -0
- package/catalog/frontmcp-guides/SKILL.md +420 -0
- package/catalog/frontmcp-guides/references/example-knowledge-base.md +641 -0
- package/catalog/frontmcp-guides/references/example-task-manager.md +517 -0
- package/catalog/frontmcp-guides/references/example-weather-api.md +297 -0
- package/catalog/frontmcp-production-readiness/SKILL.md +98 -0
- package/catalog/frontmcp-production-readiness/references/common-checklist.md +156 -0
- package/catalog/frontmcp-production-readiness/references/production-browser.md +46 -0
- package/catalog/frontmcp-production-readiness/references/production-cli-binary.md +62 -0
- package/catalog/frontmcp-production-readiness/references/production-cli-daemon.md +61 -0
- package/catalog/frontmcp-production-readiness/references/production-cloudflare.md +52 -0
- package/catalog/frontmcp-production-readiness/references/production-lambda.md +53 -0
- package/catalog/frontmcp-production-readiness/references/production-node-sdk.md +66 -0
- package/catalog/frontmcp-production-readiness/references/production-node-server.md +61 -0
- package/catalog/frontmcp-production-readiness/references/production-vercel.md +52 -0
- package/catalog/frontmcp-setup/SKILL.md +132 -0
- package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +280 -0
- package/catalog/{setup/multi-app-composition/SKILL.md → frontmcp-setup/references/multi-app-composition.md} +66 -19
- package/catalog/{setup/nx-workflow/SKILL.md → frontmcp-setup/references/nx-workflow.md} +79 -17
- package/catalog/frontmcp-setup/references/project-structure-nx.md +251 -0
- package/catalog/frontmcp-setup/references/project-structure-standalone.md +217 -0
- package/catalog/frontmcp-setup/references/readme-guide.md +226 -0
- package/catalog/{setup/setup-project/SKILL.md → frontmcp-setup/references/setup-project.md} +63 -58
- package/catalog/{setup/setup-redis/SKILL.md → frontmcp-setup/references/setup-redis.md} +60 -82
- package/catalog/{setup/setup-sqlite/SKILL.md → frontmcp-setup/references/setup-sqlite.md} +65 -72
- package/catalog/frontmcp-testing/SKILL.md +135 -0
- package/catalog/{testing/setup-testing/SKILL.md → frontmcp-testing/references/setup-testing.md} +79 -63
- package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-auth.md +5 -0
- package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-browser-build.md +5 -0
- package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-cli-binary.md +5 -0
- package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-direct-client.md +5 -0
- package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-e2e-handler.md +5 -0
- package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-tool-unit.md +6 -0
- package/catalog/skills-manifest.json +337 -382
- package/package.json +2 -2
- package/src/index.d.ts +1 -1
- package/src/index.js.map +1 -1
- package/src/loader.js +0 -1
- package/src/loader.js.map +1 -1
- package/src/manifest.d.ts +15 -3
- package/src/manifest.js +3 -3
- package/src/manifest.js.map +1 -1
- package/catalog/adapters/create-adapter/SKILL.md +0 -127
- package/catalog/adapters/official-adapters/SKILL.md +0 -136
- package/catalog/auth/configure-auth/SKILL.md +0 -250
- package/catalog/auth/configure-session/SKILL.md +0 -201
- package/catalog/config/configure-elicitation/SKILL.md +0 -136
- package/catalog/config/configure-http/SKILL.md +0 -167
- package/catalog/config/configure-throttle/SKILL.md +0 -189
- package/catalog/config/configure-transport/SKILL.md +0 -151
- package/catalog/deployment/build-for-browser/SKILL.md +0 -95
- package/catalog/deployment/build-for-cli/SKILL.md +0 -100
- package/catalog/deployment/deploy-to-cloudflare/SKILL.md +0 -192
- package/catalog/deployment/deploy-to-vercel/SKILL.md +0 -196
- package/catalog/deployment/deploy-to-vercel/references/vercel.json.example +0 -60
- package/catalog/development/decorators-guide/SKILL.md +0 -598
- package/catalog/plugins/create-plugin/SKILL.md +0 -336
- package/catalog/setup/frontmcp-skills-usage/SKILL.md +0 -200
- package/catalog/setup/project-structure-nx/SKILL.md +0 -186
- package/catalog/setup/project-structure-standalone/SKILL.md +0 -153
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: official-adapters
|
|
3
|
+
description: Convert OpenAPI specs and external definitions into MCP tools automatically
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Official Adapters
|
|
7
|
+
|
|
8
|
+
Adapters convert external definitions (OpenAPI specs, Lambda functions, etc.) into MCP tools, resources, and prompts automatically.
|
|
9
|
+
|
|
10
|
+
## When to Use This Skill
|
|
11
|
+
|
|
12
|
+
### Must Use
|
|
13
|
+
|
|
14
|
+
- Converting an OpenAPI/Swagger specification into MCP tools automatically
|
|
15
|
+
- Integrating a REST API that provides a public OpenAPI spec (Petstore, GitHub, Jira, Slack)
|
|
16
|
+
- Setting up authentication (API key, bearer token, OAuth) for an adapter-generated API integration
|
|
17
|
+
|
|
18
|
+
### Recommended
|
|
19
|
+
|
|
20
|
+
- Registering multiple external APIs as namespaced tool sets in a single server
|
|
21
|
+
- Enabling spec polling to auto-refresh tool definitions when the upstream API changes
|
|
22
|
+
- Providing an inline OpenAPI spec for APIs without a hosted spec URL
|
|
23
|
+
|
|
24
|
+
### Skip When
|
|
25
|
+
|
|
26
|
+
- The external API has no OpenAPI spec and uses a custom protocol (see `create-adapter`)
|
|
27
|
+
- You need cross-cutting behavior like caching or logging (see `create-plugin` or `official-plugins`)
|
|
28
|
+
- You are building tools manually without an external spec (see `create-tool`)
|
|
29
|
+
|
|
30
|
+
> **Decision:** Use this skill when you have an OpenAPI/Swagger spec and want to automatically generate MCP tools from it using `OpenapiAdapter`.
|
|
31
|
+
|
|
32
|
+
## OpenAPI Adapter
|
|
33
|
+
|
|
34
|
+
The primary official adapter. Converts OpenAPI/Swagger specifications into MCP tools — one tool per operation.
|
|
35
|
+
|
|
36
|
+
### Installation
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { OpenapiAdapter } from '@frontmcp/adapters';
|
|
40
|
+
|
|
41
|
+
@App({
|
|
42
|
+
name: 'MyApp',
|
|
43
|
+
adapters: [
|
|
44
|
+
OpenapiAdapter.init({
|
|
45
|
+
name: 'petstore',
|
|
46
|
+
url: 'https://petstore3.swagger.io/api/v3/openapi.json',
|
|
47
|
+
}),
|
|
48
|
+
],
|
|
49
|
+
})
|
|
50
|
+
class MyApp {}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Each OpenAPI operation becomes an MCP tool named `petstore:operationId`.
|
|
54
|
+
|
|
55
|
+
### With Authentication
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
// API Key via static auth
|
|
59
|
+
OpenapiAdapter.init({
|
|
60
|
+
name: 'my-api',
|
|
61
|
+
url: 'https://api.example.com/openapi.json',
|
|
62
|
+
baseUrl: 'https://api.example.com',
|
|
63
|
+
staticAuth: {
|
|
64
|
+
apiKey: process.env.API_KEY!,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// API Key via additional headers
|
|
69
|
+
OpenapiAdapter.init({
|
|
70
|
+
name: 'my-api',
|
|
71
|
+
url: 'https://api.example.com/openapi.json',
|
|
72
|
+
baseUrl: 'https://api.example.com',
|
|
73
|
+
additionalHeaders: {
|
|
74
|
+
'X-API-Key': process.env.API_KEY!,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Bearer token via static auth
|
|
79
|
+
OpenapiAdapter.init({
|
|
80
|
+
name: 'my-api',
|
|
81
|
+
url: 'https://api.example.com/openapi.json',
|
|
82
|
+
baseUrl: 'https://api.example.com',
|
|
83
|
+
staticAuth: {
|
|
84
|
+
jwt: process.env.API_TOKEN!,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// Dynamic auth per tool using securityResolver
|
|
89
|
+
OpenapiAdapter.init({
|
|
90
|
+
name: 'my-api',
|
|
91
|
+
url: 'https://api.example.com/openapi.json',
|
|
92
|
+
baseUrl: 'https://api.example.com',
|
|
93
|
+
securityResolver: (tool, ctx) => {
|
|
94
|
+
return { jwt: ctx.authInfo?.token };
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Spec Polling
|
|
100
|
+
|
|
101
|
+
Automatically refresh the OpenAPI spec at intervals:
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
OpenapiAdapter.init({
|
|
105
|
+
name: 'evolving-api',
|
|
106
|
+
url: 'https://api.example.com/openapi.json',
|
|
107
|
+
polling: {
|
|
108
|
+
intervalMs: 300000, // Re-fetch every 5 minutes
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Inline Spec
|
|
114
|
+
|
|
115
|
+
Provide the OpenAPI spec directly instead of fetching from URL:
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
OpenapiAdapter.init({
|
|
119
|
+
name: 'my-api',
|
|
120
|
+
spec: {
|
|
121
|
+
openapi: '3.0.0',
|
|
122
|
+
info: { title: 'My API', version: '1.0.0' },
|
|
123
|
+
paths: { ... },
|
|
124
|
+
},
|
|
125
|
+
})
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Multiple Adapters
|
|
129
|
+
|
|
130
|
+
Register adapters from different APIs in the same app:
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
@App({
|
|
134
|
+
name: 'IntegrationHub',
|
|
135
|
+
adapters: [
|
|
136
|
+
OpenapiAdapter.init({ name: 'github', url: 'https://api.github.com/openapi.json' }),
|
|
137
|
+
OpenapiAdapter.init({ name: 'jira', url: 'https://jira.example.com/openapi.json' }),
|
|
138
|
+
OpenapiAdapter.init({ name: 'slack', url: 'https://slack.com/openapi.json' }),
|
|
139
|
+
],
|
|
140
|
+
})
|
|
141
|
+
class IntegrationHub {}
|
|
142
|
+
// Tools: github:createIssue, jira:createTicket, slack:postMessage, etc.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Adapter vs Plugin
|
|
146
|
+
|
|
147
|
+
| Aspect | Adapter | Plugin |
|
|
148
|
+
| ----------- | ------------------------------------ | ----------------------------------- |
|
|
149
|
+
| Purpose | Generate tools from external sources | Add cross-cutting behavior |
|
|
150
|
+
| Output | Tools, resources, prompts | Lifecycle hooks, context extensions |
|
|
151
|
+
| Examples | OpenAPI → MCP tools | Caching, auth, logging |
|
|
152
|
+
| When to use | Integrating APIs | Adding middleware |
|
|
153
|
+
|
|
154
|
+
## Common Patterns
|
|
155
|
+
|
|
156
|
+
| Pattern | Correct | Incorrect | Why |
|
|
157
|
+
| -------------------- | ---------------------------------------------------------------------------- | --------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
158
|
+
| Adapter registration | `OpenapiAdapter.init({ name: 'petstore', url: '...' })` in `adapters` array | Placing adapter in `plugins` array | Adapters go in `adapters`, not `plugins`; they serve different purposes |
|
|
159
|
+
| Tool naming | Tools auto-named as `petstore:operationId` using adapter `name` as namespace | Expecting flat names like `listPets` | Adapter name is prepended to prevent collisions across multiple adapters |
|
|
160
|
+
| Auth configuration | `staticAuth: { jwt: process.env.API_TOKEN! }` or `additionalHeaders` | Hardcoding secrets: `staticAuth: { jwt: 'sk-xxx' }` | Always use environment variables for secrets; never commit tokens |
|
|
161
|
+
| Spec source | Use `url` for hosted specs or `spec` for inline definitions | Using both `url` and `spec` simultaneously | Only one source should be provided; `spec` takes precedence and `url` is ignored |
|
|
162
|
+
| Multiple APIs | Register separate `OpenapiAdapter.init()` calls with unique `name` values | Using the same `name` for different adapters | Duplicate names cause tool naming collisions |
|
|
163
|
+
|
|
164
|
+
## Verification Checklist
|
|
165
|
+
|
|
166
|
+
### Configuration
|
|
167
|
+
|
|
168
|
+
- [ ] `@frontmcp/adapters` package is installed
|
|
169
|
+
- [ ] `OpenapiAdapter.init()` is in the `adapters` array of `@App`
|
|
170
|
+
- [ ] Adapter has a unique `name` for tool namespacing
|
|
171
|
+
- [ ] `url` points to a valid, reachable OpenAPI JSON/YAML endpoint (or `spec` is inline)
|
|
172
|
+
|
|
173
|
+
### Runtime
|
|
174
|
+
|
|
175
|
+
- [ ] Generated tools appear in `tools/list` with `<name>:<operationId>` naming
|
|
176
|
+
- [ ] Auth headers are sent correctly on API calls
|
|
177
|
+
- [ ] Spec polling refreshes tool definitions at the configured interval
|
|
178
|
+
- [ ] Invalid spec URL produces a clear startup error
|
|
179
|
+
|
|
180
|
+
### Production
|
|
181
|
+
|
|
182
|
+
- [ ] API tokens and secrets are loaded from environment variables
|
|
183
|
+
- [ ] Polling interval is appropriate for the API's update frequency
|
|
184
|
+
- [ ] Multiple adapter registrations use distinct names
|
|
185
|
+
|
|
186
|
+
## Troubleshooting
|
|
187
|
+
|
|
188
|
+
| Problem | Cause | Solution |
|
|
189
|
+
| ---------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
190
|
+
| No tools generated from spec | Spec URL returns non-OpenAPI content or is unreachable | Verify URL returns valid OpenAPI 3.x JSON; check network access |
|
|
191
|
+
| Authentication errors on API calls | Wrong auth config or missing credentials | Configure `staticAuth` for fixed credentials, `securityResolver`/`authProviderMapper` for dynamic auth, or `additionalHeaders` for header-based tokens; verify env vars are set |
|
|
192
|
+
| Duplicate tool name error | Two adapters registered with the same `name` | Give each adapter a unique `name` (e.g., `'github'`, `'jira'`) |
|
|
193
|
+
| Stale tools after API update | Spec polling not configured | Add `polling: { intervalMs: 300000 }` to refresh every 5 minutes |
|
|
194
|
+
| TypeScript error importing adapter | Wrong import path | Import from `@frontmcp/adapters`: `import { OpenapiAdapter } from '@frontmcp/adapters'` |
|
|
195
|
+
|
|
196
|
+
## Reference
|
|
197
|
+
|
|
198
|
+
- [Adapter Overview Documentation](https://docs.agentfront.dev/frontmcp/adapters/overview)
|
|
199
|
+
- Related skills: `create-adapter`, `create-plugin`, `create-tool`
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: official-plugins
|
|
3
|
-
description:
|
|
4
|
-
tags: [plugins, codecall, remember, approval, cache, feature-flags, dashboard]
|
|
5
|
-
priority: 9
|
|
6
|
-
visibility: both
|
|
7
|
-
license: Apache-2.0
|
|
8
|
-
metadata:
|
|
9
|
-
docs: https://docs.agentfront.dev/frontmcp/plugins/overview
|
|
3
|
+
description: Guide to the 6 official plugins for discovery, memory, auth, caching, flags, and monitoring
|
|
10
4
|
---
|
|
11
5
|
|
|
12
6
|
# Official FrontMCP Plugins
|
|
13
7
|
|
|
14
|
-
FrontMCP ships 6 official plugins that extend server behavior with cross-cutting concerns: semantic tool discovery, session memory, authorization workflows, result caching, feature gating, and visual monitoring. Install individually or via `@frontmcp/plugins` (meta-package re-exporting cache, codecall,
|
|
8
|
+
FrontMCP ships 6 official plugins that extend server behavior with cross-cutting concerns: semantic tool discovery, session memory, authorization workflows, result caching, feature gating, and visual monitoring. Install individually or via `@frontmcp/plugins` (meta-package re-exporting cache, codecall, and remember).
|
|
9
|
+
|
|
10
|
+
> **Note:** The Dashboard plugin (`@frontmcp/plugin-dashboard`) is currently in **beta** and may not work correctly in all environments. It is not recommended for production use at this time.
|
|
11
|
+
|
|
12
|
+
## When to Use This Skill
|
|
13
|
+
|
|
14
|
+
### Must Use
|
|
15
|
+
|
|
16
|
+
- Installing and configuring any official FrontMCP plugin (CodeCall, Remember, Approval, Cache, Feature Flags)
|
|
17
|
+
- Adding session memory, tool caching, or authorization workflows to an existing server
|
|
18
|
+
- Integrating feature flag services (LaunchDarkly, Split.io, Unleash) to gate tools at runtime
|
|
19
|
+
|
|
20
|
+
### Recommended
|
|
21
|
+
|
|
22
|
+
- Exploring the Dashboard plugin for visual monitoring (beta — not recommended for production)
|
|
23
|
+
- Configuring CodeCall for semantic tool discovery when the server has many tools
|
|
24
|
+
- Combining multiple official plugins in a production deployment
|
|
25
|
+
|
|
26
|
+
### Skip When
|
|
27
|
+
|
|
28
|
+
- You need to build a custom plugin with your own providers and context extensions (see `create-plugin`)
|
|
29
|
+
- You only need lifecycle hooks without installing an official plugin (see `create-plugin-hooks`)
|
|
30
|
+
- You need to generate tools from an OpenAPI spec (see `official-adapters`)
|
|
31
|
+
|
|
32
|
+
> **Decision:** Use this skill when you need to install, configure, or customize one or more of the 5 stable official FrontMCP plugins. The Dashboard plugin is in beta — see its section below for details.
|
|
15
33
|
|
|
16
34
|
All plugins follow the `DynamicPlugin` pattern and are registered via `@FrontMcp({ plugins: [...] })`.
|
|
17
35
|
|
|
@@ -22,9 +40,9 @@ import RememberPlugin from '@frontmcp/plugin-remember';
|
|
|
22
40
|
import { ApprovalPlugin } from '@frontmcp/plugin-approval';
|
|
23
41
|
import CachePlugin from '@frontmcp/plugin-cache';
|
|
24
42
|
import FeatureFlagPlugin from '@frontmcp/plugin-feature-flags';
|
|
25
|
-
import DashboardPlugin from '@frontmcp/plugin-dashboard';
|
|
43
|
+
// import DashboardPlugin from '@frontmcp/plugin-dashboard'; // Beta — not recommended for production
|
|
26
44
|
|
|
27
|
-
@App()
|
|
45
|
+
@App({ name: 'MyApp' })
|
|
28
46
|
class MyApp {}
|
|
29
47
|
|
|
30
48
|
@FrontMcp({
|
|
@@ -36,7 +54,7 @@ class MyApp {}
|
|
|
36
54
|
ApprovalPlugin.init({ mode: 'recheck' }),
|
|
37
55
|
CachePlugin.init({ type: 'memory', defaultTTL: 86400 }),
|
|
38
56
|
FeatureFlagPlugin.init({ adapter: 'static', flags: { 'new-tool': true } }),
|
|
39
|
-
DashboardPlugin.init({ enabled: true }),
|
|
57
|
+
// DashboardPlugin.init({ enabled: true }), // Beta — see Dashboard section below
|
|
40
58
|
],
|
|
41
59
|
tools: [
|
|
42
60
|
/* your tools */
|
|
@@ -79,10 +97,25 @@ class MyServer {}
|
|
|
79
97
|
|
|
80
98
|
### Modes
|
|
81
99
|
|
|
82
|
-
- `codecall_only` -- Hides all tools from `list_tools` except CodeCall meta-tools. All other tools are discovered only via `codecall:search`. Best when the server has a large number of tools and you want the AI to search-then-execute.
|
|
100
|
+
- `codecall_only` -- Hides all tools from `list_tools` except CodeCall meta-tools. All other tools are discovered only via `codecall:search`. Best when the server has a large number of tools and you want the AI to search-then-execute. When `appIds` is set, only tools from those apps are hidden — tools from other apps remain visible.
|
|
83
101
|
- `codecall_opt_in` -- Shows all tools in `list_tools` normally. Tools opt-in to CodeCall execution via metadata. Useful when only some tools benefit from orchestrated execution.
|
|
84
102
|
- `metadata_driven` -- Per-tool `metadata.codecall` controls visibility and CodeCall availability independently. Most granular control.
|
|
85
103
|
|
|
104
|
+
### Multi-App Scoping
|
|
105
|
+
|
|
106
|
+
Use `appIds` to scope CodeCall to specific apps in a multi-app server:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
// Only hide ecommerce tools — calc tools remain visible in list_tools
|
|
110
|
+
CodeCallPlugin.init({
|
|
111
|
+
mode: 'codecall_only',
|
|
112
|
+
appIds: ['ecommerce'],
|
|
113
|
+
vm: { preset: 'secure' },
|
|
114
|
+
});
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Without `appIds`, `codecall_only` mode hides ALL tools in the server. With `appIds`, only tools from the specified apps are hidden — tools from other apps remain directly callable.
|
|
118
|
+
|
|
86
119
|
### VM Presets
|
|
87
120
|
|
|
88
121
|
The sandboxed VM runs AgentScript (a restricted JavaScript subset). Presets control security boundaries:
|
|
@@ -96,9 +129,9 @@ The sandboxed VM runs AgentScript (a restricted JavaScript subset). Presets cont
|
|
|
96
129
|
|
|
97
130
|
CodeCall contributes 4 tools to your server:
|
|
98
131
|
|
|
99
|
-
- `codecall:search` -- Semantic search over all registered tools using TF-IDF scoring with synonym expansion. Returns ranked tool names, descriptions, and relevance scores.
|
|
100
|
-
- `codecall:describe` -- Returns full input/output JSON schemas for one or more tools. Use after search to understand tool interfaces before execution.
|
|
101
|
-
- `codecall:execute` -- Runs an AgentScript program in the sandboxed VM. The script can call multiple tools, branch on results, and compose outputs.
|
|
132
|
+
- `codecall:search` -- Semantic search over all registered tools using TF-IDF scoring with synonym expansion. Input: `{ queries: string[] }` (array of atomic action phrases, max 10). Decompose complex requests into simple actions (e.g., "delete users and send email" becomes `queries: ["delete user", "send email"]`). Returns ranked tool names, descriptions, and relevance scores.
|
|
133
|
+
- `codecall:describe` -- Returns full input/output JSON schemas for one or more tools. Input: `{ toolNames: string[] }` (tool names from search results). Use after search to understand tool interfaces before execution. If `notFound` array is non-empty in the response, re-search with corrected queries.
|
|
134
|
+
- `codecall:execute` -- Runs an AgentScript program in the sandboxed VM. Input: `{ script: string }` (AgentScript code). Use `callTool(name, args)` to invoke tools within scripts. The script can call multiple tools, branch on results, and compose outputs.
|
|
102
135
|
- `codecall:invoke` -- Direct single-tool invocation (available when `directCalls` is enabled). Bypasses the VM for simple one-shot calls.
|
|
103
136
|
|
|
104
137
|
### Per-Tool CodeCall Metadata
|
|
@@ -430,7 +463,7 @@ A tool is cached if it matches any pattern OR has `cache: true` (or a cache obje
|
|
|
430
463
|
|
|
431
464
|
Send the bypass header to skip caching for a specific request:
|
|
432
465
|
|
|
433
|
-
```
|
|
466
|
+
```text
|
|
434
467
|
x-frontmcp-disable-cache: true
|
|
435
468
|
```
|
|
436
469
|
|
|
@@ -569,7 +602,9 @@ The plugin hooks into listing and execution flows for tools, resources, prompts,
|
|
|
569
602
|
|
|
570
603
|
---
|
|
571
604
|
|
|
572
|
-
## 6. Dashboard Plugin (`@frontmcp/plugin-dashboard`)
|
|
605
|
+
## 6. Dashboard Plugin (`@frontmcp/plugin-dashboard`) — BETA
|
|
606
|
+
|
|
607
|
+
> **Warning:** The Dashboard plugin is currently in **beta** and may not work correctly. It is not recommended for production use. Expect breaking changes and missing features.
|
|
573
608
|
|
|
574
609
|
Visual monitoring web UI for your FrontMCP server. View server structure (tools, resources, prompts, apps, plugins) as an interactive graph.
|
|
575
610
|
|
|
@@ -645,7 +680,7 @@ All official plugins use the static `init()` pattern inherited from `DynamicPlug
|
|
|
645
680
|
ApprovalPlugin.init({ mode: 'recheck' }),
|
|
646
681
|
CachePlugin.init({ type: 'redis', config: { host: 'redis.internal' }, defaultTTL: 86400 }),
|
|
647
682
|
FeatureFlagPlugin.init({ adapter: 'launchdarkly', config: { sdkKey: 'sdk-xxx' } }),
|
|
648
|
-
DashboardPlugin.init({ enabled: true, auth: {
|
|
683
|
+
// DashboardPlugin.init({ enabled: true, auth: { ... } }), // Beta — not recommended for production
|
|
649
684
|
],
|
|
650
685
|
tools: [
|
|
651
686
|
/* ... */
|
|
@@ -654,14 +689,49 @@ All official plugins use the static `init()` pattern inherited from `DynamicPlug
|
|
|
654
689
|
class ProductionServer {}
|
|
655
690
|
```
|
|
656
691
|
|
|
692
|
+
## Common Patterns
|
|
693
|
+
|
|
694
|
+
| Pattern | Correct | Incorrect | Why |
|
|
695
|
+
| ------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
696
|
+
| Plugin registration | `plugins: [RememberPlugin.init({ type: 'memory' })]` | `plugins: [new RememberPlugin({ type: 'memory' })]` | Official plugins use `DynamicPlugin.init()` static method; direct instantiation bypasses provider wiring |
|
|
697
|
+
| Remember storage in prod | `RememberPlugin.init({ type: 'redis', config: { host: '...' } })` | `RememberPlugin.init({ type: 'memory' })` in production | Memory storage loses data on restart; use Redis or Vercel KV for persistence |
|
|
698
|
+
| Cache TTL units | `defaultTTL: 3600` (seconds) | `defaultTTL: 3600000` (milliseconds) | Cache TTL is in seconds, not milliseconds; 3600000 = 41 days |
|
|
699
|
+
| Feature flag gating | `@Tool({ featureFlag: 'my-flag' })` on the tool decorator | Checking `this.featureFlags.isEnabled()` inside `execute()` and returning early | Decorator-level gating hides the tool from `list_tools`; manual check still exposes it |
|
|
700
|
+
| Dashboard (beta) | Avoid in production — plugin is in beta and may not work correctly | `DashboardPlugin.init({})` in production | Dashboard plugin is unstable; use only for local development experimentation |
|
|
701
|
+
|
|
702
|
+
## Verification Checklist
|
|
703
|
+
|
|
704
|
+
### Installation
|
|
705
|
+
|
|
706
|
+
- [ ] Plugin package is installed (`@frontmcp/plugin-codecall`, `@frontmcp/plugin-remember`, etc.)
|
|
707
|
+
- [ ] Plugin is registered via `.init()` in the `plugins` array of `@FrontMcp`
|
|
708
|
+
- [ ] Required configuration options are provided (storage type, API keys, endpoints)
|
|
709
|
+
|
|
710
|
+
### Runtime
|
|
711
|
+
|
|
712
|
+
- [ ] `this.remember` / `this.approval` / `this.featureFlags` resolves in tool context
|
|
713
|
+
- [ ] Cache plugin returns cached results on repeated identical calls
|
|
714
|
+
- [ ] Feature-flagged tools are hidden from `list_tools` when flag is off
|
|
715
|
+
- [ ] Dashboard is accessible at configured `basePath` (default: `/dashboard`) — beta, may not work
|
|
716
|
+
- [ ] Approval plugin blocks unapproved tools and grants approval correctly
|
|
717
|
+
|
|
718
|
+
### Production
|
|
719
|
+
|
|
720
|
+
- [ ] Redis or external storage is configured for Remember and Cache plugins
|
|
721
|
+
- [ ] Dashboard authentication is enabled with a secret token (if using beta Dashboard plugin)
|
|
722
|
+
- [ ] Feature flag adapter connects to external service (not `'static'`)
|
|
723
|
+
|
|
724
|
+
## Troubleshooting
|
|
725
|
+
|
|
726
|
+
| Problem | Cause | Solution |
|
|
727
|
+
| --------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
728
|
+
| `this.remember` is undefined | RememberPlugin not registered or missing `.init()` | Add `RememberPlugin.init({ type: 'memory' })` to `plugins` array |
|
|
729
|
+
| Cache not working for a tool | Tool name does not match any `toolPatterns` glob and `cache` metadata is not set | Add `cache: true` to `@Tool` decorator or add matching pattern to `toolPatterns` |
|
|
730
|
+
| Feature flag always returns false | Using `'static'` adapter with flag not in the `flags` map | Add the flag key to `flags: { 'my-flag': true }` or check adapter connection |
|
|
731
|
+
| Dashboard returns 404 | Plugin is in beta and auto-disabled in production (`NODE_ENV=production`) | Dashboard is unstable — avoid in production. For dev: set `enabled: true` explicitly |
|
|
732
|
+
| Approval webhook times out | Callback URL not reachable from the external approval service | Verify `callbackPath` is publicly accessible and matches the webhook configuration |
|
|
733
|
+
|
|
657
734
|
## Reference
|
|
658
735
|
|
|
659
|
-
- Plugins
|
|
660
|
-
-
|
|
661
|
-
- CodeCall: `@frontmcp/plugin-codecall` — [source](https://github.com/agentfront/frontmcp/tree/main/plugins/plugin-codecall) | [docs](https://docs.agentfront.dev/frontmcp/plugins/codecall/overview)
|
|
662
|
-
- Remember: `@frontmcp/plugin-remember` — [source](https://github.com/agentfront/frontmcp/tree/main/plugins/plugin-remember) | [docs](https://docs.agentfront.dev/frontmcp/plugins/remember-plugin)
|
|
663
|
-
- Approval: `@frontmcp/plugin-approval` — [source](https://github.com/agentfront/frontmcp/tree/main/plugins/plugin-approval)
|
|
664
|
-
- Cache: `@frontmcp/plugin-cache` — [source](https://github.com/agentfront/frontmcp/tree/main/plugins/plugin-cache) | [docs](https://docs.agentfront.dev/frontmcp/plugins/cache-plugin)
|
|
665
|
-
- Feature Flags: `@frontmcp/plugin-feature-flags` — [source](https://github.com/agentfront/frontmcp/tree/main/plugins/plugin-feature-flags) | [docs](https://docs.agentfront.dev/frontmcp/plugins/feature-flags-plugin)
|
|
666
|
-
- Dashboard: `@frontmcp/plugin-dashboard` — [source](https://github.com/agentfront/frontmcp/tree/main/plugins/plugin-dashboard)
|
|
667
|
-
- Meta-package: `@frontmcp/plugins` (re-exports cache, codecall, dashboard, remember)
|
|
736
|
+
- [Plugins Overview Documentation](https://docs.agentfront.dev/frontmcp/plugins/overview)
|
|
737
|
+
- Related skills: `create-plugin`, `create-plugin-hooks`, `create-tool`
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontmcp-extensibility
|
|
3
|
+
description: 'Extend FrontMCP servers with external npm packages and libraries. Covers VectoriaDB for semantic search, and patterns for integrating third-party services into providers and tools. Use when adding search, ML, database, or external API capabilities beyond the core SDK.'
|
|
4
|
+
tags: [extensibility, vectoriadb, search, integration, npm, provider, external-services]
|
|
5
|
+
category: extensibility
|
|
6
|
+
targets: [all]
|
|
7
|
+
bundle: [full]
|
|
8
|
+
priority: 10
|
|
9
|
+
visibility: both
|
|
10
|
+
license: Apache-2.0
|
|
11
|
+
metadata:
|
|
12
|
+
docs: https://docs.agentfront.dev/frontmcp/extensibility/overview
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# FrontMCP Extensibility
|
|
16
|
+
|
|
17
|
+
Patterns and examples for extending FrontMCP servers with external npm packages. The core SDK handles MCP protocol, DI, and lifecycle — this skill shows how to integrate third-party libraries as providers and tools.
|
|
18
|
+
|
|
19
|
+
## When to Use This Skill
|
|
20
|
+
|
|
21
|
+
### Must Use
|
|
22
|
+
|
|
23
|
+
- Adding semantic search or similarity matching to your server (VectoriaDB)
|
|
24
|
+
- Integrating an external npm package as a FrontMCP provider
|
|
25
|
+
- Building tools that wrap third-party services (databases, APIs, ML models)
|
|
26
|
+
|
|
27
|
+
### Recommended
|
|
28
|
+
|
|
29
|
+
- Looking for patterns to structure external service integrations
|
|
30
|
+
- Deciding between provider-based vs direct integration for a library
|
|
31
|
+
- Adding capabilities like applescript automation, VM execution, or data processing
|
|
32
|
+
|
|
33
|
+
### Skip When
|
|
34
|
+
|
|
35
|
+
- You need to build core MCP components (see `frontmcp-development`)
|
|
36
|
+
- You need to configure auth, transport, or CORS (see `frontmcp-config`)
|
|
37
|
+
- You need to write a plugin with hooks and context extensions (see `create-plugin`)
|
|
38
|
+
|
|
39
|
+
> **Decision:** Use this skill when integrating external libraries into your FrontMCP server as providers or tools.
|
|
40
|
+
|
|
41
|
+
## Scenario Routing Table
|
|
42
|
+
|
|
43
|
+
| Scenario | Reference | Description |
|
|
44
|
+
| --------------------------------------------- | ----------------------------------------------- | -------------------------------------------------------- |
|
|
45
|
+
| Add in-memory semantic search with VectoriaDB | `references/vectoriadb.md` | TF-IDF indexing, field weighting, provider+tool pattern |
|
|
46
|
+
| Load an app from an npm package | `multi-app-composition` (in frontmcp-setup) | `App.esm('@scope/pkg@^1.0.0', 'AppName')` pattern |
|
|
47
|
+
| Connect to a remote MCP server | `multi-app-composition` (in frontmcp-setup) | `App.remote('https://...', 'ns')` pattern |
|
|
48
|
+
| Build a reusable plugin with hooks | `create-plugin-hooks` (in frontmcp-development) | `DynamicPlugin`, context extensions, lifecycle hooks |
|
|
49
|
+
| Build a custom adapter for an external source | `create-adapter` (in frontmcp-development) | `DynamicAdapter` for OpenAPI, GraphQL, or custom sources |
|
|
50
|
+
| Auto-generate tools from an OpenAPI spec | `official-adapters` (in frontmcp-development) | `OpenapiAdapter` with filtering, auth, and transforms |
|
|
51
|
+
|
|
52
|
+
## Integration Pattern
|
|
53
|
+
|
|
54
|
+
The standard pattern for integrating any external library:
|
|
55
|
+
|
|
56
|
+
1. **Create a provider** — wraps the library as a singleton or scoped service
|
|
57
|
+
2. **Register the provider** — add to `@App({ providers: [...] })` or `@FrontMcp({ providers: [...] })`
|
|
58
|
+
3. **Create tools** — expose the provider's capabilities as MCP tools via `this.get(TOKEN)`
|
|
59
|
+
4. **Optionally create resources** — expose data as MCP resources with autocompletion
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
// 1. Provider wraps the library
|
|
63
|
+
@Provider({ name: 'my-search', provide: SearchToken, scope: ProviderScope.GLOBAL })
|
|
64
|
+
export class SearchProvider {
|
|
65
|
+
private client: ExternalLibrary;
|
|
66
|
+
constructor() {
|
|
67
|
+
this.client = new ExternalLibrary({
|
|
68
|
+
/* config */
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
async search(query: string) {
|
|
72
|
+
return this.client.query(query);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 2. Tool exposes it
|
|
77
|
+
@Tool({ name: 'search', inputSchema: { query: z.string() } })
|
|
78
|
+
export default class SearchTool extends ToolContext {
|
|
79
|
+
async execute(input: { query: string }) {
|
|
80
|
+
return this.get(SearchToken).search(input.query);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Available Integrations
|
|
86
|
+
|
|
87
|
+
| Library | Purpose | Reference |
|
|
88
|
+
| -------------- | -------------------------------- | -------------------------- |
|
|
89
|
+
| **VectoriaDB** | In-memory TF-IDF semantic search | `references/vectoriadb.md` |
|
|
90
|
+
|
|
91
|
+
More integrations can be added as references (e.g., enclave-vm, applescript, database clients).
|
|
92
|
+
|
|
93
|
+
## Verification Checklist
|
|
94
|
+
|
|
95
|
+
- [ ] External library is in `dependencies` (not `devDependencies`)
|
|
96
|
+
- [ ] Provider wraps the library with proper initialization and cleanup
|
|
97
|
+
- [ ] Provider is registered in `@App` or `@FrontMcp` with a typed DI token
|
|
98
|
+
- [ ] Tools use `this.get(TOKEN)` to access the provider (not direct imports)
|
|
99
|
+
- [ ] Error handling wraps library-specific errors into MCP error classes
|
|
100
|
+
|
|
101
|
+
## Reference
|
|
102
|
+
|
|
103
|
+
- Related skills: `create-provider`, `create-tool`, `frontmcp-development`
|