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

Function toolkitSlugFromRequest

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

Source from the content-addressed store, hash-verified

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

Callers 3

mcpResourcePathForFunction · 0.70
resourceMetadataUrlForFunction · 0.70

Calls 1

effectivePathnameForFunction · 0.85

Tested by

no test coverage detected