@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.
Files changed (104) hide show
  1. package/README.md +2 -2
  2. package/catalog/TEMPLATE.md +58 -13
  3. package/catalog/frontmcp-config/SKILL.md +156 -0
  4. package/catalog/{auth/configure-auth/references/auth-modes.md → frontmcp-config/references/configure-auth-modes.md} +5 -0
  5. package/catalog/frontmcp-config/references/configure-auth.md +243 -0
  6. package/catalog/frontmcp-config/references/configure-elicitation.md +183 -0
  7. package/catalog/frontmcp-config/references/configure-http.md +210 -0
  8. package/catalog/frontmcp-config/references/configure-session.md +210 -0
  9. package/catalog/{config/configure-throttle/references/guard-config.md → frontmcp-config/references/configure-throttle-guard-config.md} +5 -0
  10. package/catalog/frontmcp-config/references/configure-throttle.md +234 -0
  11. package/catalog/{config/configure-transport/references/protocol-presets.md → frontmcp-config/references/configure-transport-protocol-presets.md} +5 -0
  12. package/catalog/frontmcp-config/references/configure-transport.md +200 -0
  13. package/catalog/frontmcp-config/references/setup-redis.md +9 -0
  14. package/catalog/frontmcp-config/references/setup-sqlite.md +9 -0
  15. package/catalog/frontmcp-deployment/SKILL.md +152 -0
  16. package/catalog/frontmcp-deployment/references/build-for-browser.md +143 -0
  17. package/catalog/frontmcp-deployment/references/build-for-cli.md +191 -0
  18. package/catalog/{deployment/build-for-sdk/SKILL.md → frontmcp-deployment/references/build-for-sdk.md} +66 -20
  19. package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +218 -0
  20. package/catalog/{deployment/deploy-to-lambda/SKILL.md → frontmcp-deployment/references/deploy-to-lambda.md} +77 -59
  21. package/catalog/{deployment/deploy-to-node/references/Dockerfile.example → frontmcp-deployment/references/deploy-to-node-dockerfile.md} +18 -4
  22. package/catalog/{deployment/deploy-to-node/SKILL.md → frontmcp-deployment/references/deploy-to-node.md} +69 -36
  23. package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +65 -0
  24. package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +229 -0
  25. package/catalog/frontmcp-development/SKILL.md +126 -0
  26. package/catalog/frontmcp-development/references/create-adapter.md +170 -0
  27. package/catalog/{development/create-agent/references/llm-config.md → frontmcp-development/references/create-agent-llm-config.md} +10 -5
  28. package/catalog/{development/create-agent/SKILL.md → frontmcp-development/references/create-agent.md} +83 -40
  29. package/catalog/{development/create-job/SKILL.md → frontmcp-development/references/create-job.md} +62 -15
  30. package/catalog/{plugins/create-plugin-hooks/SKILL.md → frontmcp-development/references/create-plugin-hooks.md} +100 -7
  31. package/catalog/frontmcp-development/references/create-plugin.md +506 -0
  32. package/catalog/{development/create-prompt/SKILL.md → frontmcp-development/references/create-prompt.md} +65 -22
  33. package/catalog/{development/create-provider/SKILL.md → frontmcp-development/references/create-provider.md} +63 -23
  34. package/catalog/{development/create-resource/SKILL.md → frontmcp-development/references/create-resource.md} +148 -26
  35. package/catalog/{development/create-skill-with-tools/SKILL.md → frontmcp-development/references/create-skill-with-tools.md} +174 -20
  36. package/catalog/{development/create-skill/SKILL.md → frontmcp-development/references/create-skill.md} +114 -28
  37. package/catalog/{development/create-tool/references/tool-annotations.md → frontmcp-development/references/create-tool-annotations.md} +5 -0
  38. package/catalog/{development/create-tool/references/output-schema-types.md → frontmcp-development/references/create-tool-output-schema-types.md} +5 -0
  39. package/catalog/{development/create-tool/SKILL.md → frontmcp-development/references/create-tool.md} +172 -23
  40. package/catalog/{development/create-workflow/SKILL.md → frontmcp-development/references/create-workflow.md} +61 -14
  41. package/catalog/frontmcp-development/references/decorators-guide.md +754 -0
  42. package/catalog/frontmcp-development/references/official-adapters.md +199 -0
  43. package/catalog/{plugins/official-plugins/SKILL.md → frontmcp-development/references/official-plugins.md} +97 -27
  44. package/catalog/frontmcp-extensibility/SKILL.md +103 -0
  45. package/catalog/frontmcp-extensibility/references/vectoriadb.md +289 -0
  46. package/catalog/frontmcp-guides/SKILL.md +420 -0
  47. package/catalog/frontmcp-guides/references/example-knowledge-base.md +641 -0
  48. package/catalog/frontmcp-guides/references/example-task-manager.md +517 -0
  49. package/catalog/frontmcp-guides/references/example-weather-api.md +297 -0
  50. package/catalog/frontmcp-production-readiness/SKILL.md +98 -0
  51. package/catalog/frontmcp-production-readiness/references/common-checklist.md +156 -0
  52. package/catalog/frontmcp-production-readiness/references/production-browser.md +46 -0
  53. package/catalog/frontmcp-production-readiness/references/production-cli-binary.md +62 -0
  54. package/catalog/frontmcp-production-readiness/references/production-cli-daemon.md +61 -0
  55. package/catalog/frontmcp-production-readiness/references/production-cloudflare.md +52 -0
  56. package/catalog/frontmcp-production-readiness/references/production-lambda.md +53 -0
  57. package/catalog/frontmcp-production-readiness/references/production-node-sdk.md +66 -0
  58. package/catalog/frontmcp-production-readiness/references/production-node-server.md +61 -0
  59. package/catalog/frontmcp-production-readiness/references/production-vercel.md +52 -0
  60. package/catalog/frontmcp-setup/SKILL.md +132 -0
  61. package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +280 -0
  62. package/catalog/{setup/multi-app-composition/SKILL.md → frontmcp-setup/references/multi-app-composition.md} +66 -19
  63. package/catalog/{setup/nx-workflow/SKILL.md → frontmcp-setup/references/nx-workflow.md} +79 -17
  64. package/catalog/frontmcp-setup/references/project-structure-nx.md +251 -0
  65. package/catalog/frontmcp-setup/references/project-structure-standalone.md +217 -0
  66. package/catalog/frontmcp-setup/references/readme-guide.md +226 -0
  67. package/catalog/{setup/setup-project/SKILL.md → frontmcp-setup/references/setup-project.md} +63 -58
  68. package/catalog/{setup/setup-redis/SKILL.md → frontmcp-setup/references/setup-redis.md} +60 -82
  69. package/catalog/{setup/setup-sqlite/SKILL.md → frontmcp-setup/references/setup-sqlite.md} +65 -72
  70. package/catalog/frontmcp-testing/SKILL.md +135 -0
  71. package/catalog/{testing/setup-testing/SKILL.md → frontmcp-testing/references/setup-testing.md} +79 -63
  72. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-auth.md +5 -0
  73. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-browser-build.md +5 -0
  74. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-cli-binary.md +5 -0
  75. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-direct-client.md +5 -0
  76. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-e2e-handler.md +5 -0
  77. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-tool-unit.md +6 -0
  78. package/catalog/skills-manifest.json +337 -382
  79. package/package.json +2 -2
  80. package/src/index.d.ts +1 -1
  81. package/src/index.js.map +1 -1
  82. package/src/loader.js +0 -1
  83. package/src/loader.js.map +1 -1
  84. package/src/manifest.d.ts +15 -3
  85. package/src/manifest.js +3 -3
  86. package/src/manifest.js.map +1 -1
  87. package/catalog/adapters/create-adapter/SKILL.md +0 -127
  88. package/catalog/adapters/official-adapters/SKILL.md +0 -136
  89. package/catalog/auth/configure-auth/SKILL.md +0 -250
  90. package/catalog/auth/configure-session/SKILL.md +0 -201
  91. package/catalog/config/configure-elicitation/SKILL.md +0 -136
  92. package/catalog/config/configure-http/SKILL.md +0 -167
  93. package/catalog/config/configure-throttle/SKILL.md +0 -189
  94. package/catalog/config/configure-transport/SKILL.md +0 -151
  95. package/catalog/deployment/build-for-browser/SKILL.md +0 -95
  96. package/catalog/deployment/build-for-cli/SKILL.md +0 -100
  97. package/catalog/deployment/deploy-to-cloudflare/SKILL.md +0 -192
  98. package/catalog/deployment/deploy-to-vercel/SKILL.md +0 -196
  99. package/catalog/deployment/deploy-to-vercel/references/vercel.json.example +0 -60
  100. package/catalog/development/decorators-guide/SKILL.md +0 -598
  101. package/catalog/plugins/create-plugin/SKILL.md +0 -336
  102. package/catalog/setup/frontmcp-skills-usage/SKILL.md +0 -200
  103. package/catalog/setup/project-structure-nx/SKILL.md +0 -186
  104. package/catalog/setup/project-structure-standalone/SKILL.md +0 -153
