@kadoa/mcp 0.2.2 → 0.2.3
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/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -53217,13 +53217,12 @@ class KadoaOAuthProvider {
|
|
|
53217
53217
|
params,
|
|
53218
53218
|
supabaseCodeVerifier: verifier
|
|
53219
53219
|
});
|
|
53220
|
-
const redirectTo = `${serverUrl}/auth/callback`;
|
|
53220
|
+
const redirectTo = `${serverUrl}/auth/callback?mcp_state=${state}`;
|
|
53221
53221
|
const authUrl = new URL(`${supabaseUrl}/auth/v1/authorize`);
|
|
53222
53222
|
authUrl.searchParams.set("provider", "google");
|
|
53223
53223
|
authUrl.searchParams.set("redirect_to", redirectTo);
|
|
53224
53224
|
authUrl.searchParams.set("code_challenge", challenge);
|
|
53225
53225
|
authUrl.searchParams.set("code_challenge_method", "S256");
|
|
53226
|
-
authUrl.searchParams.set("state", state);
|
|
53227
53226
|
res.redirect(authUrl.toString());
|
|
53228
53227
|
}
|
|
53229
53228
|
async challengeForAuthorizationCode(_client, authorizationCode) {
|
|
@@ -53313,9 +53312,9 @@ class KadoaOAuthProvider {
|
|
|
53313
53312
|
};
|
|
53314
53313
|
}
|
|
53315
53314
|
async handleAuthCallback(req, res) {
|
|
53316
|
-
const { code, state } = req.query;
|
|
53315
|
+
const { code, mcp_state: state } = req.query;
|
|
53317
53316
|
if (!code || !state) {
|
|
53318
|
-
res.status(400).send("Missing code or
|
|
53317
|
+
res.status(400).send("Missing code or mcp_state parameter");
|
|
53319
53318
|
return;
|
|
53320
53319
|
}
|
|
53321
53320
|
const pending = pendingAuths.get(state);
|
|
@@ -53389,6 +53388,7 @@ function resolveApiKey3(req) {
|
|
|
53389
53388
|
async function startHttpServer() {
|
|
53390
53389
|
const port = parseInt(process.env.PORT || "3000", 10);
|
|
53391
53390
|
const app = createMcpExpressApp({ host: "0.0.0.0" });
|
|
53391
|
+
app.set("trust proxy", 1);
|
|
53392
53392
|
const sessions = {};
|
|
53393
53393
|
const provider = new KadoaOAuthProvider;
|
|
53394
53394
|
const serverUrl = process.env.MCP_SERVER_URL || `http://localhost:${port}`;
|