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

mongodb-js / mongodb-mcp-server / 14671890153

25 Apr 2025 07:17PM UTC coverage: 67.88% (-14.6%) from 82.446%
14671890153

Pull #135

github

web-flow
chore(deps-dev): bump @modelcontextprotocol/inspector

Bumps [@modelcontextprotocol/inspector](https://github.com/modelcontextprotocol/inspector) from 0.8.2 to 0.10.2.
- [Release notes](https://github.com/modelcontextprotocol/inspector/releases)
- [Commits](https://github.com/modelcontextprotocol/inspector/compare/0.8.2...0.10.2)

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/inspector"
  dependency-version: 0.10.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #135: chore(deps-dev): bump @modelcontextprotocol/inspector from 0.8.2 to 0.10.2

99 of 212 branches covered (46.7%)

Branch coverage included in aggregate %.

628 of 859 relevant lines covered (73.11%)

43.31 hits per line

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

53.85
/src/tools/atlas/create/createDBUser.ts
1
import { z } from "zod";
31✔
2
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
import { AtlasToolBase } from "../atlasTool.js";
31✔
4
import { ToolArgs, OperationType } from "../../tool.js";
5
import { CloudDatabaseUser, DatabaseUserRole } from "../../../common/atlas/openapi.js";
6

7
export class CreateDBUserTool extends AtlasToolBase {
31✔
8
    protected name = "atlas-create-db-user";
23✔
9
    protected description = "Create an MongoDB Atlas database user";
23✔
10
    protected operationType: OperationType = "create";
23✔
11
    protected argsShape = {
23✔
12
        projectId: z.string().describe("Atlas project ID"),
13
        username: z.string().describe("Username for the new user"),
14
        password: z.string().describe("Password for the new user"),
15
        roles: z
16
            .array(
17
                z.object({
18
                    roleName: z.string().describe("Role name"),
19
                    databaseName: z.string().describe("Database name").default("admin"),
20
                    collectionName: z.string().describe("Collection name").optional(),
21
                })
22
            )
23
            .describe("Roles for the new user"),
24
        clusters: z
25
            .array(z.string())
26
            .describe("Clusters to assign the user to, leave empty for access to all clusters")
27
            .optional(),
28
    };
29

30
    protected async execute({
31
        projectId,
32
        username,
33
        password,
34
        roles,
35
        clusters,
36
    }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
37
        const input = {
×
38
            groupId: projectId,
39
            awsIAMType: "NONE",
40
            databaseName: "admin",
41
            ldapAuthType: "NONE",
42
            oidcAuthType: "NONE",
43
            x509Type: "NONE",
44
            username,
45
            password,
46
            roles: roles as unknown as DatabaseUserRole[],
47
            scopes: clusters?.length
×
48
                ? clusters.map((cluster) => ({
×
49
                      type: "CLUSTER",
50
                      name: cluster,
51
                  }))
52
                : undefined,
53
        } as CloudDatabaseUser;
54

55
        await this.session.apiClient.createDatabaseUser({
×
56
            params: {
57
                path: {
58
                    groupId: projectId,
59
                },
60
            },
61
            body: input,
62
        });
63

64
        return {
×
65
            content: [{ type: "text", text: `User "${username}" created sucessfully.` }],
66
        };
67
    }
68
}
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