package/README.md CHANGED
@@ -39,14 +39,14 @@ export default class Server {}
39
39
 
40
40
  ## Installation
41
41
 
42
- **Node.js 22+** required (24 recommended).
42
+ **Node.js 24+** required.
43
43
 
44
44
  ```bash
45
45
  # New project (recommended)
46
46
  npx frontmcp create my-app
47
47
 
48
48
  # Existing project
49
- npm i -D frontmcp @types/node@^22
49
+ npm i -D frontmcp @types/node@^24
50
50
  npx frontmcp init
51
51
  ```
52
52
 
@@ -1,9 +1,10 @@
1
1
  ---
2
2
  name: skill-name
3
- description: Short description of what this skill does
4
- tags: [category, keyword]
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
- compatibility: Node.js 22+
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 Name
23
+ # Skill Title
20
24
 
21
- Brief description of the skill's purpose and when to use it.
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
- - List any prerequisites
26
- - Tools or packages needed
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
- ### Step 3: Verification
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
- How to verify the skill completed successfully.
87
+ | Problem | Cause | Solution |
88
+ | -------------------- | -------------- | ------------- |
89
+ | Common error message | Why it happens | How to fix it |
45
90
 
46
- ## Notes
91
+ ## Reference
47
92
 
48
- - Any important caveats or tips
49
- - Links to related documentation
93
+ - [Documentation](https://docs.agentfront.dev/frontmcp/...)
94
+ - Related skills: `related-skill-a`, `related-skill-b`
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: frontmcp-config
3
+ description: 'Use when you want to configure auth, set up CORS, add rate limiting, throttle requests, manage sessions, choose transport, set HTTP options, add authentication, configure JWT, or set up OAuth. The skill for server CONFIGURATION.'
4
+ tags: [router, config, transport, http, auth, session, redis, sqlite, throttle, guide]
5
+ category: config
6
+ targets: [all]
7
+ bundle: [recommended, full]
8
+ priority: 10
9
+ visibility: both
10
+ license: Apache-2.0
11
+ metadata:
12
+ docs: https://docs.agentfront.dev/frontmcp/configuration/overview
13
+ ---
14
+
15
+ # FrontMCP Configuration Router
16
+
17
+ 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.
18
+
19
+ ## When to Use This Skill
20
+
21
+ ### Must Use
22
+
23
+ - Setting up a new server and need to understand which configuration options exist
24
+ - Deciding between authentication modes, transport protocols, or storage backends
25
+ - Planning server configuration across transport, auth, throttling, and storage
26
+
27
+ ### Recommended
28
+
29
+ - Looking up which skill covers a specific config option (CORS, rate limits, session TTL, etc.)
30
+ - Understanding how configuration layers work (server-level vs app-level vs tool-level)
31
+ - Reviewing the full configuration surface area before production deployment
32
+
33
+ ### Skip When
34
+
35
+ - You already know which config area to change (go directly to `configure-transport`, `configure-auth`, etc.)
36
+ - You need to build components, not configure the server (see `frontmcp-development`)
37
+ - You need to deploy, not configure (see `frontmcp-deployment`)
38
+
39
+ > **Decision:** Use this skill when you need to figure out WHAT to configure. Use the specific skill when you already know.
40
+
41
+ ## Prerequisites
42
+
43
+ - A FrontMCP project scaffolded with `frontmcp create` (see `frontmcp-setup`)
44
+ - Node.js 24+ and npm/yarn installed
45
+
46
+ ## Steps
47
+
48
+ 1. Identify the configuration area you need using the Scenario Routing Table below
49
+ 2. Navigate to the specific configuration skill (e.g., `configure-transport`, `configure-auth`) for detailed instructions
50
+ 3. Apply the configuration in your `@FrontMcp` or `@App` decorator
51
+ 4. Verify using the Verification Checklist at the end of this skill
52
+
53
+ ## Scenario Routing Table
54
+
55
+ | Scenario | Skill | Description |
56
+ | -------------------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------- |
57
+ | Choose between SSE, Streamable HTTP, or stdio | `configure-transport` | Transport protocol selection with distributed session options |
58
+ | Set up CORS, port, base path, or request limits | `configure-http` | HTTP server options for Streamable HTTP and SSE transports |
59
+ | Add rate limiting, concurrency, or IP filtering | `configure-throttle` | Server-level and per-tool throttle configuration |
60
+ | Enable tools to ask users for input | `configure-elicitation` | Elicitation schemas, stores, and multi-step flows |
61
+ | Set up authentication (public, transparent, local, remote) | `configure-auth` | OAuth flows, credential vault, multi-app auth |
62
+ | Configure session storage backends | `configure-session` | Memory, Redis, Vercel KV, and custom session stores |
63
+ | Add Redis for production storage | `setup-redis` | Docker Redis, Vercel KV, pub/sub for subscriptions |
64
+ | Add SQLite for local development | `setup-sqlite` | SQLite with WAL mode, migration helpers |
65
+ | Understand auth mode details (public/transparent/local/remote) | `configure-auth-modes` | Authentication mode details (public, transparent, local, remote) |
66
+ | Fine-tune guard configuration for throttling | `configure-throttle-guard-config` | Advanced guard configuration for throttling |
67
+ | Use transport protocol presets | `configure-transport-protocol-presets` | Transport protocol preset configurations |
68
+ | Split apps into separate scopes (`splitByApp`) | `decorators-guide` | Per-app scope and basePath isolation on `@FrontMcp` |
69
+ | Enable widget-to-host communication (ext-apps) | `decorators-guide` | `extApps` host capabilities, session validation, widget comms |
70
+ | Enable background jobs and workflows | `decorators-guide` | `jobs: { enabled: true, store? }` on `@FrontMcp` |
71
+ | Configure pagination for list operations | `decorators-guide` | `pagination` defaults for `tools/list` endpoint |
72
+ | Configure npm/ESM package loader for remote apps | `decorators-guide` | `loader` config for `App.esm()` / `App.remote()` resolution |
73
+
74
+ ## Configuration Layers
75
+
76
+ FrontMCP configuration cascades through three layers:
77
+
78
+ ```text
79
+ Server (@FrontMcp) ← Global defaults
80
+ └── App (@App) ← App-level overrides
81
+ └── Tool (@Tool) ← Per-tool overrides
82
+ ```
83
+
84
+ | Setting | Server (`@FrontMcp`) | App (`@App`) | Tool (`@Tool`) |
85
+ | --------------------- | -------------------------------- | --------------------- | ------------------------------------------- |
86
+ | Transport | Yes | No | No |
87
+ | HTTP (CORS, port) | Yes | No | No |
88
+ | Throttle (rate limit) | Yes (`throttle` global defaults) | No | Yes (`rateLimit`, `concurrency`, `timeout`) |
89
+ | Auth mode | Yes | Yes (override) | No |
90
+ | Auth providers | No | Yes (`authProviders`) | Yes (`authProviders`) |
91
+ | Session store | Yes | No | No |
92
+ | Elicitation | Yes (enable: `elicitation`) | No | Yes (usage: `this.elicit()`) |
93
+ | ExtApps | Yes | No | No |
94
+ | Jobs / Workflows | Yes (`jobs: { enabled }`) | No | No |
95
+ | Pagination | Yes | No | No |
96
+ | SplitByApp | Yes | No | No |
97
+
98
+ ## Cross-Cutting Patterns
99
+
100
+ | Pattern | Rule |
101
+ | ------------------- | ------------------------------------------------------------------------------------------------- |
102
+ | Auth + session | Auth mode determines session requirements: `remote` needs Redis/KV; `public` can use memory |
103
+ | Transport + storage | Stateless transports (serverless) require distributed storage; stateful (Node) can use in-process |
104
+ | Throttle scope | Server-level throttle applies to all tools; per-tool throttle overrides for specific tools |
105
+ | Environment config | Use environment variables for all secrets (API keys, Redis URLs, OAuth credentials) |
106
+ | Config validation | FrontMCP validates config at startup; invalid config throws before the server starts |
107
+
108
+ ## Common Patterns
109
+
110
+ | Pattern | Correct | Incorrect | Why |
111
+ | -------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
112
+ | 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 |
113
+ | Session store | Redis for production, memory for development | Memory for production | Memory sessions are lost on restart and don't work across serverless invocations |
114
+ | 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 |
115
+ | CORS config | Explicit allowed origins in production | `cors: { origin: '*' }` in production | Wildcard CORS allows any origin to call your server |
116
+ | 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 |
117
+
118
+ ## Verification Checklist
119
+
120
+ ### Transport and HTTP
121
+
122
+ - [ ] Transport protocol configured and server starts without errors
123
+ - [ ] CORS allows expected origins (test with browser or curl)
124
+ - [ ] Port and base path accessible from client
125
+
126
+ ### Authentication
127
+
128
+ - [ ] Auth mode set appropriately for the environment (public/transparent for dev, remote for prod)
129
+ - [ ] OAuth credentials stored in environment variables, not source code
130
+ - [ ] Session store configured with appropriate backend (memory for dev, Redis for prod)
131
+
132
+ ### Throttle and Security
133
+
134
+ - [ ] Global rate limit configured to prevent abuse
135
+ - [ ] Expensive tools have per-tool throttle overrides
136
+ - [ ] IP allow/deny lists configured if needed
137
+
138
+ ### Storage
139
+
140
+ - [ ] Redis or SQLite configured and connectable
141
+ - [ ] Storage persists across server restarts (not memory in production)
142
+
143
+ ## Troubleshooting
144
+
145
+ | Problem | Cause | Solution |
146
+ | --------------------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
147
+ | 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 |
148
+ | CORS blocked in browser | Missing or incorrect CORS origin config | Add the client's origin to `http.cors.origin`; see `configure-http` |
149
+ | Rate limit too aggressive | Global limit applied to all tools | Add per-tool overrides for cheap tools with higher limits; see `configure-throttle` |
150
+ | Sessions lost on serverless | Using memory session store on stateless platform | Switch to Redis or Vercel KV; see `configure-session` |
151
+ | Auth callback fails | OAuth redirect URI mismatch | Ensure the callback URL in your OAuth provider matches `auth.callbackUrl`; see `configure-auth` |
152
+
153
+ ## Reference
154
+
155
+ - [Configuration Overview](https://docs.agentfront.dev/frontmcp/configuration/overview)
156
+ - Related skills: `configure-transport`, `configure-http`, `configure-throttle`, `configure-elicitation`, `configure-auth`, `configure-session`, `setup-redis`, `setup-sqlite`
@@ -1,3 +1,8 @@
1
+ ---
2
+ name: configure-auth-modes
3
+ description: Detailed comparison of public, transparent, remote, and managed auth modes
4
+ ---
5
+
1
6
  # Auth Modes Detailed Comparison
2
7
 
3
8
  ## Public Mode
@@ -0,0 +1,243 @@
1
+ ---
2
+ name: configure-auth
3
+ description: Set up authentication modes, credential vault, and OAuth flows for FrontMCP servers
4
+ ---
5
+
6
+ # Configure Authentication for FrontMCP
7
+
8
+ 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.
9
+
10
+ ## When to Use This Skill
11
+
12
+ ### Must Use
13
+
14
+ - Adding authentication to a new FrontMCP server for the first time
15
+ - Switching between auth modes (e.g., moving from `public` to `remote` for production)
16
+ - Configuring the credential vault to access downstream APIs on behalf of authenticated users
17
+
18
+ ### Recommended
19
+
20
+ - Setting up multi-app auth where different `@App` instances need different security postures
21
+ - Configuring OAuth local dev flow for development against `remote` or `transparent` modes
22
+ - Adding audience validation or session TTL tuning to an existing auth setup
23
+
24
+ ### Skip When
25
+
26
+ - You need to manage session storage backends (Redis, Vercel KV) -- use `configure-session` instead
27
+ - You are building a plugin that extends auth context -- use `create-plugin` instead
28
+
29
+ > **Decision:** Use this skill whenever you need to choose, configure, or change the authentication mode on a FrontMCP server.
30
+
31
+ ## Auth Modes Overview
32
+
33
+ | Mode | Use Case | Token Issuer |
34
+ | ------------- | ------------------------------------------ | ------------------- |
35
+ | `public` | Open access with optional scoping | None |
36
+ | `transparent` | Validate externally-issued JWTs | External provider |
37
+ | `local` | Server signs its own tokens | The FrontMCP server |
38
+ | `remote` | Full OAuth 2.1 flow with external provider | External provider |
39
+
40
+ ## Mode 1: Public
41
+
42
+ Public mode allows all connections without authentication. Use this for development or open APIs where access control is handled elsewhere.
43
+
44
+ ```typescript
45
+ @App({
46
+ auth: {
47
+ mode: 'public',
48
+ sessionTtl: 3600,
49
+ anonymousScopes: ['read'],
50
+ },
51
+ })
52
+ class MyApp {}
53
+ ```
54
+
55
+ - `sessionTtl` -- session lifetime in seconds.
56
+ - `anonymousScopes` -- scopes granted to all unauthenticated clients.
57
+
58
+ ## Mode 2: Transparent
59
+
60
+ 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.
61
+
62
+ ```typescript
63
+ @App({
64
+ auth: {
65
+ mode: 'transparent',
66
+ provider: 'https://auth.example.com',
67
+ expectedAudience: 'my-api',
68
+ },
69
+ })
70
+ class MyApp {}
71
+ ```
72
+
73
+ - `provider` -- the authorization server URL. FrontMCP fetches JWKS from `{provider}/.well-known/jwks.json`.
74
+ - `expectedAudience` -- the `aud` claim value that tokens must contain.
75
+
76
+ Use transparent mode when clients already have tokens from your identity provider and the server only needs to verify them.
77
+
78
+ ## Mode 3: Local
79
+
80
+ 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.
81
+
82
+ ```typescript
83
+ @App({
84
+ auth: {
85
+ mode: 'local',
86
+ local: {
87
+ issuer: 'my-server',
88
+ },
89
+ },
90
+ })
91
+ class MyApp {}
92
+ ```
93
+
94
+ - `local.issuer` -- the `iss` claim set in generated tokens (defaults to server URL if omitted).
95
+
96
+ 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.
97
+
98
+ ## Mode 4: Remote
99
+
100
+ 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.
101
+
102
+ ```typescript
103
+ @App({
104
+ auth: {
105
+ mode: 'remote',
106
+ provider: 'https://auth.example.com',
107
+ clientId: 'xxx',
108
+ },
109
+ })
110
+ class MyApp {}
111
+ ```
112
+
113
+ - `provider` -- the OAuth 2.1 authorization server URL.
114
+ - `clientId` -- the OAuth client identifier registered with the provider.
115
+
116
+ ## OAuth Local Dev Flow
117
+
118
+ For local development with `remote` or `transparent` mode, you can skip the full OAuth flow by setting the environment to development:
119
+
120
+ ```typescript
121
+ @App({
122
+ auth: {
123
+ mode: 'remote',
124
+ provider: 'https://auth.example.com',
125
+ clientId: 'dev-client-id',
126
+ },
127
+ })
128
+ class MyApp {}
129
+ ```
130
+
131
+ 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.
132
+
133
+ ## Multi-App Auth
134
+
135
+ 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:
136
+
137
+ ```typescript
138
+ @App({
139
+ name: 'public-api',
140
+ auth: {
141
+ mode: 'public',
142
+ sessionTtl: 3600,
143
+ anonymousScopes: ['read'],
144
+ },
145
+ tools: [PublicSearchTool, PublicInfoTool],
146
+ })
147
+ class PublicApi {}
148
+
149
+ @App({
150
+ name: 'admin-api',
151
+ auth: {
152
+ mode: 'remote',
153
+ provider: 'https://auth.example.com',
154
+ clientId: 'admin-client',
155
+ },
156
+ tools: [AdminTool, ConfigTool],
157
+ })
158
+ class AdminApi {}
159
+ ```
160
+
161
+ ## Credential Vault
162
+
163
+ 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.
164
+
165
+ ```typescript
166
+ @App({
167
+ name: 'MyApp',
168
+ auth: {
169
+ mode: 'remote',
170
+ provider: 'https://auth.example.com',
171
+ clientId: 'mcp-client-id',
172
+ },
173
+ })
174
+ class MyApp {}
175
+ ```
176
+
177
+ Tools access downstream credentials via the `this.authProviders` context extension:
178
+
179
+ ```typescript
180
+ @Tool({ name: 'create_github_issue' })
181
+ class CreateGithubIssueTool extends ToolContext {
182
+ async execute(input: { title: string; body: string }) {
183
+ // Access downstream credentials via the authProviders context extension
184
+ const github = await this.authProviders.get('github');
185
+ const headers = await this.authProviders.headers('github');
186
+ // Use headers to call GitHub API
187
+ }
188
+ }
189
+ ```
190
+
191
+ The `authProviders` accessor (from `@frontmcp/auth`) provides:
192
+
193
+ - `get(provider)` -- get the credential/token for a provider.
194
+ - `headers(provider)` -- get pre-formatted auth headers for HTTP requests.
195
+ - `has(provider)` -- check if a provider is configured.
196
+ - `refresh(provider)` -- force refresh the credential.
197
+
198
+ ## Common Patterns
199
+
200
+ | Pattern | Correct | Incorrect | Why |
201
+ | --------------------------- | ------------------------------------------------------------------------------ | --------------------------------------------------------------- | ----------------------------------------------------------------------------- |
202
+ | 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 |
203
+ | 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 |
204
+ | Audience validation | Always set `expectedAudience` in transparent/remote mode | Omit the audience field | Without audience validation, tokens issued for any audience would be accepted |
205
+ | 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 |
206
+ | 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 |
207
+
208
+ ## Verification Checklist
209
+
210
+ **Configuration**
211
+
212
+ - [ ] Auth mode is set to the correct value for the deployment target (`public`, `transparent`, `local`, or `remote`)
213
+ - [ ] `provider` URL is set when using `transparent` or `remote` mode
214
+ - [ ] `clientId` is configured when using `remote` mode
215
+ - [ ] `expectedAudience` is set when using `transparent` mode
216
+
217
+ **Security**
218
+
219
+ - [ ] No secrets are hardcoded in source files -- all loaded from environment variables
220
+ - [ ] Vault encryption secret is a strong random value
221
+ - [ ] Production deployments use Redis or Vercel KV for session storage, not in-memory
222
+
223
+ **Runtime**
224
+
225
+ - [ ] Server starts without auth-related errors in the console
226
+ - [ ] Tokens are validated correctly (test with a valid and an invalid token)
227
+ - [ ] Downstream credential vault returns tokens for configured providers
228
+ - [ ] Multi-app configurations route requests to the correct auth mode per app
229
+
230
+ ## Troubleshooting
231
+
232
+ | Problem | Cause | Solution |
233
+ | --------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
234
+ | `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 |
235
+ | 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 |
236
+ | 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 |
237
+ | `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 |
238
+ | 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 |
239
+
240
+ ## Reference
241
+
242
+ - Docs: [Authentication Overview](https://docs.agentfront.dev/frontmcp/authentication/overview)
243
+ - Related skills: `configure-session`, `create-plugin`