File tree Expand file tree Collapse file tree 5 files changed +8218
-5
lines changed Expand file tree Collapse file tree 5 files changed +8218
-5
lines changed Original file line number Diff line number Diff line change 121121 "node" : " ^20.19.0 || ^22.12.0 || >= 23.0.0"
122122 },
123123 "optionalDependencies" : {
124- "@mongodb-js-preview/atlas-local" : " ^0.0.0-preview.1 " ,
124+ "@mongodb-js-preview/atlas-local" : " ^0.0.0-preview.2 " ,
125125 "kerberos" : " ^2.2.2"
126126 }
127127}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export abstract class AtlasLocalToolBase extends ToolBase {
1111 return this . session . atlasLocalClient !== undefined && super . verifyAllowed ( ) ;
1212 }
1313
14- protected async execute ( ) : Promise < CallToolResult > {
14+ protected async execute ( ... args : Parameters < ToolCallback < typeof this . argsShape > > ) : Promise < CallToolResult > {
1515 // Get the client
1616 const client = this . session . atlasLocalClient ;
1717
@@ -35,10 +35,13 @@ please log a ticket here: https://github.com/mongodb-js/mongodb-mcp-server/issue
3535 } ;
3636 }
3737
38- return this . executeWithAtlasLocalClient ( client ) ;
38+ return this . executeWithAtlasLocalClient ( client , ... args ) ;
3939 }
4040
41- protected abstract executeWithAtlasLocalClient ( client : Client ) : Promise < CallToolResult > ;
41+ protected abstract executeWithAtlasLocalClient (
42+ client : Client ,
43+ ...args : Parameters < ToolCallback < typeof this . argsShape > >
44+ ) : Promise < CallToolResult > ;
4245
4346 protected handleError (
4447 error : unknown ,
Original file line number Diff line number Diff line change 1+ import { z } from "zod" ;
2+ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js" ;
3+ import { AtlasLocalToolBase } from "../atlasLocalTool.js" ;
4+ import type { OperationType , ToolArgs } from "../../tool.js" ;
5+ import type { Client } from "@mongodb-js-preview/atlas-local" ;
6+
7+ export class DeleteDeploymentTool extends AtlasLocalToolBase {
8+ public name = "atlas-local-delete-deployment" ;
9+ protected description = "Delete a MongoDB Atlas local deployment" ;
10+ public operationType : OperationType = "delete" ;
11+ protected argsShape = {
12+ deploymentName : z . string ( ) . describe ( "Name of the deployment to delete" ) ,
13+ } ;
14+
15+ protected async executeWithAtlasLocalClient (
16+ client : Client ,
17+ { deploymentName } : ToolArgs < typeof this . argsShape >
18+ ) : Promise < CallToolResult > {
19+ // Delete the deployment
20+ await client . deleteDeployment ( deploymentName ) ;
21+
22+ return {
23+ content : [ { type : "text" , text : `Deployment "${ deploymentName } " deleted successfully.` } ] ,
24+ } ;
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ import { DeleteDeploymentTool } from "./delete/deleteDeployment.js" ;
12import { ListDeploymentsTool } from "./read/listDeployments.js" ;
23
3- export const AtlasLocalTools = [ ListDeploymentsTool ] ;
4+ export const AtlasLocalTools = [ ListDeploymentsTool , DeleteDeploymentTool ] ;
You can’t perform that action at this time.
0 commit comments