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

mongodb-js / mongodb-mcp-server / 19329661675

13 Nov 2025 11:15AM UTC coverage: 80.161% (-0.01%) from 80.171%
19329661675

Pull #729

github

web-flow
Merge f2dce249f into 0e8534c72
Pull Request #729: chore: refactor config initialisation for CLI to allow easy extension from other config sources as well MCP-288

1374 of 1827 branches covered (75.21%)

Branch coverage included in aggregate %.

27 of 28 new or added lines in 4 files covered. (96.43%)

6485 of 7977 relevant lines covered (81.3%)

70.81 hits per line

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

59.09
/src/resources/common/config.ts
1
import { ReactiveResource } from "../resource.js";
3✔
2
import { createDriverOptions } from "../../common/config/driverOptions.js";
3✔
3
import type { UserConfig } from "../../common/config.js";
4
import type { Telemetry } from "../../telemetry/telemetry.js";
5
import type { Session } from "../../lib.js";
6

7
export class ConfigResource extends ReactiveResource<UserConfig, readonly []> {
3✔
8
    constructor(session: Session, config: UserConfig, telemetry: Telemetry) {
3✔
9
        super({
100✔
10
            resourceConfiguration: {
100✔
11
                name: "config",
100✔
12
                uri: "config://config",
100✔
13
                config: {
100✔
14
                    description:
100✔
15
                        "Server configuration, supplied by the user either as environment variables or as startup arguments",
100✔
16
                },
100✔
17
            },
100✔
18
            options: {
100✔
19
                initial: { ...config },
100✔
20
                events: [],
100✔
21
            },
100✔
22
            session,
100✔
23
            config,
100✔
24
            telemetry,
100✔
25
        });
100✔
26
    }
100✔
27
    reduce(eventName: undefined, event: undefined): UserConfig {
3✔
28
        void eventName;
×
29
        void event;
×
30

31
        return this.current;
×
32
    }
×
33

34
    toOutput(): string {
3✔
35
        const result = {
×
36
            telemetry: this.current.telemetry,
×
37
            logPath: this.current.logPath,
×
38
            connectionString: this.current.connectionString
×
39
                ? "set; access to MongoDB tools are currently available to use"
×
40
                : "not set; before using any MongoDB tool, you need to configure a connection string, alternatively you can setup MongoDB Atlas access, more info at 'https://github.com/mongodb-js/mongodb-mcp-server'.",
×
NEW
41
            connectOptions: createDriverOptions(this.config),
×
42
            atlas:
×
43
                this.current.apiClientId && this.current.apiClientSecret
×
44
                    ? "set; MongoDB Atlas tools are currently available to use"
×
45
                    : "not set; MongoDB Atlas tools are currently unavailable, to have access to MongoDB Atlas tools like creating clusters or connecting to clusters make sure to setup credentials, more info at 'https://github.com/mongodb-js/mongodb-mcp-server'.",
×
46
        };
×
47

48
        return JSON.stringify(result);
×
49
    }
×
50
}
3✔
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