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();
8
8
9
9
// If we decide to support non-string config options, we'll need to extend the mechanism for parsing
10
10
// env variables.
11
- interface UserConfig extends Record < string , string > {
11
+ interface UserConfig extends Record < string , string | undefined > {
12
12
apiBaseUrl : string ;
13
13
clientId : string ;
14
14
stateFile : string ;
15
+ connectionString ?: string ;
15
16
}
16
17
17
18
const defaults : UserConfig = {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { DbOperationType, MongoDBToolBase } from "./mongodbTool.js";
5
5
import { ToolArgs } from "../tool.js" ;
6
6
import { ErrorCodes , MongoDBError } from "../../errors.js" ;
7
7
import { saveState } from "../../state.js" ;
8
+ import config from "../../config.js" ;
8
9
9
10
export class ConnectTool extends MongoDBToolBase {
10
11
protected name = "connect" ;
@@ -21,7 +22,7 @@ export class ConnectTool extends MongoDBToolBase {
21
22
protected async execute ( {
22
23
connectionStringOrClusterName,
23
24
} : ToolArgs < typeof this . argsShape > ) : Promise < CallToolResult > {
24
- connectionStringOrClusterName ??= this . state . connectionString ;
25
+ connectionStringOrClusterName ??= config . connectionString || this . state . connectionString ;
25
26
if ( ! connectionStringOrClusterName ) {
26
27
return {
27
28
content : [
You can’t perform that action at this time.
0 commit comments