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

mongodb-js / mongodb-mcp-server / 17161333946

22 Aug 2025 05:03PM UTC coverage: 81.909% (-0.1%) from 82.022%
17161333946

Pull #471

github

web-flow
Merge 903825dd4 into 49707be70
Pull Request #471: fix: atlas connectCluster defaults to readOnly DB roles - MCP-125

874 of 1092 branches covered (80.04%)

Branch coverage included in aggregate %.

25 of 25 new or added lines in 2 files covered. (100.0%)

49 existing lines in 10 files now uncovered.

4360 of 5298 relevant lines covered (82.3%)

70.64 hits per line

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

85.71
/src/tools/atlas/read/inspectAccessList.ts
1
import { z } from "zod";
2✔
2
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
import { AtlasToolBase } from "../atlasTool.js";
2✔
4
import type { ToolArgs, OperationType } from "../../tool.js";
5
import { formatUntrustedData } from "../../tool.js";
2✔
6

7
export class InspectAccessListTool extends AtlasToolBase {
2✔
8
    public name = "atlas-inspect-access-list";
80✔
9
    protected description = "Inspect Ip/CIDR ranges with access to your MongoDB Atlas clusters.";
80✔
10
    public operationType: OperationType = "read";
80✔
11
    protected argsShape = {
80✔
12
        projectId: z.string().describe("Atlas project ID"),
80✔
13
    };
80✔
14

15
    protected async execute({ projectId }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
2✔
16
        const accessList = await this.session.apiClient.listProjectIpAccessLists({
1✔
17
            params: {
1✔
18
                path: {
1✔
19
                    groupId: projectId,
1✔
20
                },
1✔
21
            },
1✔
22
        });
1✔
23

24
        const results = accessList.results ?? [];
1!
25

26
        if (!results.length) {
1!
UNCOV
27
            return {
×
UNCOV
28
                content: [{ type: "text", text: "No access list entries found." }],
×
UNCOV
29
            };
×
UNCOV
30
        }
×
31

32
        return {
1✔
33
            content: formatUntrustedData(
1✔
34
                `Found ${results.length} access list entries`,
1✔
35
                `IP ADDRESS | CIDR | COMMENT
1✔
36
------|------|------
37
${results
1✔
38
    .map((entry) => {
1✔
39
        return `${entry.ipAddress} | ${entry.cidrBlock} | ${entry.comment}`;
5✔
40
    })
1✔
41
    .join("\n")}`
1✔
42
            ),
1✔
43
        };
1✔
44
    }
1✔
45
}
2✔
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