@@ -19,6 +19,9 @@ export interface UserConfig {
1919 apiClientSecret ?: string ;
2020 telemetry : "enabled" | "disabled" ;
2121 logPath : string ;
22+ exportsPath : string ;
23+ exportTimeoutMs : number ;
24+ exportCleanupIntervalMs : number ;
2225 connectionString ?: string ;
2326 connectOptions : ConnectOptions ;
2427 disabledTools : Array < string > ;
@@ -35,6 +38,9 @@ export interface UserConfig {
3538const defaults : UserConfig = {
3639 apiBaseUrl : "https://cloud.mongodb.com/" ,
3740 logPath : getLogPath ( ) ,
41+ exportsPath : getExportsPath ( ) ,
42+ exportTimeoutMs : 300000 , // 5 minutes
43+ exportCleanupIntervalMs : 120000 , // 2 minutes
3844 connectOptions : {
3945 readConcern : "local" ,
4046 readPreference : "secondaryPreferred" ,
@@ -59,17 +65,21 @@ export const config = {
5965 ...getCliConfig ( ) ,
6066} ;
6167
62- function getLogPath ( ) : string {
63- const localDataPath =
64- process . platform === "win32"
65- ? path . join ( process . env . LOCALAPPDATA || process . env . APPDATA || os . homedir ( ) , "mongodb" )
66- : path . join ( os . homedir ( ) , ".mongodb" ) ;
67-
68- const logPath = path . join ( localDataPath , "mongodb-mcp" , ".app-logs" ) ;
68+ function getLocalDataPath ( ) : string {
69+ return process . platform === "win32"
70+ ? path . join ( process . env . LOCALAPPDATA || process . env . APPDATA || os . homedir ( ) , "mongodb" )
71+ : path . join ( os . homedir ( ) , ".mongodb" ) ;
72+ }
6973
74+ function getLogPath ( ) : string {
75+ const logPath = path . join ( getLocalDataPath ( ) , "mongodb-mcp" , ".app-logs" ) ;
7076 return logPath ;
7177}
7278
79+ function getExportsPath ( ) : string {
80+ return path . join ( getLocalDataPath ( ) , "mongodb-mcp" , "exports" ) ;
81+ }
82+
7383// Gets the config supplied by the user as environment variables. The variable names
7484// are prefixed with `MDB_MCP_` and the keys match the UserConfig keys, but are converted
7585// to SNAKE_UPPER_CASE.
0 commit comments