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

Function mcpResourceFromPath

apps/host-cloudflare/src/mcp/resource.ts:3–8  ·  view source on GitHub ↗
(pathname: string)

Source from the content-addressed store, hash-verified

1import { defaultMcpResource, type McpResource } from "@executor-js/host-mcp";
2
3export const mcpResourceFromPath = (pathname: string): McpResource | null => {
4 if (pathname === "/mcp") return defaultMcpResource;
5
6 const toolkitMatch = /^\/mcp\/toolkits\/([^/]+)$/.exec(pathname);
7 return toolkitMatch?.[1] ? { kind: "toolkit", slug: toolkitMatch[1] } : null;
8};

Callers 3

worker.tsFile · 0.90
resource.test.tsFile · 0.90

Calls 1

execMethod · 0.80

Tested by

no test coverage detected