MCPcopy Create free account
hub / github.com/modelcontextprotocol/mcpb / loadServer

Function loadServer

examples/file-system-node/server/index.js:12–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11// Use dynamic require since we need CommonJS compatibility
12const loadServer = async () => {
13 try {
14 // Save original argv
15 const originalArgv = process.argv;
16
17 // The filesystem server expects directories as command line arguments
18 process.argv = [process.argv[0], process.argv[1], ...args];
19
20 // Dynamically import the ESM module
21 await import("@modelcontextprotocol/server-filesystem/dist/index.js");
22
23 // Restore original argv
24 process.argv = originalArgv;
25 } catch (error) {
26 console.error(
27 "Failed to load @modelcontextprotocol/server-filesystem:",
28 error,
29 );
30 process.exit(1);
31 }
32};
33
34// Execute the async function
35loadServer();

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…