yt-transcript-strapi-plugin 0.1.1 → 0.1.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/server/index.js +3 -14
- package/dist/server/index.mjs +3 -14
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -855,21 +855,11 @@ const bootstrap = async ({ strapi }) => {
|
|
|
855
855
|
plugin.sessions = /* @__PURE__ */ new Map();
|
|
856
856
|
const oauthPlugin = strapi.plugin(OAUTH_PLUGIN_ID);
|
|
857
857
|
if (oauthPlugin) {
|
|
858
|
-
|
|
859
|
-
await oauthPlugin.service("endpoint").register({
|
|
860
|
-
name: "YouTube Transcript MCP",
|
|
861
|
-
pluginId: PLUGIN_ID,
|
|
862
|
-
path: `/api/${PLUGIN_ID}/mcp`,
|
|
863
|
-
description: "MCP endpoint for YouTube transcript tools"
|
|
864
|
-
});
|
|
865
|
-
strapi.log.info(`[${PLUGIN_ID}] Registered with OAuth plugin - supports OAuth + API tokens`);
|
|
866
|
-
} catch (error) {
|
|
867
|
-
strapi.log.error(`[${PLUGIN_ID}] Failed to register with OAuth plugin`, { error });
|
|
868
|
-
}
|
|
858
|
+
strapi.log.info(`[${PLUGIN_ID}] OAuth manager detected - OAuth + API token auth enabled`);
|
|
869
859
|
} else {
|
|
870
860
|
const fallbackMiddleware = createFallbackAuthMiddleware();
|
|
871
861
|
strapi.server.use(fallbackMiddleware);
|
|
872
|
-
strapi.log.info(`[${PLUGIN_ID}] Using API token authentication (OAuth
|
|
862
|
+
strapi.log.info(`[${PLUGIN_ID}] Using API token authentication (OAuth manager not installed)`);
|
|
873
863
|
}
|
|
874
864
|
strapi.log.info(`[${PLUGIN_ID}] MCP endpoint available at: /api/${PLUGIN_ID}/mcp`);
|
|
875
865
|
};
|
|
@@ -1011,7 +1001,6 @@ const mcpController = ({ strapi }) => ({
|
|
|
1011
1001
|
};
|
|
1012
1002
|
return;
|
|
1013
1003
|
}
|
|
1014
|
-
const strapiToken = ctx.state.strapiToken;
|
|
1015
1004
|
if (Math.random() < 0.01) {
|
|
1016
1005
|
cleanupExpiredSessions(plugin, strapi);
|
|
1017
1006
|
}
|
|
@@ -1046,7 +1035,7 @@ const mcpController = ({ strapi }) => ({
|
|
|
1046
1035
|
sessionIdGenerator: () => sessionId
|
|
1047
1036
|
});
|
|
1048
1037
|
await server.connect(transport);
|
|
1049
|
-
session = { server, transport, createdAt: Date.now(), strapiToken };
|
|
1038
|
+
session = { server, transport, createdAt: Date.now(), strapiToken: ctx.state.strapiToken };
|
|
1050
1039
|
plugin.sessions.set(sessionId, session);
|
|
1051
1040
|
strapi.log.debug(`[yt-transcript-mcp] New session created: ${sessionId} (auth: ${ctx.state.authMethod})`);
|
|
1052
1041
|
}
|
package/dist/server/index.mjs
CHANGED
|
@@ -854,21 +854,11 @@ const bootstrap = async ({ strapi }) => {
|
|
|
854
854
|
plugin.sessions = /* @__PURE__ */ new Map();
|
|
855
855
|
const oauthPlugin = strapi.plugin(OAUTH_PLUGIN_ID);
|
|
856
856
|
if (oauthPlugin) {
|
|
857
|
-
|
|
858
|
-
await oauthPlugin.service("endpoint").register({
|
|
859
|
-
name: "YouTube Transcript MCP",
|
|
860
|
-
pluginId: PLUGIN_ID,
|
|
861
|
-
path: `/api/${PLUGIN_ID}/mcp`,
|
|
862
|
-
description: "MCP endpoint for YouTube transcript tools"
|
|
863
|
-
});
|
|
864
|
-
strapi.log.info(`[${PLUGIN_ID}] Registered with OAuth plugin - supports OAuth + API tokens`);
|
|
865
|
-
} catch (error) {
|
|
866
|
-
strapi.log.error(`[${PLUGIN_ID}] Failed to register with OAuth plugin`, { error });
|
|
867
|
-
}
|
|
857
|
+
strapi.log.info(`[${PLUGIN_ID}] OAuth manager detected - OAuth + API token auth enabled`);
|
|
868
858
|
} else {
|
|
869
859
|
const fallbackMiddleware = createFallbackAuthMiddleware();
|
|
870
860
|
strapi.server.use(fallbackMiddleware);
|
|
871
|
-
strapi.log.info(`[${PLUGIN_ID}] Using API token authentication (OAuth
|
|
861
|
+
strapi.log.info(`[${PLUGIN_ID}] Using API token authentication (OAuth manager not installed)`);
|
|
872
862
|
}
|
|
873
863
|
strapi.log.info(`[${PLUGIN_ID}] MCP endpoint available at: /api/${PLUGIN_ID}/mcp`);
|
|
874
864
|
};
|
|
@@ -1010,7 +1000,6 @@ const mcpController = ({ strapi }) => ({
|
|
|
1010
1000
|
};
|
|
1011
1001
|
return;
|
|
1012
1002
|
}
|
|
1013
|
-
const strapiToken = ctx.state.strapiToken;
|
|
1014
1003
|
if (Math.random() < 0.01) {
|
|
1015
1004
|
cleanupExpiredSessions(plugin, strapi);
|
|
1016
1005
|
}
|
|
@@ -1045,7 +1034,7 @@ const mcpController = ({ strapi }) => ({
|
|
|
1045
1034
|
sessionIdGenerator: () => sessionId
|
|
1046
1035
|
});
|
|
1047
1036
|
await server.connect(transport);
|
|
1048
|
-
session = { server, transport, createdAt: Date.now(), strapiToken };
|
|
1037
|
+
session = { server, transport, createdAt: Date.now(), strapiToken: ctx.state.strapiToken };
|
|
1049
1038
|
plugin.sessions.set(sessionId, session);
|
|
1050
1039
|
strapi.log.debug(`[yt-transcript-mcp] New session created: ${sessionId} (auth: ${ctx.state.authMethod})`);
|
|
1051
1040
|
}
|
package/package.json
CHANGED