MCPcopy Index your code
hub / github.com/PaystackOSS/paystack-mcp-server / main

Function main

src/index.ts:35–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33}
34
35async function main() {
36 // Handle help flag
37 if (process.argv.includes('--help') || process.argv.includes('-h')) {
38 showHelp();
39 process.exit(0);
40 }
41
42 const { startServer } = await import('./server');
43
44 // Parse API key from CLI
45 const cliApiKey = parseApiKey();
46
47 // Check if we have an API key from CLI or environment
48 if (!cliApiKey && !process.env.PAYSTACK_TEST_SECRET_KEY) {
49 console.error('Error: Paystack API key required.');
50 console.error(
51 'Provide via --api-key argument or PAYSTACK_TEST_SECRET_KEY environment variable.',
52 );
53 showHelp();
54 process.exit(1);
55 }
56
57 await startServer(cliApiKey);
58}
59
60main().catch((error) => {
61 console.error('Fatal error in main():', error);

Callers 1

index.tsFile · 0.85

Calls 4

showHelpFunction · 0.85
parseApiKeyFunction · 0.85
startServerFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected