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=
284284
285285NOTE: atlas tools are only available when you set credentials on [ configuration] ( #configuration ) section.
286286
287+ #### MongoDB Atlas Local Tools
288+
289+ -
290+
287291#### MongoDB Database Tools
288292
289293- ` 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";
22import type { Session } from "./common/session.js" ;
33import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js" ;
44import { AtlasTools } from "./tools/atlas/tools.js" ;
5+ import { AtlasLocalTools } from "./tools/atlasLocal/tools.js" ;
56import { MongoDbTools } from "./tools/mongodb/tools.js" ;
67import { Resources } from "./resources/resources.js" ;
78import type { LogLevel } from "./common/logger.js" ;
@@ -193,7 +194,7 @@ export class Server {
193194 }
194195
195196 private registerTools ( ) : void {
196- for ( const toolConstructor of [ ...AtlasTools , ...MongoDbTools ] ) {
197+ for ( const toolConstructor of [ ...AtlasTools , ...AtlasLocalTools , ... MongoDbTools ] ) {
197198 const tool = new toolConstructor ( this . session , this . userConfig , this . telemetry ) ;
198199 if ( tool . register ( this ) ) {
199200 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";
1212export type ToolArgs < Args extends ZodRawShape > = z . objectOutputType < Args , ZodNever > ;
1313
1414export type OperationType = "metadata" | "read" | "create" | "delete" | "update" | "connect" ;
15- export type ToolCategory = "mongodb" | "atlas" ;
15+ export type ToolCategory = "mongodb" | "atlas" | "atlas-local" ;
1616export type TelemetryToolMetadata = {
1717 projectId ?: string ;
1818 orgId ?: string ;
You can’t perform that action at this time.
0 commit comments