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

mongodb-js / mongodb-mcp-server / 14705884283

28 Apr 2025 10:45AM UTC coverage: 82.547% (+0.9%) from 81.696%
14705884283

Pull #131

github

fmenezes
fix: make ip changes smooth
Pull Request #131: feat: add atlas-connect-cluster tool

147 of 229 branches covered (64.19%)

Branch coverage included in aggregate %.

26 of 31 new or added lines in 4 files covered. (83.87%)

60 existing lines in 8 files now uncovered.

780 of 894 relevant lines covered (87.25%)

49.5 hits per line

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

91.3
/src/session.ts
1
import { NodeDriverServiceProvider } from "@mongosh/service-provider-node-driver";
2
import { ApiClient, ApiClientCredentials } from "./common/atlas/apiClient.js";
31✔
3
import { Implementation } from "@modelcontextprotocol/sdk/types.js";
4

31✔
5
export interface SessionOptions {
6
    apiBaseUrl?: string;
7
    apiClientId?: string;
8
    apiClientSecret?: string;
9
}
10

11
export class Session {
12
    sessionId?: string;
31✔
13
    serviceProvider?: NodeDriverServiceProvider;
14
    apiClient: ApiClient;
15
    agentRunner?: {
16
        name: string;
17
        version: string;
18
    };
19

20
    constructor({ apiBaseUrl, apiClientId, apiClientSecret }: SessionOptions = {}) {
21
        const credentials: ApiClientCredentials | undefined =
22
            apiClientId && apiClientSecret
23
                ? {
×
24
                      clientId: apiClientId,
29✔
25
                      clientSecret: apiClientSecret,
26
                  }
27
                : undefined;
29✔
28

29
        this.apiClient = new ApiClient({
30
            baseUrl: apiBaseUrl,
31
            credentials,
32
        });
33
    }
34

29✔
35
    setAgentRunner(agentRunner: Implementation | undefined) {
36
        if (agentRunner?.name && agentRunner?.version) {
37
            this.agentRunner = {
38
                name: agentRunner.name,
39
                version: agentRunner.version,
40
            };
41
        }
29✔
42
    }
29✔
43

44
    async close(): Promise<void> {
45
        if (this.serviceProvider) {
46
            try {
47
                await this.serviceProvider.close(true);
48
            } catch (error) {
49
                console.error("Error closing service provider:", error);
50
            }
311✔
51
            this.serviceProvider = undefined;
108✔
52
        }
108✔
53
    }
UNCOV
54
}
×
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