()
| 10 | |
| 11 | // Use dynamic require since we need CommonJS compatibility |
| 12 | const 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 |
| 35 | loadServer(); |
no outgoing calls
no test coverage detected
searching dependent graphs…