File tree Expand file tree Collapse file tree 5 files changed +25
-2
lines changed Expand file tree Collapse file tree 5 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -284,6 +284,10 @@ npx -y mongodb-mcp-server@latest --transport http --httpHost=0.0.0.0 --httpPort=
284
284
285
285
NOTE: atlas tools are only available when you set credentials on [ configuration] ( #configuration ) section.
286
286
287
+ #### MongoDB Atlas Local Tools
288
+
289
+ -
290
+
287
291
#### MongoDB Database Tools
288
292
289
293
- ` connect ` - Connect to a MongoDB instance
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
import type { Session } from "./common/session.js" ;
3
3
import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js" ;
4
4
import { AtlasTools } from "./tools/atlas/tools.js" ;
5
+ import { AtlasLocalTools } from "./tools/atlasLocal/tools.js" ;
5
6
import { MongoDbTools } from "./tools/mongodb/tools.js" ;
6
7
import { Resources } from "./resources/resources.js" ;
7
8
import type { LogLevel } from "./common/logger.js" ;
@@ -193,7 +194,7 @@ export class Server {
193
194
}
194
195
195
196
private registerTools ( ) : void {
196
- for ( const toolConstructor of [ ...AtlasTools , ...MongoDbTools ] ) {
197
+ for ( const toolConstructor of [ ...AtlasTools , ...AtlasLocalTools , ... MongoDbTools ] ) {
197
198
const tool = new toolConstructor ( this . session , this . userConfig , this . telemetry ) ;
198
199
if ( tool . register ( this ) ) {
199
200
this . tools . push ( tool ) ;
Original file line number Diff line number Diff line change
1
+ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js" ;
2
+ import type { ToolArgs , ToolCategory } from "../tool.js" ;
3
+ import { ToolBase } from "../tool.js" ;
4
+
5
+ export abstract class AtlasLocalToolBase extends ToolBase {
6
+ public category : ToolCategory = "atlas-local" ;
7
+
8
+ protected handleError (
9
+ error : unknown ,
10
+ args : ToolArgs < typeof this . argsShape >
11
+ ) : Promise < CallToolResult > | CallToolResult {
12
+ // Error Handling for expected Atlas Local errors go here
13
+
14
+ // For other types of errors, use the default error handling from the base class
15
+ return super . handleError ( error , args ) ;
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+ export const AtlasLocalTools = [ ] ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import type { Server } from "../server.js";
12
12
export type ToolArgs < Args extends ZodRawShape > = z . objectOutputType < Args , ZodNever > ;
13
13
14
14
export type OperationType = "metadata" | "read" | "create" | "delete" | "update" | "connect" ;
15
- export type ToolCategory = "mongodb" | "atlas" ;
15
+ export type ToolCategory = "mongodb" | "atlas" | "atlas-local" ;
16
16
export type TelemetryToolMetadata = {
17
17
projectId ?: string ;
18
18
orgId ?: string ;
You can’t perform that action at this time.
0 commit comments