MCPcopy
hub / github.com/subquery/subql / getMCPWorkingDirectory

Function getMCPWorkingDirectory

packages/cli/src/adapters/utils.ts:457–467  ·  view source on GitHub ↗
(server: McpServer)

Source from the content-addressed store, hash-verified

455};
456
457export async function getMCPWorkingDirectory(server: McpServer): Promise<string> {
458 const {roots} = await server.server.listRoots();
459
460 for (const root of roots) {
461 if (root.uri.startsWith('file://')) {
462 return path.resolve(root.uri.replace('file://', ''));
463 }
464 }
465
466 throw new Error('No valid working directory found in MCP roots.');
467}

Calls

no outgoing calls

Tested by

no test coverage detected