Skip to content

Commit eb488ff

Browse files
Merge branch 'main' into feat-MCP-40
2 parents 74d2218 + 8e3c6a6 commit eb488ff

File tree

17 files changed

+631
-63
lines changed

17 files changed

+631
-63
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22-alpine
1+
FROM node:24-alpine
22
ARG VERSION=latest
33
RUN addgroup -S mcp && adduser -S mcp -G mcp
44
RUN npm install -g mongodb-mcp-server@${VERSION}

package-lock.json

Lines changed: 198 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mongodb-mcp-server",
33
"description": "MongoDB Model Context Protocol Server",
4-
"version": "1.0.3-prerelease.1",
4+
"version": "1.1.0-prerelease.1",
55
"type": "module",
66
"exports": {
77
".": {

scripts/cleanupAtlasTestLeftovers.test.ts

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ async function findAllTestProjects(client: ApiClient, orgId: string): Promise<Gr
3535
return testProjects.filter((proj) => isOlderThanADay(proj.created));
3636
}
3737

38-
async function deleteAllClustersOnStaleProject(client: ApiClient, projectId: string): Promise<void> {
38+
async function deleteAllClustersOnStaleProject(client: ApiClient, projectId: string): Promise<string[]> {
39+
const errors: string[] = [];
40+
3941
const allClusters = await client
4042
.listClusters({
4143
params: {
@@ -47,10 +49,18 @@ async function deleteAllClustersOnStaleProject(client: ApiClient, projectId: str
4749
.then((res) => res.results || []);
4850

4951
await Promise.allSettled(
50-
allClusters.map((cluster) =>
51-
client.deleteCluster({ params: { path: { groupId: projectId || "", clusterName: cluster.name || "" } } })
52-
)
52+
allClusters.map(async (cluster) => {
53+
try {
54+
await client.deleteCluster({
55+
params: { path: { groupId: projectId || "", clusterName: cluster.name || "" } },
56+
});
57+
} catch (error) {
58+
errors.push(`Failed to delete cluster ${cluster.name} in project ${projectId}: ${String(error)}`);
59+
}
60+
})
5361
);
62+
63+
return errors;
5464
}
5565

5666
async function main(): Promise<void> {
@@ -70,27 +80,47 @@ async function main(): Promise<void> {
7080

7181
if (testProjects.length === 0) {
7282
console.log("No stale test projects found for cleanup.");
83+
return;
7384
}
7485

86+
const allErrors: string[] = [];
87+
7588
for (const project of testProjects) {
7689
console.log(`Cleaning up project: ${project.name} (${project.id})`);
7790
if (!project.id) {
7891
console.warn(`Skipping project with missing ID: ${project.name}`);
7992
continue;
8093
}
8194

82-
await deleteAllClustersOnStaleProject(apiClient, project.id);
83-
await apiClient.deleteProject({
84-
params: {
85-
path: {
86-
groupId: project.id,
95+
// Try to delete all clusters first
96+
const clusterErrors = await deleteAllClustersOnStaleProject(apiClient, project.id);
97+
allErrors.push(...clusterErrors);
98+
99+
// Try to delete the project
100+
try {
101+
await apiClient.deleteProject({
102+
params: {
103+
path: {
104+
groupId: project.id,
105+
},
87106
},
88-
},
89-
});
90-
console.log(`Deleted project: ${project.name} (${project.id})`);
107+
});
108+
console.log(`Deleted project: ${project.name} (${project.id})`);
109+
} catch (error) {
110+
const errorStr = String(error);
111+
const errorMessage = `Failed to delete project ${project.name} (${project.id}): ${errorStr}`;
112+
console.error(errorMessage);
113+
allErrors.push(errorMessage);
114+
}
115+
}
116+
117+
if (allErrors.length > 0) {
118+
const errorList = allErrors.map((err, i) => `${i + 1}. ${err}`).join("\n");
119+
const errorSummary = `Cleanup completed with ${allErrors.length} error(s):\n${errorList}`;
120+
throw new Error(errorSummary);
91121
}
92122

93-
return;
123+
console.log("All stale test projects cleaned up successfully.");
94124
}
95125

96126
describe("Cleanup Atlas Test Leftovers", () => {

src/common/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export const defaultUserConfig: UserConfig = {
201201
"drop-database",
202202
"drop-collection",
203203
"delete-many",
204+
"drop-index",
204205
],
205206
transport: "stdio",
206207
httpPort: 3000,

src/common/packageInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file was generated by scripts/updatePackageVersion.ts - Do not edit it manually.
22
export const packageInfo = {
3-
version: "1.0.3-prerelease.1",
3+
version: "1.1.0-prerelease.1",
44
mcpServerName: "MongoDB MCP Server",
55
};

0 commit comments

Comments
 (0)