• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mongodb-js / mongodb-mcp-server / 16804813849

07 Aug 2025 12:43PM UTC coverage: 81.062% (-0.2%) from 81.276%
16804813849

Pull #428

github

web-flow
Merge ad8e8223d into 42837a410
Pull Request #428: chore: enable typescript-eslint/explicit-function-return-type

655 of 849 branches covered (77.15%)

Branch coverage included in aggregate %.

24 of 27 new or added lines in 13 files covered. (88.89%)

8 existing lines in 1 file now uncovered.

3514 of 4294 relevant lines covered (81.84%)

57.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

1.43
/src/index.ts
1
#!/usr/bin/env node
2✔
2

3
import { ConsoleLogger, LogId } from "./common/logger.js";
×
4
import { config } from "./common/config.js";
×
5
import { StdioRunner } from "./transports/stdio.js";
×
6
import { StreamableHttpRunner } from "./transports/streamableHttp.js";
×
7

NEW
8
async function main(): Promise<void> {
×
9
    const transportRunner = config.transport === "stdio" ? new StdioRunner(config) : new StreamableHttpRunner(config);
×
10

NEW
11
    const shutdown = (): void => {
×
12
        transportRunner.logger.info({
×
13
            id: LogId.serverCloseRequested,
×
14
            context: "server",
×
15
            message: `Server close requested`,
×
16
        });
×
17

18
        transportRunner
×
19
            .close()
×
20
            .then(() => {
×
21
                transportRunner.logger.info({
×
22
                    id: LogId.serverClosed,
×
23
                    context: "server",
×
24
                    message: `Server closed`,
×
25
                });
×
26
                process.exit(0);
×
27
            })
×
28
            .catch((error: unknown) => {
×
29
                transportRunner.logger.error({
×
30
                    id: LogId.serverCloseFailure,
×
31
                    context: "server",
×
32
                    message: `Error closing server: ${error as string}`,
×
33
                });
×
34
                process.exit(1);
×
35
            });
×
36
    };
×
37

38
    process.on("SIGINT", shutdown);
×
39
    process.on("SIGABRT", shutdown);
×
40
    process.on("SIGTERM", shutdown);
×
41
    process.on("SIGQUIT", shutdown);
×
42

43
    try {
×
44
        await transportRunner.start();
×
45
    } catch (error: unknown) {
×
46
        transportRunner.logger.info({
×
47
            id: LogId.serverCloseRequested,
×
48
            context: "server",
×
49
            message: "Closing server",
×
50
        });
×
51
        try {
×
52
            await transportRunner.close();
×
53
            transportRunner.logger.info({
×
54
                id: LogId.serverClosed,
×
55
                context: "server",
×
56
                message: "Server closed",
×
57
            });
×
58
        } catch (error: unknown) {
×
59
            transportRunner.logger.error({
×
60
                id: LogId.serverCloseFailure,
×
61
                context: "server",
×
62
                message: `Error closing server: ${error as string}`,
×
63
            });
×
64
        }
×
65
        throw error;
×
66
    }
×
67
}
×
68

69
main().catch((error: unknown) => {
×
70
    // At this point, we may be in a very broken state, so we can't rely on the logger
71
    // being functional. Instead, create a brand new ConsoleLogger and log the error
72
    // to the console.
73
    const logger = new ConsoleLogger();
×
74
    logger.emergency({
×
75
        id: LogId.serverStartFailure,
×
76
        context: "server",
×
77
        message: `Fatal error running server: ${error as string}`,
×
78
    });
×
79
    process.exit(1);
×
80
});
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc