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

mongodb-js / mongodb-mcp-server / 19925638108

04 Dec 2025 10:23AM UTC coverage: 80.575% (-0.03%) from 80.607%
19925638108

Pull #779

github

web-flow
Merge 1e90969c7 into e12068a03
Pull Request #779: chore: bump mcp SDK, refactor tool arguments

1469 of 1905 branches covered (77.11%)

Branch coverage included in aggregate %.

49 of 66 new or added lines in 12 files covered. (74.24%)

2 existing lines in 2 files now uncovered.

6736 of 8278 relevant lines covered (81.37%)

78.78 hits per line

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

86.49
/src/tools/atlasLocal/connect/connectDeployment.ts
1
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
2
import { AtlasLocalToolBase } from "../atlasLocalTool.js";
3✔
3
import type { OperationType, ToolArgs } from "../../tool.js";
4
import type { Client } from "@mongodb-js/atlas-local";
5
import { CommonArgs } from "../../args.js";
3✔
6
import type { ConnectionMetadata } from "../../../telemetry/types.js";
7

8
export class ConnectDeploymentTool extends AtlasLocalToolBase {
3✔
9
    public name = "atlas-local-connect-deployment";
100✔
10
    protected description = "Connect to a MongoDB Atlas Local deployment";
100✔
11
    static operationType: OperationType = "connect";
100✔
12
    protected argsShape = {
100✔
13
        deploymentName: CommonArgs.string().describe("Name of the deployment to connect to"),
100✔
14
    };
100✔
15

16
    protected async executeWithAtlasLocalClient(
3✔
17
        { deploymentName }: ToolArgs<typeof this.argsShape>,
3✔
18
        { client }: { client: Client }
3✔
19
    ): Promise<CallToolResult> {
3✔
20
        // Get the connection string for the deployment
21
        const connectionString = await client.getConnectionString(deploymentName);
3✔
22

23
        // Connect to the deployment
24
        await this.session.connectToMongoDB({ connectionString });
2✔
25

26
        return {
2✔
27
            content: [
2✔
28
                {
2✔
29
                    type: "text",
2✔
30
                    text: `Successfully connected to Atlas Local deployment "${deploymentName}".`,
2✔
31
                },
2✔
32
            ],
2✔
33
            _meta: {
2✔
34
                ...(await this.lookupTelemetryMetadata(client, deploymentName)),
2✔
35
            },
2✔
36
        };
2✔
37
    }
3✔
38

39
    protected override resolveTelemetryMetadata(
3✔
NEW
40
        args: ToolArgs<typeof this.argsShape>,
×
NEW
41
        { result }: { result: CallToolResult }
×
NEW
42
    ): ConnectionMetadata {
×
NEW
43
        return { ...super.resolveTelemetryMetadata(args, { result }), ...this.getConnectionInfoMetadata() };
×
UNCOV
44
    }
×
45
}
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