• 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

24.14
/src/tools/atlas/create/createProject.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 { Group } from "../../../common/atlas/openapi.js";
6

7
export class CreateProjectTool extends AtlasToolBase {
31✔
8
    protected name = "atlas-create-project";
23✔
9
    protected description = "Create a MongoDB Atlas project";
23✔
10
    protected operationType: OperationType = "create";
23✔
11
    protected argsShape = {
23✔
12
        projectName: z.string().optional().describe("Name for the new project"),
13
        organizationId: z.string().optional().describe("Organization ID for the new project"),
14
    };
15

16
    protected async execute({ projectName, organizationId }: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
17
        let assumedOrg = false;
×
18

19
        if (!projectName) {
×
20
            projectName = "Atlas Project";
×
21
        }
22

23
        if (!organizationId) {
×
24
            try {
×
25
                const organizations = await this.session.apiClient.listOrganizations();
×
26
                if (!organizations?.results?.length) {
×
27
                    throw new Error(
×
28
                        "No organizations were found in your MongoDB Atlas account. Please create an organization first."
29
                    );
30
                }
31
                organizationId = organizations.results[0].id;
×
32
                assumedOrg = true;
×
33
            } catch {
34
                throw new Error(
×
35
                    "Could not search for organizations in your MongoDB Atlas account, please provide an organization ID or create one first."
36
                );
37
            }
38
        }
39

40
        const input = {
×
41
            name: projectName,
42
            orgId: organizationId,
43
        } as Group;
44

45
        const group = await this.session.apiClient.createProject({
×
46
            body: input,
47
        });
48

49
        if (!group?.id) {
×
50
            throw new Error("Failed to create project");
×
51
        }
52

53
        return {
×
54
            content: [
55
                {
56
                    type: "text",
57
                    text: `Project "${projectName}" created successfully${assumedOrg ? ` (using organizationId ${organizationId}).` : ""}.`,
×
58
                },
59
            ],
60
        };
61
    }
62
}
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