MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / toolkitSlugFromRequest

Function toolkitSlugFromRequest

apps/cloud/src/mcp/auth.ts:73–79  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

71
72/** The toolkit slug selected by `/mcp/toolkits/:slug` or its metadata doc. */
73export const toolkitSlugFromRequest = (request: Request): string | null => {
74 const pathname = new URL(request.url).pathname;
75 const index = pathname.indexOf(TOOLKIT_SEGMENT);
76 if (index < 0) return null;
77 const slug = pathname.slice(index + TOOLKIT_SEGMENT.length).split("/", 1)[0];
78 return slug && slug.length > 0 ? slug : null;
79};
80
81const toolkitMcpPath = (toolkitSlug: string | null): string =>
82 toolkitSlug ? `${MCP_PATH}/toolkits/${toolkitSlug}` : MCP_PATH;

Callers 4

auth-provider.tsFile · 0.90
resourceMetadataUrlFunction · 0.90
toOutcomeFunction · 0.90
mount.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected