Refactor config loading (completed)

This commit is contained in:
2025-07-15 10:54:13 -05:00
parent 4b2d63335a
commit 90df726b47
14 changed files with 53 additions and 1363 deletions

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env node
import { Logger } from './utils/logger.util.js';
import configLoader from './config/config-loader.js';
import { runCli } from './cli/index.js';
import { stdioTransport } from './server/stdio.js';
import { streamableHttpTransport } from './server/streamableHttp.js';
@@ -43,18 +42,9 @@ export async function startServer(): Promise<void> {
* Main entry point
*/
async function main() {
const mainLogger = Logger.forContext('index.ts', 'main');
// Load configuration
configLoader.load();
// CLI mode - if any arguments are provided
if (process.argv.length > 2) {
mainLogger.info('CLI mode detected');
await runCli(process.argv.slice(2));
return;
}
// Server mode - determine transport and start server
await startServer();
}