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

Function isMcpServingPath

apps/host-selfhost/src/mcp/org-path.ts:80–85  ·  view source on GitHub ↗
(pathname: string)

Source from the content-addressed store, hash-verified

78 * reject HEAD explicitly before the SPA's GET/HEAD fallback can claim it.
79 */
80export const isMcpServingPath = (pathname: string): boolean => {
81 const routed = stripMcpOrgSegment(pathname) ?? pathname;
82 if (routed === "/mcp" || routed === "/mcp/") return true;
83 const segments = routed.split("/").filter((segment) => segment.length > 0);
84 return segments.length === 3 && segments[0] === "mcp" && segments[1] === "toolkits";
85};
86
87/**
88 * Given a recognized original pathname (a `MCP_ORIGINAL_PATH_HEADER` value —

Callers 2

selfHostHttpMiddlewareFunction · 0.90
org-path.test.tsFile · 0.90

Calls 1

stripMcpOrgSegmentFunction · 0.85

Tested by

no test coverage detected