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

Function toolkitSlugFromRequest

apps/host-selfhost/src/mcp/auth.ts:99–105  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

97 originalOrgScopedPathFor(request) ?? new URL(request.url).pathname;
98
99const toolkitSlugFromRequest = (request: Request): string | null => {
100 const pathname = effectivePathnameFor(request);
101 const index = pathname.indexOf(TOOLKIT_MCP_SEGMENT);
102 if (index < 0) return null;
103 const slug = pathname.slice(index + TOOLKIT_MCP_SEGMENT.length).split("/", 1)[0];
104 return slug && slug.length > 0 ? slug : null;
105};
106
107const mcpResourcePathFor = (request: Request): string => {
108 const orgScoped = originalOrgScopedPathFor(request);

Callers 3

mcpResourcePathForFunction · 0.70
resourceMetadataUrlForFunction · 0.70

Calls 1

effectivePathnameForFunction · 0.85

Tested by

no test coverage detected