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

Function resourceFromPath

apps/cloud/src/mcp/agent-handler.ts:115–121  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

113// selector but keeps the toolkit segment), so a session minted on a toolkit path
114// scopes its tool catalog to that toolkit.
115const resourceFromPath = (request: Request): McpResource => {
116 const segments = new URL(request.url).pathname.split("/").filter((s) => s.length > 0);
117 if (segments.length === 3 && segments[0] === "mcp" && segments[1] === "toolkits" && segments[2]) {
118 return { kind: "toolkit", slug: segments[2] };
119 }
120 return defaultMcpResource;
121};
122
123const propsForPrincipal = (
124 request: Request,

Callers 1

makeCloudMcpAgentHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected