@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
package/catalog/TEMPLATE.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: skill-name
|
|
3
|
-
description:
|
|
4
|
-
tags: [category,
|
|
3
|
+
description: Primary action sentence. Use when [scenario 1], [scenario 2], or [scenario 3].
|
|
4
|
+
tags: [category, keyword1, keyword2]
|
|
5
5
|
tools:
|
|
6
|
-
- tool_name
|
|
6
|
+
- name: tool_name
|
|
7
|
+
purpose: What this tool does in this skill
|
|
7
8
|
parameters:
|
|
8
9
|
- name: param_name
|
|
9
10
|
description: What this parameter controls
|
|
@@ -12,18 +13,40 @@ parameters:
|
|
|
12
13
|
examples:
|
|
13
14
|
- scenario: When to use this skill
|
|
14
15
|
expected-outcome: What the user should see after completion
|
|
15
|
-
|
|
16
|
+
priority: 7
|
|
17
|
+
visibility: both
|
|
16
18
|
license: Apache-2.0
|
|
19
|
+
metadata:
|
|
20
|
+
docs: https://docs.agentfront.dev/frontmcp/...
|
|
17
21
|
---
|
|
18
22
|
|
|
19
|
-
# Skill
|
|
23
|
+
# Skill Title
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
One-paragraph overview of what this skill accomplishes and its role in the FrontMCP ecosystem.
|
|
26
|
+
|
|
27
|
+
## When to Use This Skill
|
|
28
|
+
|
|
29
|
+
### Must Use
|
|
30
|
+
|
|
31
|
+
- Scenario where this is the only correct skill to apply
|
|
32
|
+
- Another mandatory scenario
|
|
33
|
+
|
|
34
|
+
### Recommended
|
|
35
|
+
|
|
36
|
+
- Scenario where this skill helps but alternatives exist
|
|
37
|
+
- Helpful but optional scenario
|
|
38
|
+
|
|
39
|
+
### Skip When
|
|
40
|
+
|
|
41
|
+
- Scenario where another skill is the better choice (see `other-skill-name`)
|
|
42
|
+
- Situation where this skill does not apply
|
|
43
|
+
|
|
44
|
+
> **Decision:** One-liner summarizing when to pick this skill over alternatives.
|
|
22
45
|
|
|
23
46
|
## Prerequisites
|
|
24
47
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
48
|
+
- Required packages or tools
|
|
49
|
+
- Prior skills that should be completed first (see `prerequisite-skill`)
|
|
27
50
|
|
|
28
51
|
## Steps
|
|
29
52
|
|
|
@@ -39,11 +62,33 @@ Describe the first step with code examples:
|
|
|
39
62
|
|
|
40
63
|
Continue with subsequent steps.
|
|
41
64
|
|
|
42
|
-
|
|
65
|
+
## Common Patterns
|
|
66
|
+
|
|
67
|
+
<!-- Include this section only for skills with clear right/wrong usage patterns -->
|
|
68
|
+
|
|
69
|
+
| Pattern | Correct | Incorrect | Why |
|
|
70
|
+
| --------------- | ------------------------ | -------------- | ------------------------------------ |
|
|
71
|
+
| Decorator usage | `@Tool({ name: '...' })` | `@Tool('...')` | Decorator requires an options object |
|
|
72
|
+
|
|
73
|
+
## Verification Checklist
|
|
74
|
+
|
|
75
|
+
### Configuration
|
|
76
|
+
|
|
77
|
+
- [ ] Config item verified
|
|
78
|
+
- [ ] Dependencies installed
|
|
79
|
+
|
|
80
|
+
### Runtime
|
|
81
|
+
|
|
82
|
+
- [ ] Feature works as expected
|
|
83
|
+
- [ ] Error cases handled
|
|
84
|
+
|
|
85
|
+
## Troubleshooting
|
|
43
86
|
|
|
44
|
-
|
|
87
|
+
| Problem | Cause | Solution |
|
|
88
|
+
| -------------------- | -------------- | ------------- |
|
|
89
|
+
| Common error message | Why it happens | How to fix it |
|
|
45
90
|
|
|
46
|
-
##
|
|
91
|
+
## Reference
|
|
47
92
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
93
|
+
- [Documentation](https://docs.agentfront.dev/frontmcp/...)
|
|
94
|
+
- Related skills: `related-skill-a`, `related-skill-b`
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontmcp-config
|
|
3
|
+
description: "Domain router for configuring MCP servers \u2014 transport, HTTP, throttle, elicitation, auth, sessions, and storage. Use when configuring any aspect of a FrontMCP server."
|
|
4
|
+
tags: [router, config, transport, http, auth, session, redis, sqlite, throttle, guide]
|
|
5
|
+
priority: 10
|
|
6
|
+
visibility: both
|
|
7
|
+
license: Apache-2.0
|
|
8
|
+
metadata:
|
|
9
|
+
docs: https://docs.agentfront.dev/frontmcp/configuration/overview
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# FrontMCP Configuration Router
|
|
13
|
+
|
|
14
|
+
Entry point for configuring FrontMCP servers. This skill helps you find the right configuration skill based on what aspect of your server you need to set up.
|
|
15
|
+
|
|
16
|
+
## When to Use This Skill
|
|
17
|
+
|
|
18
|
+
### Must Use
|
|
19
|
+
|
|
20
|
+
- Setting up a new server and need to understand which configuration options exist
|
|
21
|
+
- Deciding between authentication modes, transport protocols, or storage backends
|
|
22
|
+
- Planning server configuration across transport, auth, throttling, and storage
|
|
23
|
+
|
|
24
|
+
### Recommended
|
|
25
|
+
|
|
26
|
+
- Looking up which skill covers a specific config option (CORS, rate limits, session TTL, etc.)
|
|
27
|
+
- Understanding how configuration layers work (server-level vs app-level vs tool-level)
|
|
28
|
+
- Reviewing the full configuration surface area before production deployment
|
|
29
|
+
|
|
30
|
+
### Skip When
|
|
31
|
+
|
|
32
|
+
- You already know which config area to change (go directly to `configure-transport`, `configure-auth`, etc.)
|
|
33
|
+
- You need to build components, not configure the server (see `frontmcp-development`)
|
|
34
|
+
- You need to deploy, not configure (see `frontmcp-deployment`)
|
|
35
|
+
|
|
36
|
+
> **Decision:** Use this skill when you need to figure out WHAT to configure. Use the specific skill when you already know.
|
|
37
|
+
|
|
38
|
+
## Prerequisites
|
|
39
|
+
|
|
40
|
+
- A FrontMCP project scaffolded with `frontmcp create` (see `frontmcp-setup`)
|
|
41
|
+
- Node.js 22+ and npm/yarn installed
|
|
42
|
+
|
|
43
|
+
## Steps
|
|
44
|
+
|
|
45
|
+
1. Identify the configuration area you need using the Scenario Routing Table below
|
|
46
|
+
2. Navigate to the specific configuration skill (e.g., `configure-transport`, `configure-auth`) for detailed instructions
|
|
47
|
+
3. Apply the configuration in your `@FrontMcp` or `@App` decorator
|
|
48
|
+
4. Verify using the Verification Checklist at the end of this skill
|
|
49
|
+
|
|
50
|
+
## Scenario Routing Table
|
|
51
|
+
|
|
52
|
+
| Scenario | Skill | Description |
|
|
53
|
+
| ---------------------------------------------------------- | ----------------------- | ------------------------------------------------------------- |
|
|
54
|
+
| Choose between SSE, Streamable HTTP, or stdio | `configure-transport` | Transport protocol selection with distributed session options |
|
|
55
|
+
| Set up CORS, port, base path, or request limits | `configure-http` | HTTP server options for Streamable HTTP and SSE transports |
|
|
56
|
+
| Add rate limiting, concurrency, or IP filtering | `configure-throttle` | Server-level and per-tool throttle configuration |
|
|
57
|
+
| Enable tools to ask users for input | `configure-elicitation` | Elicitation schemas, stores, and multi-step flows |
|
|
58
|
+
| Set up authentication (public, transparent, local, remote) | `configure-auth` | OAuth flows, credential vault, multi-app auth |
|
|
59
|
+
| Configure session storage backends | `configure-session` | Memory, Redis, Vercel KV, and custom session stores |
|
|
60
|
+
| Add Redis for production storage | `setup-redis` | Docker Redis, Vercel KV, pub/sub for subscriptions |
|
|
61
|
+
| Add SQLite for local development | `setup-sqlite` | SQLite with WAL mode, migration helpers |
|
|
62
|
+
|
|
63
|
+
## Configuration Layers
|
|
64
|
+
|
|
65
|
+
FrontMCP configuration cascades through three layers:
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
Server (@FrontMcp) ← Global defaults
|
|
69
|
+
└── App (@App) ← App-level overrides
|
|
70
|
+
└── Tool (@Tool) ← Per-tool overrides
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
| Setting | Server | App | Tool |
|
|
74
|
+
| --------------------- | ------------ | --- | -------------- |
|
|
75
|
+
| Transport | Yes | No | No |
|
|
76
|
+
| HTTP (CORS, port) | Yes | No | No |
|
|
77
|
+
| Throttle (rate limit) | Yes (global) | No | Yes (per-tool) |
|
|
78
|
+
| Auth mode | Yes | Yes | No |
|
|
79
|
+
| Session store | Yes | No | No |
|
|
80
|
+
| Elicitation | No | No | Yes (per-tool) |
|
|
81
|
+
|
|
82
|
+
## Cross-Cutting Patterns
|
|
83
|
+
|
|
84
|
+
| Pattern | Rule |
|
|
85
|
+
| ------------------- | ------------------------------------------------------------------------------------------------- |
|
|
86
|
+
| Auth + session | Auth mode determines session requirements: `remote` needs Redis/KV; `public` can use memory |
|
|
87
|
+
| Transport + storage | Stateless transports (serverless) require distributed storage; stateful (Node) can use in-process |
|
|
88
|
+
| Throttle scope | Server-level throttle applies to all tools; per-tool throttle overrides for specific tools |
|
|
89
|
+
| Environment config | Use environment variables for all secrets (API keys, Redis URLs, OAuth credentials) |
|
|
90
|
+
| Config validation | FrontMCP validates config at startup; invalid config throws before the server starts |
|
|
91
|
+
|
|
92
|
+
## Common Patterns
|
|
93
|
+
|
|
94
|
+
| Pattern | Correct | Incorrect | Why |
|
|
95
|
+
| -------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
|
|
96
|
+
| Auth mode for dev | `auth: { mode: 'public' }` or `auth: { mode: 'transparent', provider: '...' }` locally | `auth: { mode: 'remote', ... }` with real OAuth in dev | Remote auth requires a running OAuth provider; public/transparent are simpler for local dev |
|
|
97
|
+
| Session store | Redis for production, memory for development | Memory for production | Memory sessions are lost on restart and don't work across serverless invocations |
|
|
98
|
+
| Rate limit placement | Server-level for global limits, per-tool for expensive operations | Only server-level | Some tools are cheap (list) and some are expensive (generate); per-tool limits prevent abuse of expensive tools |
|
|
99
|
+
| CORS config | Explicit allowed origins in production | `cors: { origin: '*' }` in production | Wildcard CORS allows any origin to call your server |
|
|
100
|
+
| Config secrets | `process.env.REDIS_URL` via environment variable | Hardcoded `redis://localhost:6379` in source | Hardcoded secrets leak to git and break in different environments |
|
|
101
|
+
|
|
102
|
+
## Verification Checklist
|
|
103
|
+
|
|
104
|
+
### Transport and HTTP
|
|
105
|
+
|
|
106
|
+
- [ ] Transport protocol configured and server starts without errors
|
|
107
|
+
- [ ] CORS allows expected origins (test with browser or curl)
|
|
108
|
+
- [ ] Port and base path accessible from client
|
|
109
|
+
|
|
110
|
+
### Authentication
|
|
111
|
+
|
|
112
|
+
- [ ] Auth mode set appropriately for the environment (public/transparent for dev, remote for prod)
|
|
113
|
+
- [ ] OAuth credentials stored in environment variables, not source code
|
|
114
|
+
- [ ] Session store configured with appropriate backend (memory for dev, Redis for prod)
|
|
115
|
+
|
|
116
|
+
### Throttle and Security
|
|
117
|
+
|
|
118
|
+
- [ ] Global rate limit configured to prevent abuse
|
|
119
|
+
- [ ] Expensive tools have per-tool throttle overrides
|
|
120
|
+
- [ ] IP allow/deny lists configured if needed
|
|
121
|
+
|
|
122
|
+
### Storage
|
|
123
|
+
|
|
124
|
+
- [ ] Redis or SQLite configured and connectable
|
|
125
|
+
- [ ] Storage persists across server restarts (not memory in production)
|
|
126
|
+
|
|
127
|
+
## Troubleshooting
|
|
128
|
+
|
|
129
|
+
| Problem | Cause | Solution |
|
|
130
|
+
| --------------------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
|
|
131
|
+
| Server fails to start with config error | Invalid or missing required config field | Check the error message; FrontMCP validates config at startup and reports the specific invalid field |
|
|
132
|
+
| CORS blocked in browser | Missing or incorrect CORS origin config | Add the client's origin to `http.cors.origin`; see `configure-http` |
|
|
133
|
+
| Rate limit too aggressive | Global limit applied to all tools | Add per-tool overrides for cheap tools with higher limits; see `configure-throttle` |
|
|
134
|
+
| Sessions lost on serverless | Using memory session store on stateless platform | Switch to Redis or Vercel KV; see `configure-session` |
|
|
135
|
+
| Auth callback fails | OAuth redirect URI mismatch | Ensure the callback URL in your OAuth provider matches `auth.callbackUrl`; see `configure-auth` |
|
|
136
|
+
|
|
137
|
+
## Reference
|
|
138
|
+
|
|
139
|
+
- [Configuration Overview](https://docs.agentfront.dev/frontmcp/configuration/overview)
|
|
140
|
+
- Related skills: `configure-transport`, `configure-http`, `configure-throttle`, `configure-elicitation`, `configure-auth`, `configure-session`, `setup-redis`, `setup-sqlite`
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Configure Authentication for FrontMCP
|
|
2
|
+
|
|
3
|
+
This skill covers setting up authentication in a FrontMCP server. FrontMCP supports four auth modes, each suited to different deployment scenarios. All authentication logic lives in the `@frontmcp/auth` library.
|
|
4
|
+
|
|
5
|
+
## When to Use This Skill
|
|
6
|
+
|
|
7
|
+
### Must Use
|
|
8
|
+
|
|
9
|
+
- Adding authentication to a new FrontMCP server for the first time
|
|
10
|
+
- Switching between auth modes (e.g., moving from `public` to `remote` for production)
|
|
11
|
+
- Configuring the credential vault to access downstream APIs on behalf of authenticated users
|
|
12
|
+
|
|
13
|
+
### Recommended
|
|
14
|
+
|
|
15
|
+
- Setting up multi-app auth where different `@App` instances need different security postures
|
|
16
|
+
- Configuring OAuth local dev flow for development against `remote` or `transparent` modes
|
|
17
|
+
- Adding audience validation or session TTL tuning to an existing auth setup
|
|
18
|
+
|
|
19
|
+
### Skip When
|
|
20
|
+
|
|
21
|
+
- You need to manage session storage backends (Redis, Vercel KV) -- use `configure-session` instead
|
|
22
|
+
- You are building a plugin that extends auth context -- use `create-plugin` instead
|
|
23
|
+
|
|
24
|
+
> **Decision:** Use this skill whenever you need to choose, configure, or change the authentication mode on a FrontMCP server.
|
|
25
|
+
|
|
26
|
+
## Auth Modes Overview
|
|
27
|
+
|
|
28
|
+
| Mode | Use Case | Token Issuer |
|
|
29
|
+
| ------------- | ------------------------------------------ | ------------------- |
|
|
30
|
+
| `public` | Open access with optional scoping | None |
|
|
31
|
+
| `transparent` | Validate externally-issued JWTs | External provider |
|
|
32
|
+
| `local` | Server signs its own tokens | The FrontMCP server |
|
|
33
|
+
| `remote` | Full OAuth 2.1 flow with external provider | External provider |
|
|
34
|
+
|
|
35
|
+
## Mode 1: Public
|
|
36
|
+
|
|
37
|
+
Public mode allows all connections without authentication. Use this for development or open APIs where access control is handled elsewhere.
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
@App({
|
|
41
|
+
auth: {
|
|
42
|
+
mode: 'public',
|
|
43
|
+
sessionTtl: 3600,
|
|
44
|
+
anonymousScopes: ['read'],
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
class MyApp {}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- `sessionTtl` -- session lifetime in seconds.
|
|
51
|
+
- `anonymousScopes` -- scopes granted to all unauthenticated clients.
|
|
52
|
+
|
|
53
|
+
## Mode 2: Transparent
|
|
54
|
+
|
|
55
|
+
Transparent mode validates JWTs issued by an external provider without initiating an OAuth flow. The server fetches the provider's JWKS to verify token signatures.
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
@App({
|
|
59
|
+
auth: {
|
|
60
|
+
mode: 'transparent',
|
|
61
|
+
provider: 'https://auth.example.com',
|
|
62
|
+
expectedAudience: 'my-api',
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
class MyApp {}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- `provider` -- the authorization server URL. FrontMCP fetches JWKS from `{provider}/.well-known/jwks.json`.
|
|
69
|
+
- `expectedAudience` -- the `aud` claim value that tokens must contain.
|
|
70
|
+
|
|
71
|
+
Use transparent mode when clients already have tokens from your identity provider and the server only needs to verify them.
|
|
72
|
+
|
|
73
|
+
## Mode 3: Local
|
|
74
|
+
|
|
75
|
+
Local mode lets the FrontMCP server sign its own JWT tokens. This is useful for internal services or environments where an external identity provider is not available.
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
@App({
|
|
79
|
+
auth: {
|
|
80
|
+
mode: 'local',
|
|
81
|
+
local: {
|
|
82
|
+
issuer: 'my-server',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
})
|
|
86
|
+
class MyApp {}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- `local.issuer` -- the `iss` claim set in generated tokens (defaults to server URL if omitted).
|
|
90
|
+
|
|
91
|
+
The server generates a signing key pair on startup (or loads one from the configured key store). Clients obtain tokens through a server-provided endpoint.
|
|
92
|
+
|
|
93
|
+
## Mode 4: Remote
|
|
94
|
+
|
|
95
|
+
Remote mode performs a full OAuth 2.1 authorization flow with an external provider. Clients are redirected to the provider for authentication and return with an authorization code.
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
@App({
|
|
99
|
+
auth: {
|
|
100
|
+
mode: 'remote',
|
|
101
|
+
provider: 'https://auth.example.com',
|
|
102
|
+
clientId: 'xxx',
|
|
103
|
+
},
|
|
104
|
+
})
|
|
105
|
+
class MyApp {}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- `provider` -- the OAuth 2.1 authorization server URL.
|
|
109
|
+
- `clientId` -- the OAuth client identifier registered with the provider.
|
|
110
|
+
|
|
111
|
+
## OAuth Local Dev Flow
|
|
112
|
+
|
|
113
|
+
For local development with `remote` or `transparent` mode, you can skip the full OAuth flow by setting the environment to development:
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
@App({
|
|
117
|
+
auth: {
|
|
118
|
+
mode: 'remote',
|
|
119
|
+
provider: 'https://auth.example.com',
|
|
120
|
+
clientId: 'dev-client-id',
|
|
121
|
+
},
|
|
122
|
+
})
|
|
123
|
+
class MyApp {}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
When `NODE_ENV=development`, FrontMCP relaxes token validation to support local identity provider instances (e.g., a local Keycloak or mock OAuth server). Tokens are still validated, but HTTPS requirements and strict issuer checks are loosened.
|
|
127
|
+
|
|
128
|
+
## Multi-App Auth
|
|
129
|
+
|
|
130
|
+
Each `@App` in a FrontMCP server can have a different auth configuration. This is useful when a single server hosts multiple logical applications with different security requirements:
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
@App({
|
|
134
|
+
name: 'public-api',
|
|
135
|
+
auth: {
|
|
136
|
+
mode: 'public',
|
|
137
|
+
sessionTtl: 3600,
|
|
138
|
+
anonymousScopes: ['read'],
|
|
139
|
+
},
|
|
140
|
+
tools: [PublicSearchTool, PublicInfoTool],
|
|
141
|
+
})
|
|
142
|
+
class PublicApi {}
|
|
143
|
+
|
|
144
|
+
@App({
|
|
145
|
+
name: 'admin-api',
|
|
146
|
+
auth: {
|
|
147
|
+
mode: 'remote',
|
|
148
|
+
provider: 'https://auth.example.com',
|
|
149
|
+
clientId: 'admin-client',
|
|
150
|
+
},
|
|
151
|
+
tools: [AdminTool, ConfigTool],
|
|
152
|
+
})
|
|
153
|
+
class AdminApi {}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Credential Vault
|
|
157
|
+
|
|
158
|
+
The credential vault stores downstream API tokens obtained during the OAuth flow. Use it when your MCP tools need to call external APIs on behalf of the authenticated user. Credential vault is managed through the auth provider's OAuth flow — downstream tokens are stored automatically when users authorize external services.
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
@App({
|
|
162
|
+
name: 'MyApp',
|
|
163
|
+
auth: {
|
|
164
|
+
mode: 'remote',
|
|
165
|
+
provider: 'https://auth.example.com',
|
|
166
|
+
clientId: 'mcp-client-id',
|
|
167
|
+
},
|
|
168
|
+
})
|
|
169
|
+
class MyApp {}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Tools access downstream credentials via the `this.authProviders` context extension:
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
@Tool({ name: 'create_github_issue' })
|
|
176
|
+
class CreateGithubIssueTool extends ToolContext {
|
|
177
|
+
async execute(input: { title: string; body: string }) {
|
|
178
|
+
// Access downstream credentials via the authProviders context extension
|
|
179
|
+
const github = await this.authProviders.get('github');
|
|
180
|
+
const headers = await this.authProviders.headers('github');
|
|
181
|
+
// Use headers to call GitHub API
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
The `authProviders` accessor (from `@frontmcp/auth`) provides:
|
|
187
|
+
|
|
188
|
+
- `get(provider)` -- get the credential/token for a provider.
|
|
189
|
+
- `headers(provider)` -- get pre-formatted auth headers for HTTP requests.
|
|
190
|
+
- `has(provider)` -- check if a provider is configured.
|
|
191
|
+
- `refresh(provider)` -- force refresh the credential.
|
|
192
|
+
|
|
193
|
+
## Common Patterns
|
|
194
|
+
|
|
195
|
+
| Pattern | Correct | Incorrect | Why |
|
|
196
|
+
| --------------------------- | ------------------------------------------------------------------------------ | --------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
|
197
|
+
| Session store in production | Use Redis or Vercel KV session store | Use default in-memory session store | Sessions are lost on restart; in-memory does not survive process recycling |
|
|
198
|
+
| Secret management | Load `clientId`, vault secrets, and Redis passwords from environment variables | Hardcode secrets in source code | Hardcoded secrets leak into version control and are difficult to rotate |
|
|
199
|
+
| Audience validation | Always set `expectedAudience` in transparent/remote mode | Omit the audience field | Without audience validation, tokens issued for any audience would be accepted |
|
|
200
|
+
| Auth mode for development | Use `public` mode or local OAuth mock for dev environments | Use `remote` mode pointing at production IdP during development | Avoids accidental production token usage and simplifies local iteration |
|
|
201
|
+
| Vault encryption secret | Generate a strong random secret and store in env var `VAULT_SECRET` | Use a short or predictable string for vault encryption | Weak secrets compromise all stored downstream credentials |
|
|
202
|
+
|
|
203
|
+
## Verification Checklist
|
|
204
|
+
|
|
205
|
+
**Configuration**
|
|
206
|
+
|
|
207
|
+
- [ ] Auth mode is set to the correct value for the deployment target (`public`, `transparent`, `local`, or `remote`)
|
|
208
|
+
- [ ] `provider` URL is set when using `transparent` or `remote` mode
|
|
209
|
+
- [ ] `clientId` is configured when using `remote` mode
|
|
210
|
+
- [ ] `expectedAudience` is set when using `transparent` mode
|
|
211
|
+
|
|
212
|
+
**Security**
|
|
213
|
+
|
|
214
|
+
- [ ] No secrets are hardcoded in source files -- all loaded from environment variables
|
|
215
|
+
- [ ] Vault encryption secret is a strong random value
|
|
216
|
+
- [ ] Production deployments use Redis or Vercel KV for session storage, not in-memory
|
|
217
|
+
|
|
218
|
+
**Runtime**
|
|
219
|
+
|
|
220
|
+
- [ ] Server starts without auth-related errors in the console
|
|
221
|
+
- [ ] Tokens are validated correctly (test with a valid and an invalid token)
|
|
222
|
+
- [ ] Downstream credential vault returns tokens for configured providers
|
|
223
|
+
- [ ] Multi-app configurations route requests to the correct auth mode per app
|
|
224
|
+
|
|
225
|
+
## Troubleshooting
|
|
226
|
+
|
|
227
|
+
| Problem | Cause | Solution |
|
|
228
|
+
| --------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
229
|
+
| `JWKS fetch failed` error on startup | The `provider` URL is unreachable or does not serve `/.well-known/jwks.json` | Verify the provider URL is correct and accessible from the server; check network/firewall rules |
|
|
230
|
+
| Tokens rejected with `invalid audience` | The `expectedAudience` value does not match the `aud` claim in the token | Align the `expectedAudience` config with the audience value your identity provider sets in tokens |
|
|
231
|
+
| Sessions lost after server restart | Using the default in-memory session store in production | Switch to Redis or Vercel KV session store via `configure-session` reference |
|
|
232
|
+
| `VAULT_SECRET is not defined` error | The vault encryption secret environment variable is missing | Set `VAULT_SECRET` in your environment or `.env` file before starting the server |
|
|
233
|
+
| OAuth redirect fails in local dev | `remote` mode requires HTTPS and reachable callback URLs | Set `NODE_ENV=development` to relax HTTPS requirements, or use a local OAuth mock server |
|
|
234
|
+
|
|
235
|
+
## Reference
|
|
236
|
+
|
|
237
|
+
- Docs: [Authentication Overview](https://docs.agentfront.dev/frontmcp/authentication/overview)
|
|
238
|
+
- Related skills: `configure-session`, `create-plugin`
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Configuring Elicitation
|
|
2
|
+
|
|
3
|
+
Elicitation allows tools to request interactive input from users mid-execution — confirmations, choices, or structured form data.
|
|
4
|
+
|
|
5
|
+
## When to Use This Skill
|
|
6
|
+
|
|
7
|
+
### Must Use
|
|
8
|
+
|
|
9
|
+
- Tools need user confirmation before destructive actions (delete, deploy, overwrite)
|
|
10
|
+
- Building interactive multi-step workflows that require user decisions mid-execution
|
|
11
|
+
- Tools need structured form input from the user during execution (e.g., parameter selection, file choice)
|
|
12
|
+
|
|
13
|
+
### Recommended
|
|
14
|
+
|
|
15
|
+
- Adding a safety gate to tools that modify external systems (databases, APIs, deployments)
|
|
16
|
+
- Implementing approval flows where a tool must get explicit consent before proceeding
|
|
17
|
+
- Multi-instance production deployments where elicitation state must be shared via Redis
|
|
18
|
+
|
|
19
|
+
### Skip When
|
|
20
|
+
|
|
21
|
+
- Tools are fully autonomous and never need user input -- elicitation adds overhead when unused
|
|
22
|
+
- The MCP client does not support elicitation -- check client capabilities first (see Notes section)
|
|
23
|
+
- Only need input validation, not mid-execution prompts -- use Zod input schemas on the `@Tool` decorator
|
|
24
|
+
|
|
25
|
+
> **Decision:** Use this skill when tools need to pause execution and request interactive input from the user; skip if all tools run autonomously without user interaction.
|
|
26
|
+
|
|
27
|
+
## Enable Elicitation
|
|
28
|
+
|
|
29
|
+
### Basic (In-Memory)
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
@FrontMcp({
|
|
33
|
+
info: { name: 'my-server', version: '1.0.0' },
|
|
34
|
+
apps: [MyApp],
|
|
35
|
+
elicitation: {
|
|
36
|
+
enabled: true,
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
class Server {}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### With Redis (Distributed/Production)
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
@FrontMcp({
|
|
46
|
+
info: { name: 'my-server', version: '1.0.0' },
|
|
47
|
+
apps: [MyApp],
|
|
48
|
+
elicitation: {
|
|
49
|
+
enabled: true,
|
|
50
|
+
redis: { provider: 'redis', host: 'localhost', port: 6379 },
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
class Server {}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## ElicitationOptionsInput
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
interface ElicitationOptionsInput {
|
|
60
|
+
enabled?: boolean; // default: false
|
|
61
|
+
redis?: RedisOptionsInput; // storage for elicitation state
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Using Elicitation in Tools
|
|
66
|
+
|
|
67
|
+
When elicitation is enabled, tools can request user input via the MCP elicitation protocol:
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
71
|
+
import { z } from 'zod';
|
|
72
|
+
|
|
73
|
+
@Tool({
|
|
74
|
+
name: 'delete_records',
|
|
75
|
+
description: 'Delete records from the database',
|
|
76
|
+
inputSchema: {
|
|
77
|
+
table: z.string(),
|
|
78
|
+
filter: z.string(),
|
|
79
|
+
},
|
|
80
|
+
outputSchema: { deleted: z.number() },
|
|
81
|
+
})
|
|
82
|
+
class DeleteRecordsTool extends ToolContext {
|
|
83
|
+
async execute(input: { table: string; filter: string }) {
|
|
84
|
+
// Count records that would be deleted
|
|
85
|
+
const db = this.get(DB_TOKEN);
|
|
86
|
+
const count = await db.count(input.table, input.filter);
|
|
87
|
+
|
|
88
|
+
// Request confirmation from user before proceeding
|
|
89
|
+
const confirmation = await this.elicit({
|
|
90
|
+
message: `This will delete ${count} records from ${input.table}. Are you sure?`,
|
|
91
|
+
requestedSchema: {
|
|
92
|
+
type: 'object',
|
|
93
|
+
properties: {
|
|
94
|
+
confirmed: { type: 'boolean', description: 'Confirm deletion' },
|
|
95
|
+
},
|
|
96
|
+
required: ['confirmed'],
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
if (!confirmation || !confirmation.confirmed) {
|
|
101
|
+
return { deleted: 0 };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const deleted = await db.delete(input.table, input.filter);
|
|
105
|
+
return { deleted };
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## How It Works
|
|
111
|
+
|
|
112
|
+
1. Tool calls `this.elicit()` with a message and requested schema
|
|
113
|
+
2. Server sends an `elicitation/request` to the client
|
|
114
|
+
3. Client displays the request to the user (UI varies by client)
|
|
115
|
+
4. User responds with structured data matching the schema
|
|
116
|
+
5. `this.elicit()` returns the user's response
|
|
117
|
+
6. Tool continues execution with the response
|
|
118
|
+
|
|
119
|
+
## Notes
|
|
120
|
+
|
|
121
|
+
- When `enabled: false` (default), `this.elicit()` is not available — keeps resource overhead low
|
|
122
|
+
- When enabled, tool output schemas are automatically extended with elicitation fallback type
|
|
123
|
+
- Use Redis storage for production/multi-instance deployments
|
|
124
|
+
- Not all MCP clients support elicitation — handle gracefully when `this.elicit()` returns `undefined`
|
|
125
|
+
|
|
126
|
+
## Verification
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Enable elicitation and start
|
|
130
|
+
frontmcp dev
|
|
131
|
+
|
|
132
|
+
# Test with an MCP client that supports elicitation
|
|
133
|
+
# The tool should pause and request user input
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Common Patterns
|
|
137
|
+
|
|
138
|
+
| Pattern | Correct | Incorrect | Why |
|
|
139
|
+
| ---------------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
140
|
+
| Handling unsupported clients | Check `if (!confirmation)` after `this.elicit()` and provide a fallback | Assuming `this.elicit()` always returns a value | Not all MCP clients support elicitation; `undefined` is returned when the client cannot handle the request |
|
|
141
|
+
| Schema for confirmation | Use `{ confirmed: { type: 'boolean' } }` in `requestedSchema` | Using a plain string prompt without a schema | Structured schemas let the client render proper UI controls (checkboxes, dropdowns) instead of free-text input |
|
|
142
|
+
| Redis for production | Set `elicitation: { enabled: true, redis: { provider: 'redis', ... } }` | Using in-memory elicitation state in a multi-instance deployment | In-memory state is per-process; if the response arrives at a different instance, the elicitation context is lost |
|
|
143
|
+
| Enabled flag | Explicitly set `elicitation: { enabled: true }` | Omitting the `enabled` field and expecting elicitation to work | Elicitation is disabled by default (`enabled: false`) to minimize resource overhead |
|
|
144
|
+
|
|
145
|
+
## Verification Checklist
|
|
146
|
+
|
|
147
|
+
### Configuration
|
|
148
|
+
|
|
149
|
+
- [ ] `elicitation.enabled` is set to `true` in the `@FrontMcp` decorator
|
|
150
|
+
- [ ] For production/multi-instance: `elicitation.redis` is configured with a valid Redis provider
|
|
151
|
+
- [ ] The `requestedSchema` in `this.elicit()` calls uses valid JSON Schema objects
|
|
152
|
+
|
|
153
|
+
### Runtime
|
|
154
|
+
|
|
155
|
+
- [ ] Tool execution pauses when `this.elicit()` is called and the client supports elicitation
|
|
156
|
+
- [ ] The user sees a prompt or form matching the requested schema
|
|
157
|
+
- [ ] After the user responds, `this.elicit()` returns the structured data and the tool resumes
|
|
158
|
+
- [ ] When the client does not support elicitation, `this.elicit()` returns `undefined` and the tool handles the fallback gracefully
|
|
159
|
+
|
|
160
|
+
### Integration
|
|
161
|
+
|
|
162
|
+
- [ ] MCP client under test advertises elicitation support in its capabilities
|
|
163
|
+
- [ ] Destructive tools have elicitation-based confirmation gates before proceeding
|
|
164
|
+
|
|
165
|
+
## Troubleshooting
|
|
166
|
+
|
|
167
|
+
| Problem | Cause | Solution |
|
|
168
|
+
| ------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
169
|
+
| `this.elicit is not a function` | Elicitation is not enabled in the server configuration | Set `elicitation: { enabled: true }` in the `@FrontMcp` decorator |
|
|
170
|
+
| `this.elicit()` returns `undefined` immediately | The connected MCP client does not support elicitation | Check client capabilities; provide a fallback code path for unsupported clients |
|
|
171
|
+
| Elicitation works locally but fails in production | In-memory store loses state across multiple server instances | Configure `elicitation.redis` to share elicitation state via Redis |
|
|
172
|
+
| User sees raw JSON instead of a form | The MCP client renders the `requestedSchema` as raw data rather than a form | Use standard JSON Schema types (`boolean`, `string`, `enum`) that clients can render as UI controls |
|
|
173
|
+
| Tool hangs indefinitely waiting for user response | No timeout configured and user never responds | Implement a timeout or cancellation mechanism in the tool logic to handle non-responsive users |
|
|
174
|
+
|
|
175
|
+
## Reference
|
|
176
|
+
|
|
177
|
+
- [Elicitation Docs](https://docs.agentfront.dev/frontmcp/servers/elicitation)
|
|
178
|
+
- Related skills: `configure-http`, `configure-transport`, `setup-redis`, `create-tool`
|