@prmichaelsen/mcp-auth 7.0.3 → 7.0.4

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 (2) hide show
  1. package/README.md +41 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -150,6 +150,47 @@ const tokenResolver = new JWTTokenResolver({ authProvider });
150
150
  - ❌ Larger JWT size
151
151
  - ❌ Tokens exposed in JWT payload
152
152
 
153
+ ### JWTAuthProvider (Static Servers) ⭐ NEW
154
+
155
+ For servers that manage their own data and only need user identification:
156
+
157
+ ```typescript
158
+ import { wrapServer, JWTAuthProvider } from '@prmichaelsen/mcp-auth';
159
+
160
+ const wrapped = wrapServer({
161
+ serverFactory: (accessToken, userId) => {
162
+ // accessToken will be empty string - use userId only
163
+ return createMyStaticServer(userId);
164
+ },
165
+
166
+ authProvider: new JWTAuthProvider({
167
+ jwtSecret: process.env.JWT_SECRET
168
+ }),
169
+
170
+ // No tokenResolver needed! ✨
171
+
172
+ resourceType: 'my-service',
173
+ transport: {
174
+ type: 'sse',
175
+ port: 3000,
176
+ cors: true,
177
+ corsOrigin: process.env.CORS_ORIGIN
178
+ }
179
+ });
180
+ ```
181
+
182
+ **Perfect for:**
183
+ - ✅ Multi-tenant SaaS with own database
184
+ - ✅ User-scoped services
185
+ - ✅ Internal tools without external APIs
186
+ - ✅ Static data management servers
187
+
188
+ **Benefits:**
189
+ - ✅ Simplest configuration
190
+ - ✅ No external credential management
191
+ - ✅ JWT validation only (userId extraction)
192
+ - ✅ Complete user isolation via ephemeral instances
193
+
153
194
  ### APITokenResolver (API-Based)
154
195
 
155
196
  For resolving tokens via tenant manager API:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prmichaelsen/mcp-auth",
3
- "version": "7.0.3",
3
+ "version": "7.0.4",
4
4
  "description": "Authentication and multi-tenancy framework for MCP servers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",