File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,11 @@ const { localDataPath, configPath } = getLocalDataPath();
88
99// If we decide to support non-string config options, we'll need to extend the mechanism for parsing
1010// env variables.
11- interface UserConfig extends Record < string , string > {
11+ interface UserConfig extends Record < string , string | undefined > {
1212 apiBaseUrl : string ;
1313 clientId : string ;
1414 stateFile : string ;
15+ connectionString ?: string ;
1516}
1617
1718const defaults : UserConfig = {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { DbOperationType, MongoDBToolBase } from "./mongodbTool.js";
55import { ToolArgs } from "../tool.js" ;
66import { ErrorCodes , MongoDBError } from "../../errors.js" ;
77import { saveState } from "../../state.js" ;
8+ import config from "../../config.js" ;
89
910export class ConnectTool extends MongoDBToolBase {
1011 protected name = "connect" ;
@@ -21,7 +22,7 @@ export class ConnectTool extends MongoDBToolBase {
2122 protected async execute ( {
2223 connectionStringOrClusterName,
2324 } : ToolArgs < typeof this . argsShape > ) : Promise < CallToolResult > {
24- connectionStringOrClusterName ??= this . state . connectionString ;
25+ connectionStringOrClusterName ??= config . connectionString || this . state . connectionString ;
2526 if ( ! connectionStringOrClusterName ) {
2627 return {
2728 content : [
You can’t perform that action at this time.
0 commit comments