@enfyra/mcp-server 0.0.79 → 0.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/package.json +1 -1
- package/src/lib/mcp-examples.js +21 -0
package/README.md
CHANGED
|
@@ -219,6 +219,16 @@ When an LLM builds a Nuxt, Next, or other SSR frontend for Enfyra, follow the sa
|
|
|
219
219
|
- Socket.IO browser clients use a same-origin bridge too. Connect to the namespace, e.g. `io("/chat", { path: "/socket.io", withCredentials: true })`, and proxy `/socket.io/**` to the Enfyra app bridge `/ws/socket.io/**`. The backend gateway metadata path remains `/chat`.
|
|
220
220
|
- Use token-query OAuth callback pages only for non-SSR/manual-token apps.
|
|
221
221
|
|
|
222
|
+
### OAuth provider setup checklist
|
|
223
|
+
|
|
224
|
+
OAuth provider setup has three distinct URLs:
|
|
225
|
+
|
|
226
|
+
- Provider callback URL: Enfyra handles this at `{ENFYRA_API_URL}/auth/{provider}/callback`. If the app proxy base is `http://localhost:3000/api`, the Google callback URL is `http://localhost:3000/api/auth/google/callback`.
|
|
227
|
+
- Enfyra OAuth config: `oauth_config_definition.redirectUri` must exactly match the provider callback URL registered in Google, Facebook, or GitHub. The same row stores the provider client id/secret and enabled state.
|
|
228
|
+
- App return URL: the frontend sends this as the `redirect` query when starting OAuth, for example `/enfyra/auth/google?redirect=https%3A%2F%2Fapp.example.com%2Fchat&cookieBridgePrefix=/enfyra`.
|
|
229
|
+
|
|
230
|
+
Do not confuse `redirectUri` with `redirect`. `redirectUri` is the provider-to-Enfyra callback. `redirect` is where Enfyra sends the browser after cookies are set. `appCallbackUrl` is only for manual-token apps that intentionally read token query parameters instead of using proxy-owned cookies.
|
|
231
|
+
|
|
222
232
|
---
|
|
223
233
|
|
|
224
234
|
## Tools (summary)
|
package/package.json
CHANGED
package/src/lib/mcp-examples.js
CHANGED
|
@@ -153,6 +153,26 @@ onUnmounted(() => {
|
|
|
153
153
|
'Disconnect the singleton socket when the current user/session clears.',
|
|
154
154
|
],
|
|
155
155
|
},
|
|
156
|
+
{
|
|
157
|
+
name: 'OAuth provider setup values',
|
|
158
|
+
code: `// Enfyra OAuth config row, stored in oauth_config_definition.
|
|
159
|
+
{
|
|
160
|
+
"provider": "google",
|
|
161
|
+
"clientId": "<google-client-id>",
|
|
162
|
+
"clientSecret": "<google-client-secret>",
|
|
163
|
+
"redirectUri": "http://localhost:3000/api/auth/google/callback",
|
|
164
|
+
"isEnabled": true
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Google Cloud Console -> Authorized redirect URIs:
|
|
168
|
+
// http://localhost:3000/api/auth/google/callback`,
|
|
169
|
+
notes: [
|
|
170
|
+
'redirectUri is the Enfyra callback URL: {ENFYRA_API_URL}/auth/google/callback.',
|
|
171
|
+
'The provider console callback URL and oauth_config_definition.redirectUri must match exactly.',
|
|
172
|
+
'This callback URL is not the app return page; the app return page is sent as the redirect query when starting OAuth.',
|
|
173
|
+
'Use appCallbackUrl only for manual-token apps that intentionally read token query parameters.',
|
|
174
|
+
],
|
|
175
|
+
},
|
|
156
176
|
{
|
|
157
177
|
name: 'Google OAuth button',
|
|
158
178
|
code: `const redirect = new URL("/chat", window.location.origin)
|
|
@@ -164,6 +184,7 @@ window.location.href = url.toString()`,
|
|
|
164
184
|
'redirect must be absolute and must include the app origin.',
|
|
165
185
|
'cookieBridgePrefix is the app proxy prefix that forwards to Enfyra API routes.',
|
|
166
186
|
'Enfyra redirects through {redirect.origin}{cookieBridgePrefix}/auth/set-cookies before returning to redirect.',
|
|
187
|
+
'After returning, call /enfyra/me to load the authenticated user; do not parse tokens from the URL in proxy-cookie mode.',
|
|
167
188
|
],
|
|
168
189
|
},
|
|
169
190
|
],
|