@frontmcp/skills 0.0.1 → 1.0.0-beta.9
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/TEMPLATE.md +58 -13
- package/catalog/frontmcp-config/SKILL.md +140 -0
- package/catalog/frontmcp-config/references/configure-auth.md +238 -0
- package/catalog/frontmcp-config/references/configure-elicitation.md +178 -0
- package/catalog/frontmcp-config/references/configure-http.md +205 -0
- package/catalog/frontmcp-config/references/configure-session.md +205 -0
- package/catalog/frontmcp-config/references/configure-throttle.md +229 -0
- package/catalog/frontmcp-config/references/configure-transport.md +195 -0
- package/catalog/frontmcp-config/references/setup-redis.md +4 -0
- package/catalog/frontmcp-config/references/setup-sqlite.md +4 -0
- package/catalog/frontmcp-deployment/SKILL.md +124 -0
- package/catalog/frontmcp-deployment/references/build-for-browser.md +138 -0
- package/catalog/frontmcp-deployment/references/build-for-cli.md +138 -0
- package/catalog/{deployment/build-for-sdk/SKILL.md → frontmcp-deployment/references/build-for-sdk.md} +65 -24
- package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +213 -0
- package/catalog/{deployment/deploy-to-lambda/SKILL.md → frontmcp-deployment/references/deploy-to-lambda.md} +73 -60
- package/catalog/{deployment/deploy-to-node/references/Dockerfile.example → frontmcp-deployment/references/deploy-to-node-dockerfile.md} +11 -2
- package/catalog/{deployment/deploy-to-node/SKILL.md → frontmcp-deployment/references/deploy-to-node.md} +65 -37
- package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +60 -0
- package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +224 -0
- package/catalog/frontmcp-development/SKILL.md +118 -0
- package/catalog/frontmcp-development/references/create-adapter.md +165 -0
- package/catalog/{development/create-agent/references/llm-config.md → frontmcp-development/references/create-agent-llm-config.md} +5 -5
- package/catalog/{development/create-agent/SKILL.md → frontmcp-development/references/create-agent.md} +82 -44
- package/catalog/{development/create-job/SKILL.md → frontmcp-development/references/create-job.md} +61 -19
- package/catalog/{plugins/create-plugin-hooks/SKILL.md → frontmcp-development/references/create-plugin-hooks.md} +63 -11
- package/catalog/{plugins/create-plugin/SKILL.md → frontmcp-development/references/create-plugin.md} +65 -60
- package/catalog/{development/create-prompt/SKILL.md → frontmcp-development/references/create-prompt.md} +62 -26
- package/catalog/{development/create-provider/SKILL.md → frontmcp-development/references/create-provider.md} +62 -27
- package/catalog/{development/create-resource/SKILL.md → frontmcp-development/references/create-resource.md} +62 -30
- package/catalog/{development/create-skill-with-tools/SKILL.md → frontmcp-development/references/create-skill-with-tools.md} +69 -24
- package/catalog/{development/create-skill/SKILL.md → frontmcp-development/references/create-skill.md} +71 -20
- package/catalog/{development/create-tool/SKILL.md → frontmcp-development/references/create-tool.md} +62 -26
- package/catalog/{development/create-workflow/SKILL.md → frontmcp-development/references/create-workflow.md} +60 -18
- package/catalog/{development/decorators-guide/SKILL.md → frontmcp-development/references/decorators-guide.md} +123 -34
- package/catalog/frontmcp-development/references/official-adapters.md +194 -0
- package/catalog/{plugins/official-plugins/SKILL.md → frontmcp-development/references/official-plugins.md} +68 -22
- package/catalog/frontmcp-guides/SKILL.md +417 -0
- package/catalog/frontmcp-guides/references/example-knowledge-base.md +636 -0
- package/catalog/frontmcp-guides/references/example-task-manager.md +512 -0
- package/catalog/frontmcp-guides/references/example-weather-api.md +292 -0
- package/catalog/frontmcp-setup/SKILL.md +127 -0
- package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +265 -0
- package/catalog/{setup/multi-app-composition/SKILL.md → frontmcp-setup/references/multi-app-composition.md} +65 -23
- package/catalog/{setup/nx-workflow/SKILL.md → frontmcp-setup/references/nx-workflow.md} +78 -21
- package/catalog/frontmcp-setup/references/project-structure-nx.md +246 -0
- package/catalog/frontmcp-setup/references/project-structure-standalone.md +212 -0
- package/catalog/{setup/setup-project/SKILL.md → frontmcp-setup/references/setup-project.md} +62 -62
- package/catalog/{setup/setup-redis/SKILL.md → frontmcp-setup/references/setup-redis.md} +59 -86
- package/catalog/{setup/setup-sqlite/SKILL.md → frontmcp-setup/references/setup-sqlite.md} +64 -76
- package/catalog/frontmcp-testing/SKILL.md +121 -0
- package/catalog/{testing/setup-testing/SKILL.md → frontmcp-testing/references/setup-testing.md} +78 -67
- package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-tool-unit.md +1 -0
- package/catalog/skills-manifest.json +34 -383
- package/package.json +1 -1
- package/src/manifest.d.ts +3 -3
- package/src/manifest.js +1 -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/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
- /package/catalog/{auth/configure-auth/references/auth-modes.md → frontmcp-config/references/configure-auth-modes.md} +0 -0
- /package/catalog/{config/configure-throttle/references/guard-config.md → frontmcp-config/references/configure-throttle-guard-config.md} +0 -0
- /package/catalog/{config/configure-transport/references/protocol-presets.md → frontmcp-config/references/configure-transport-protocol-presets.md} +0 -0
- /package/catalog/{development/create-tool/references/tool-annotations.md → frontmcp-development/references/create-tool-annotations.md} +0 -0
- /package/catalog/{development/create-tool/references/output-schema-types.md → frontmcp-development/references/create-tool-output-schema-types.md} +0 -0
- /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-auth.md +0 -0
- /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-browser-build.md +0 -0
- /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-cli-binary.md +0 -0
- /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-direct-client.md +0 -0
- /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-e2e-handler.md +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://openapi.vercel.sh/vercel.json",
|
|
3
|
+
"framework": null,
|
|
4
|
+
"buildCommand": "frontmcp build --target vercel",
|
|
5
|
+
"outputDirectory": "dist",
|
|
6
|
+
"rewrites": [
|
|
7
|
+
{
|
|
8
|
+
"source": "/(.*)",
|
|
9
|
+
"destination": "/api/frontmcp"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"functions": {
|
|
13
|
+
"api/frontmcp.js": {
|
|
14
|
+
"memory": 512,
|
|
15
|
+
"maxDuration": 30
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"regions": ["iad1"],
|
|
19
|
+
"headers": [
|
|
20
|
+
{
|
|
21
|
+
"source": "/health",
|
|
22
|
+
"headers": [
|
|
23
|
+
{
|
|
24
|
+
"key": "Cache-Control",
|
|
25
|
+
"value": "no-store"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"source": "/mcp",
|
|
31
|
+
"headers": [
|
|
32
|
+
{
|
|
33
|
+
"key": "Cache-Control",
|
|
34
|
+
"value": "no-store"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"key": "X-Content-Type-Options",
|
|
38
|
+
"value": "nosniff"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"source": "/(.\*)",
|
|
44
|
+
"headers": [
|
|
45
|
+
{
|
|
46
|
+
"key": "X-Frame-Options",
|
|
47
|
+
"value": "DENY"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"key": "X-Content-Type-Options",
|
|
51
|
+
"value": "nosniff"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"key": "Referrer-Policy",
|
|
55
|
+
"value": "strict-origin-when-cross-origin"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Deploy a FrontMCP Server to Vercel
|
|
2
|
+
|
|
3
|
+
This skill guides you through deploying a FrontMCP server to Vercel serverless functions with Vercel KV for persistent storage.
|
|
4
|
+
|
|
5
|
+
## When to Use This Skill
|
|
6
|
+
|
|
7
|
+
### Must Use
|
|
8
|
+
|
|
9
|
+
- Deploying a FrontMCP server to Vercel serverless functions
|
|
10
|
+
- Configuring Vercel KV as the persistence layer for sessions and skill cache
|
|
11
|
+
- Setting up a serverless MCP endpoint with automatic TLS and global CDN
|
|
12
|
+
|
|
13
|
+
### Recommended
|
|
14
|
+
|
|
15
|
+
- You already use Vercel for your frontend and want a unified deployment pipeline
|
|
16
|
+
- You need zero-ops scaling without managing Docker containers or servers
|
|
17
|
+
- Deploying preview environments per pull request for MCP server testing
|
|
18
|
+
|
|
19
|
+
### Skip When
|
|
20
|
+
|
|
21
|
+
- You need persistent connections, WebSockets, or long-running processes -- use `deploy-to-node` instead
|
|
22
|
+
- Deploying to AWS infrastructure or need AWS-specific services -- use `deploy-to-lambda` instead
|
|
23
|
+
- Your MCP operations routinely exceed the Vercel function timeout for your plan
|
|
24
|
+
|
|
25
|
+
> **Decision:** Choose this skill when you want serverless deployment on Vercel with minimal infrastructure management; choose a different target when you need persistent processes or AWS-native services.
|
|
26
|
+
|
|
27
|
+
## Prerequisites
|
|
28
|
+
|
|
29
|
+
- A Vercel account (https://vercel.com)
|
|
30
|
+
- Vercel CLI installed: `npm install -g vercel`
|
|
31
|
+
- A built FrontMCP project
|
|
32
|
+
|
|
33
|
+
## Step 1: Build for Vercel
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
frontmcp build --target vercel
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This produces a Vercel-compatible output structure with an `api/` directory containing the serverless function entry points, optimized bundles for cold-start performance, and a `vercel.json` configuration file.
|
|
40
|
+
|
|
41
|
+
## Step 2: Configure vercel.json
|
|
42
|
+
|
|
43
|
+
Create or update `vercel.json` in your project root:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"rewrites": [{ "source": "/(.*)", "destination": "/api/frontmcp" }],
|
|
48
|
+
"functions": {
|
|
49
|
+
"api/frontmcp.ts": {
|
|
50
|
+
"memory": 1024,
|
|
51
|
+
"maxDuration": 60
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"regions": ["iad1"],
|
|
55
|
+
"headers": [
|
|
56
|
+
{
|
|
57
|
+
"source": "/(.*)",
|
|
58
|
+
"headers": [
|
|
59
|
+
{ "key": "X-Content-Type-Options", "value": "nosniff" },
|
|
60
|
+
{ "key": "X-Frame-Options", "value": "DENY" }
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The rewrite rule sends all requests to the single FrontMCP API handler, which internally routes MCP and HTTP requests.
|
|
68
|
+
|
|
69
|
+
## Step 3: Configure Vercel KV Storage
|
|
70
|
+
|
|
71
|
+
Use the `vercel-kv` provider so FrontMCP stores sessions, skill cache, and plugin state in Vercel KV (powered by Upstash Redis):
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { FrontMcp, App } from '@frontmcp/sdk';
|
|
75
|
+
|
|
76
|
+
@App({ name: 'MyApp' })
|
|
77
|
+
class MyApp {}
|
|
78
|
+
|
|
79
|
+
@FrontMcp({
|
|
80
|
+
info: { name: 'my-server', version: '1.0.0' },
|
|
81
|
+
apps: [MyApp],
|
|
82
|
+
redis: { provider: 'vercel-kv' },
|
|
83
|
+
skillsConfig: {
|
|
84
|
+
enabled: true,
|
|
85
|
+
cache: {
|
|
86
|
+
enabled: true,
|
|
87
|
+
redis: { provider: 'vercel-kv' },
|
|
88
|
+
ttlMs: 60000,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
class MyServer {}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Provision the KV store in the Vercel dashboard under **Storage > Create Database > KV (Redis)**, then link it to your project. Vercel automatically injects the required environment variables.
|
|
96
|
+
|
|
97
|
+
## Step 4: Environment Variables
|
|
98
|
+
|
|
99
|
+
Vercel KV variables are injected automatically when the store is linked. For manual setup or additional configuration, set them in the Vercel dashboard (**Settings > Environment Variables**) or via the CLI:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
vercel env add KV_REST_API_URL "https://your-kv-store.kv.vercel-storage.com"
|
|
103
|
+
vercel env add KV_REST_API_TOKEN "your-token"
|
|
104
|
+
vercel env add NODE_ENV production
|
|
105
|
+
vercel env add LOG_LEVEL info
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
| Variable | Description | Required |
|
|
109
|
+
| ------------------- | ------------------------------ | ----------- |
|
|
110
|
+
| `KV_REST_API_URL` | Vercel KV REST endpoint | If using KV |
|
|
111
|
+
| `KV_REST_API_TOKEN` | Vercel KV authentication token | If using KV |
|
|
112
|
+
| `NODE_ENV` | Runtime environment | Yes |
|
|
113
|
+
| `LOG_LEVEL` | Logging verbosity | No |
|
|
114
|
+
|
|
115
|
+
## Step 5: Deploy
|
|
116
|
+
|
|
117
|
+
### Preview Deployment
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
vercel
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Creates a preview deployment with a unique URL for validation.
|
|
124
|
+
|
|
125
|
+
### Production Deployment
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
vercel --prod
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Deploys to your production domain.
|
|
132
|
+
|
|
133
|
+
### Custom Domain
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
vercel domains add mcp.example.com
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Configure your DNS provider to point the domain to Vercel. TLS certificates are provisioned automatically.
|
|
140
|
+
|
|
141
|
+
## Step 6: Verify
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Health check
|
|
145
|
+
curl https://your-project.vercel.app/health
|
|
146
|
+
|
|
147
|
+
# Test MCP endpoint
|
|
148
|
+
curl -X POST https://your-project.vercel.app/mcp \
|
|
149
|
+
-H "Content-Type: application/json" \
|
|
150
|
+
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Cold Start Notes
|
|
154
|
+
|
|
155
|
+
Vercel serverless functions experience cold starts after periods of inactivity. To minimize impact:
|
|
156
|
+
|
|
157
|
+
- The `frontmcp build --target vercel` output is optimized for bundle size. Avoid adding unnecessary dependencies.
|
|
158
|
+
- Consider Vercel's **Fluid Compute** for latency-sensitive workloads.
|
|
159
|
+
- Keep function memory at 1024 MB for faster initialization.
|
|
160
|
+
|
|
161
|
+
### Execution Limits
|
|
162
|
+
|
|
163
|
+
| Plan | Max Duration |
|
|
164
|
+
| ---------- | ------------ |
|
|
165
|
+
| Hobby | 10 seconds |
|
|
166
|
+
| Pro | 60 seconds |
|
|
167
|
+
| Enterprise | 900 seconds |
|
|
168
|
+
|
|
169
|
+
Long-running MCP operations should complete within these limits or use streaming responses.
|
|
170
|
+
|
|
171
|
+
### Statelessness
|
|
172
|
+
|
|
173
|
+
Serverless functions are stateless between invocations. All persistent state must go through Vercel KV. FrontMCP handles this automatically when `{ provider: 'vercel-kv' }` is configured.
|
|
174
|
+
|
|
175
|
+
## Common Patterns
|
|
176
|
+
|
|
177
|
+
| Pattern | Correct | Incorrect | Why |
|
|
178
|
+
| --------------------- | ------------------------------------------ | ------------------------------------ | ------------------------------------------------------------------------------- |
|
|
179
|
+
| Build command | `frontmcp build --target vercel` | `tsc` or generic `npm run build` | The Vercel target produces optimized bundles and the `api/` directory structure |
|
|
180
|
+
| KV provider config | `{ provider: 'vercel-kv' }` | `{ provider: 'redis', host: '...' }` | Vercel KV uses its own REST API; a raw Redis provider will not connect |
|
|
181
|
+
| Rewrite rule | `"source": "/(.*)"` to `/api/frontmcp` | No rewrite or per-route entries | A single catch-all rewrite lets FrontMCP's internal router handle all paths |
|
|
182
|
+
| Environment variables | Link KV store in dashboard (auto-injected) | Hardcode `KV_REST_API_URL` in source | Linked stores inject vars automatically and rotate tokens safely |
|
|
183
|
+
| Function memory | 1024 MB for faster cold starts | 128 MB default | CPU scales with memory on Vercel; higher memory reduces initialization time |
|
|
184
|
+
|
|
185
|
+
## Verification Checklist
|
|
186
|
+
|
|
187
|
+
**Build**
|
|
188
|
+
|
|
189
|
+
- [ ] `frontmcp build --target vercel` completes without errors
|
|
190
|
+
- [ ] `api/frontmcp.ts` (or `.js`) exists in the build output
|
|
191
|
+
|
|
192
|
+
**Deployment**
|
|
193
|
+
|
|
194
|
+
- [ ] `vercel` creates a preview deployment without errors
|
|
195
|
+
- [ ] `vercel --prod` deploys to the production domain
|
|
196
|
+
- [ ] `curl https://your-project.vercel.app/health` returns `{"status":"ok"}`
|
|
197
|
+
|
|
198
|
+
**Storage and Configuration**
|
|
199
|
+
|
|
200
|
+
- [ ] Vercel KV store is created and linked to the project
|
|
201
|
+
- [ ] `KV_REST_API_URL` and `KV_REST_API_TOKEN` are present in environment variables
|
|
202
|
+
- [ ] `NODE_ENV` is set to `production`
|
|
203
|
+
- [ ] `vercel.json` has correct rewrite, function config, and region settings
|
|
204
|
+
|
|
205
|
+
**Production Readiness**
|
|
206
|
+
|
|
207
|
+
- [ ] Custom domain is configured with DNS pointing to Vercel
|
|
208
|
+
- [ ] TLS certificate is provisioned (automatic on Vercel)
|
|
209
|
+
- [ ] `maxDuration` in `vercel.json` matches your Vercel plan limits
|
|
210
|
+
|
|
211
|
+
## Troubleshooting
|
|
212
|
+
|
|
213
|
+
| Problem | Cause | Solution |
|
|
214
|
+
| -------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
215
|
+
| Function timeout | Operation exceeds `maxDuration` or plan limit | Increase `maxDuration` in `vercel.json`; check plan limits (Hobby: 10s, Pro: 60s) |
|
|
216
|
+
| KV connection errors | KV store not linked or env vars missing | Re-link the KV store in the Vercel dashboard; verify `KV_REST_API_URL` and `KV_REST_API_TOKEN` |
|
|
217
|
+
| 404 on API routes | Rewrite rule missing or misconfigured | Confirm `vercel.json` has `"source": "/(.*)"` rewriting to `/api/frontmcp` |
|
|
218
|
+
| Bundle too large | Unnecessary dependencies included | Review dependencies and remove unused packages to reduce bundle size |
|
|
219
|
+
| Cold starts too slow | Low function memory or large bundle | Increase memory to 1024 MB; audit dependencies; consider Vercel Fluid Compute |
|
|
220
|
+
|
|
221
|
+
## Reference
|
|
222
|
+
|
|
223
|
+
- **Docs:** https://docs.agentfront.dev/frontmcp/deployment/serverless
|
|
224
|
+
- **Related skills:** `deploy-to-node`, `deploy-to-lambda`
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontmcp-development
|
|
3
|
+
description: "Domain router for building MCP components \u2014 tools, resources, prompts, agents, providers, jobs, workflows, and skills. Use when starting any FrontMCP development task and need to find the right skill."
|
|
4
|
+
tags: [router, development, tools, resources, prompts, agents, skills, guide]
|
|
5
|
+
priority: 10
|
|
6
|
+
visibility: both
|
|
7
|
+
license: Apache-2.0
|
|
8
|
+
metadata:
|
|
9
|
+
docs: https://docs.agentfront.dev/frontmcp/servers/overview
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# FrontMCP Development Router
|
|
13
|
+
|
|
14
|
+
Entry point for building MCP server components. This skill helps you find the right development skill based on what you want to build. It does not teach implementation details itself — it routes you to the specific skill that does.
|
|
15
|
+
|
|
16
|
+
## When to Use This Skill
|
|
17
|
+
|
|
18
|
+
### Must Use
|
|
19
|
+
|
|
20
|
+
- Starting a FrontMCP development task and unsure which component type to build (tool vs resource vs prompt vs agent)
|
|
21
|
+
- Onboarding to the FrontMCP development model and need an overview of all building blocks
|
|
22
|
+
- Planning a feature that may require multiple component types working together
|
|
23
|
+
|
|
24
|
+
### Recommended
|
|
25
|
+
|
|
26
|
+
- Looking up the canonical name of a development skill to install or search
|
|
27
|
+
- Comparing component types to decide which fits your use case
|
|
28
|
+
- Understanding how tools, resources, prompts, agents, and skills relate to each other
|
|
29
|
+
|
|
30
|
+
### Skip When
|
|
31
|
+
|
|
32
|
+
- You already know which component to build (go directly to `create-tool`, `create-resource`, etc.)
|
|
33
|
+
- You need to configure server settings, not build components (see `frontmcp-config`)
|
|
34
|
+
- You need to deploy or build, not develop (see `frontmcp-deployment`)
|
|
35
|
+
|
|
36
|
+
> **Decision:** Use this skill when you need to figure out WHAT to build. Use the specific skill when you already know.
|
|
37
|
+
|
|
38
|
+
## Scenario Routing Table
|
|
39
|
+
|
|
40
|
+
| Scenario | Skill | Description |
|
|
41
|
+
| -------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------ |
|
|
42
|
+
| Expose an executable action that AI clients can call | `create-tool` | Class-based or function-style tools with Zod input/output validation |
|
|
43
|
+
| Expose read-only data via a URI | `create-resource` | Static resources or URI template resources for dynamic data |
|
|
44
|
+
| Create a reusable conversation template or system prompt | `create-prompt` | Prompt entries with arguments and multi-turn message sequences |
|
|
45
|
+
| Build an autonomous AI loop that orchestrates tools | `create-agent` | Agent entries with LLM config, inner tools, and swarm handoff |
|
|
46
|
+
| Register shared services or configuration via DI | `create-provider` | Dependency injection tokens, lifecycle hooks, factory providers |
|
|
47
|
+
| Run a background task with progress and retries | `create-job` | Job entries with attempt tracking, retry config, and progress |
|
|
48
|
+
| Chain multiple jobs into a sequential pipeline | `create-workflow` | Workflow entries that compose jobs with data passing |
|
|
49
|
+
| Write instruction-only AI guidance (no code execution) | `create-skill` | Skill entries with markdown instructions from files, strings, or URLs |
|
|
50
|
+
| Write AI guidance that also orchestrates tools | `create-skill-with-tools` | Skill entries that combine instructions with registered tools |
|
|
51
|
+
| Look up any decorator signature or option | `decorators-guide` | Complete reference for @Tool, @Resource, @Prompt, @Agent, @App, @FrontMcp, and more |
|
|
52
|
+
| Integrate an external API via OpenAPI spec | `official-adapters` | OpenApiAdapter with auth, polling, inline specs, and multiple API composition |
|
|
53
|
+
| Use official plugins (caching, remember, feature flags) | `official-plugins` | Built-in plugins for caching, session memory, approval, feature flags, and dashboard |
|
|
54
|
+
|
|
55
|
+
## Recommended Reading Order
|
|
56
|
+
|
|
57
|
+
1. **`decorators-guide`** — Start here to understand the full decorator landscape
|
|
58
|
+
2. **`create-tool`** — The most common building block; learn tools first
|
|
59
|
+
3. **`create-resource`** — Expose data alongside tools
|
|
60
|
+
4. **`create-prompt`** — Add reusable conversation templates
|
|
61
|
+
5. **`create-provider`** — Share services across tools and resources via DI
|
|
62
|
+
6. **`create-agent`** — Build autonomous AI loops (advanced)
|
|
63
|
+
7. **`create-job`** / **`create-workflow`** — Background processing (advanced)
|
|
64
|
+
8. **`create-skill`** / **`create-skill-with-tools`** — Author your own skills (meta)
|
|
65
|
+
9. **`official-adapters`** — Integrate external APIs via OpenAPI specs
|
|
66
|
+
10. **`official-plugins`** — Add caching, session memory, feature flags, and more
|
|
67
|
+
|
|
68
|
+
## Cross-Cutting Patterns
|
|
69
|
+
|
|
70
|
+
| Pattern | Applies To | Rule |
|
|
71
|
+
| ----------------- | --------------------------------- | -------------------------------------------------------------------------------------- |
|
|
72
|
+
| Naming convention | Tools | Use `snake_case` for tool names (`get_weather`, not `getWeather`) |
|
|
73
|
+
| Naming convention | Skills, resources | Use `kebab-case` for skill and resource names |
|
|
74
|
+
| File naming | All components | Use `<name>.<type>.ts` pattern (e.g., `fetch-weather.tool.ts`) |
|
|
75
|
+
| DI access | Tools, resources, prompts, agents | Use `this.get(TOKEN)` (throws) or `this.tryGet(TOKEN)` (returns undefined) |
|
|
76
|
+
| Error handling | All components | Use `this.fail(err)` with MCP error classes, not raw `throw` |
|
|
77
|
+
| Input validation | Tools | Always use Zod raw shapes (not `z.object()`) for `inputSchema` |
|
|
78
|
+
| Output validation | Tools | Always define `outputSchema` to prevent data leaks |
|
|
79
|
+
| Registration | All components | Add to `tools`, `resources`, `prompts`, `agents`, etc. arrays in `@App` or `@FrontMcp` |
|
|
80
|
+
| Test files | All components | Use `.spec.ts` extension, never `.test.ts` |
|
|
81
|
+
|
|
82
|
+
## Common Patterns
|
|
83
|
+
|
|
84
|
+
| Pattern | Correct | Incorrect | Why |
|
|
85
|
+
| ----------------------- | --------------------------------------------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
|
|
86
|
+
| Choosing component type | Tool for actions, Resource for data, Prompt for templates | Using a tool to return static data | Each type has protocol-level semantics; misuse confuses AI clients |
|
|
87
|
+
| Component registration | Register in `@App` arrays, compose apps in `@FrontMcp` | Register tools directly in `@FrontMcp` without an `@App` | Apps provide modularity; direct registration bypasses app-level hooks |
|
|
88
|
+
| Shared logic | Extract to a `@Provider` and inject via DI | Duplicate code across multiple tools | Providers are testable, lifecycle-managed, and scoped |
|
|
89
|
+
| Complex orchestration | Use `@Agent` with inner tools | Chain tool calls manually in a single tool | Agents handle LLM loops, retries, and tool selection automatically |
|
|
90
|
+
| Background work | Use `@Job` with retry config | Run long tasks inside a tool's `execute()` | Jobs have progress tracking, attempt awareness, and timeout handling |
|
|
91
|
+
|
|
92
|
+
## Verification Checklist
|
|
93
|
+
|
|
94
|
+
### Architecture
|
|
95
|
+
|
|
96
|
+
- [ ] Each component type matches its semantic purpose (action=tool, data=resource, template=prompt)
|
|
97
|
+
- [ ] Shared services use `@Provider` with DI tokens, not module-level singletons
|
|
98
|
+
- [ ] Components are registered in `@App` arrays, apps composed in `@FrontMcp`
|
|
99
|
+
|
|
100
|
+
### Development Workflow
|
|
101
|
+
|
|
102
|
+
- [ ] Files follow `<name>.<type>.ts` naming convention
|
|
103
|
+
- [ ] Each component has a corresponding `.spec.ts` test file
|
|
104
|
+
- [ ] `decorators-guide` consulted for unfamiliar decorator options
|
|
105
|
+
|
|
106
|
+
## Troubleshooting
|
|
107
|
+
|
|
108
|
+
| Problem | Cause | Solution |
|
|
109
|
+
| ---------------------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
110
|
+
| Unsure which component type to use | Requirements are ambiguous | Check the Scenario Routing Table above; if the action modifies state, use a tool; if it returns data by URI, use a resource |
|
|
111
|
+
| Component not discovered at runtime | Not registered in `@App` or `@FrontMcp` arrays | Add to the appropriate array (`tools`, `resources`, `prompts`, etc.) |
|
|
112
|
+
| DI token not resolving | Provider not registered in scope | Register the provider in the `providers` array of the same `@App` |
|
|
113
|
+
| Need both AI guidance and tool execution | Used `create-skill` but need tools too | Switch to `create-skill-with-tools` which combines instructions with registered tools |
|
|
114
|
+
|
|
115
|
+
## Reference
|
|
116
|
+
|
|
117
|
+
- [Server Overview](https://docs.agentfront.dev/frontmcp/servers/overview)
|
|
118
|
+
- Related skills: `create-tool`, `create-resource`, `create-prompt`, `create-agent`, `create-provider`, `create-job`, `create-workflow`, `create-skill`, `create-skill-with-tools`, `decorators-guide`, `official-adapters`, `official-plugins`
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Creating Custom Adapters
|
|
2
|
+
|
|
3
|
+
Build adapters that automatically generate MCP tools, resources, and prompts from external sources — databases, GraphQL schemas, proprietary APIs, or any definition format.
|
|
4
|
+
|
|
5
|
+
## When to Use This Skill
|
|
6
|
+
|
|
7
|
+
### Must Use
|
|
8
|
+
|
|
9
|
+
- Integrating a non-OpenAPI source (GraphQL, gRPC, database schema) that should generate MCP tools automatically
|
|
10
|
+
- Building a reusable adapter that converts external definitions into tools, resources, or prompts at startup
|
|
11
|
+
- Creating tools dynamically at runtime based on external state or configuration
|
|
12
|
+
|
|
13
|
+
### Recommended
|
|
14
|
+
|
|
15
|
+
- Wrapping a proprietary internal API that has its own schema format
|
|
16
|
+
- Auto-generating tools from a database schema or config file on server start
|
|
17
|
+
- Building an adapter that polls an external source and refreshes tool definitions periodically
|
|
18
|
+
|
|
19
|
+
### Skip When
|
|
20
|
+
|
|
21
|
+
- The external API has an OpenAPI/Swagger spec (see `official-adapters`)
|
|
22
|
+
- You need cross-cutting middleware behavior like logging or caching (see `create-plugin`)
|
|
23
|
+
- You are building a single static tool manually (see `create-tool`)
|
|
24
|
+
|
|
25
|
+
> **Decision:** Use this skill when you need to auto-generate MCP tools, resources, or prompts from a non-OpenAPI external source by extending `DynamicAdapter`.
|
|
26
|
+
|
|
27
|
+
## Step 1: Extend DynamicAdapter
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { DynamicAdapter, type FrontMcpAdapterResponse } from '@frontmcp/sdk';
|
|
31
|
+
|
|
32
|
+
interface MyAdapterOptions {
|
|
33
|
+
endpoint: string;
|
|
34
|
+
apiKey: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
class MyApiAdapter extends DynamicAdapter<MyAdapterOptions> {
|
|
38
|
+
declare __options_brand: MyAdapterOptions;
|
|
39
|
+
|
|
40
|
+
async fetch(): Promise<FrontMcpAdapterResponse> {
|
|
41
|
+
// Fetch definitions from external source
|
|
42
|
+
const res = await globalThis.fetch(this.options.endpoint, {
|
|
43
|
+
headers: { Authorization: `Bearer ${this.options.apiKey}` },
|
|
44
|
+
});
|
|
45
|
+
const schema = await res.json();
|
|
46
|
+
|
|
47
|
+
// Convert to MCP tool definitions
|
|
48
|
+
return {
|
|
49
|
+
tools: schema.operations.map((op: { name: string; description: string; params: Record<string, unknown> }) => ({
|
|
50
|
+
name: op.name,
|
|
51
|
+
description: op.description,
|
|
52
|
+
inputSchema: this.convertParams(op.params),
|
|
53
|
+
execute: async (input: Record<string, unknown>) => {
|
|
54
|
+
return this.callApi(op.name, input);
|
|
55
|
+
},
|
|
56
|
+
})),
|
|
57
|
+
resources: [],
|
|
58
|
+
prompts: [],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private convertParams(params: Record<string, unknown>) {
|
|
63
|
+
// Convert external param definitions to Zod schemas
|
|
64
|
+
// ...
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private async callApi(operation: string, input: Record<string, unknown>) {
|
|
68
|
+
// Call the external API
|
|
69
|
+
// ...
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Step 2: Register
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
@App({
|
|
78
|
+
name: 'MyApp',
|
|
79
|
+
adapters: [
|
|
80
|
+
MyApiAdapter.init({
|
|
81
|
+
name: 'my-api',
|
|
82
|
+
endpoint: 'https://api.example.com/schema',
|
|
83
|
+
apiKey: process.env.API_KEY!,
|
|
84
|
+
}),
|
|
85
|
+
],
|
|
86
|
+
})
|
|
87
|
+
class MyApp {}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## FrontMcpAdapterResponse
|
|
91
|
+
|
|
92
|
+
The `fetch()` method returns tools, resources, and prompts to register:
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
interface FrontMcpAdapterResponse {
|
|
96
|
+
tools?: AdapterToolDefinition[];
|
|
97
|
+
resources?: AdapterResourceDefinition[];
|
|
98
|
+
prompts?: AdapterPromptDefinition[];
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Static init()
|
|
103
|
+
|
|
104
|
+
`DynamicAdapter` provides a static `init()` method inherited by all subclasses:
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
// Usage — no manual instantiation needed
|
|
108
|
+
const adapter = MyApiAdapter.init({
|
|
109
|
+
name: 'my-api', // Required: adapter name (used for tool namespacing)
|
|
110
|
+
endpoint: '...',
|
|
111
|
+
apiKey: '...',
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// Register in @App
|
|
115
|
+
@App({ adapters: [adapter] })
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Nx Generator
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
nx generate @frontmcp/nx:adapter my-adapter --project=my-app
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Creates a `DynamicAdapter` subclass in `src/adapters/my-adapter.adapter.ts`.
|
|
125
|
+
|
|
126
|
+
## Common Patterns
|
|
127
|
+
|
|
128
|
+
| Pattern | Correct | Incorrect | Why |
|
|
129
|
+
| ----------------------- | ------------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------- |
|
|
130
|
+
| Adapter registration | `MyAdapter.init({ name: 'my-api', ... })` in `adapters` array | `new MyAdapter({ ... })` directly | `init()` returns the proper provider entry for DI wiring |
|
|
131
|
+
| Options branding | `declare __options_brand: MyAdapterOptions;` in adapter class | Omitting the brand declaration | Brand ensures TypeScript infers the correct options type for `init()` |
|
|
132
|
+
| Fetch return type | Return `{ tools: [...], resources: [...], prompts: [...] }` | Returning raw API response without conversion | `fetch()` must return `FrontMcpAdapterResponse` with MCP-compatible definitions |
|
|
133
|
+
| Tool naming | Namespace tools: `name: 'my-api:operation-name'` | Flat names without namespace: `name: 'operation-name'` | Namespacing prevents collisions when multiple adapters are registered |
|
|
134
|
+
| Error handling in fetch | Throw descriptive errors with endpoint info | Silently returning empty arrays on failure | Adapter errors should surface at startup so misconfigurations are caught early |
|
|
135
|
+
|
|
136
|
+
## Verification Checklist
|
|
137
|
+
|
|
138
|
+
### Configuration
|
|
139
|
+
|
|
140
|
+
- [ ] Adapter class extends `DynamicAdapter<TOptions>`
|
|
141
|
+
- [ ] `__options_brand` is declared with the correct options type
|
|
142
|
+
- [ ] `fetch()` method is implemented and returns `FrontMcpAdapterResponse`
|
|
143
|
+
- [ ] Adapter is registered via `.init()` in the `adapters` array of `@App`
|
|
144
|
+
|
|
145
|
+
### Runtime
|
|
146
|
+
|
|
147
|
+
- [ ] Generated tools appear in `tools/list` MCP response
|
|
148
|
+
- [ ] Tool names are namespaced with the adapter name (e.g., `my-api:operationId`)
|
|
149
|
+
- [ ] Generated tools accept valid input and return expected output
|
|
150
|
+
- [ ] Adapter fetch errors produce clear startup error messages
|
|
151
|
+
|
|
152
|
+
## Troubleshooting
|
|
153
|
+
|
|
154
|
+
| Problem | Cause | Solution |
|
|
155
|
+
| ------------------------------------------ | ----------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
156
|
+
| No tools appear after adapter registration | `fetch()` returns empty `tools` array | Verify external source is reachable and response is parsed correctly |
|
|
157
|
+
| TypeScript error on `.init()` options | Missing `__options_brand` declaration | Add `declare __options_brand: MyAdapterOptions;` to the adapter class |
|
|
158
|
+
| Tool input validation fails | `inputSchema` conversion does not produce valid Zod schemas | Verify `convertParams` produces `z.object()` shapes matching the external schema |
|
|
159
|
+
| Duplicate tool name error | Multiple adapters produce tools with the same name | Use unique `name` parameter in `init()` to namespace tools |
|
|
160
|
+
| Adapter not found at runtime | Registered in wrong `@App` or not in `adapters` array | Ensure `.init()` result is in the `adapters` array of the correct `@App` |
|
|
161
|
+
|
|
162
|
+
## Reference
|
|
163
|
+
|
|
164
|
+
- [Adapter Documentation](https://docs.agentfront.dev/frontmcp/adapters/overview)
|
|
165
|
+
- Related skills: `official-adapters`, `create-plugin`, `create-tool`
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Agent LLM Configuration Reference
|
|
2
2
|
|
|
3
|
-
## Supported
|
|
3
|
+
## Supported Providers
|
|
4
4
|
|
|
5
5
|
### Anthropic
|
|
6
6
|
|
|
7
7
|
```typescript
|
|
8
8
|
llm: {
|
|
9
|
-
|
|
10
|
-
model: 'claude-sonnet-4-20250514',
|
|
9
|
+
provider: 'anthropic', // Any supported provider — 'anthropic', 'openai', etc.
|
|
10
|
+
model: 'claude-sonnet-4-20250514', // Any supported model for the chosen provider
|
|
11
11
|
apiKey: { env: 'ANTHROPIC_API_KEY' },
|
|
12
12
|
maxTokens: 4096,
|
|
13
13
|
}
|
|
@@ -17,8 +17,8 @@ llm: {
|
|
|
17
17
|
|
|
18
18
|
```typescript
|
|
19
19
|
llm: {
|
|
20
|
-
|
|
21
|
-
model: 'gpt-4o',
|
|
20
|
+
provider: 'openai',
|
|
21
|
+
model: 'gpt-4o', // Any supported model for the chosen provider
|
|
22
22
|
apiKey: { env: 'OPENAI_API_KEY' },
|
|
23
23
|
maxTokens: 4096,
|
|
24
24
|
}
|