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

Function toolkitSlugFromRequest

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

Source from the content-addressed store, hash-verified

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