@@ -12,6 +12,20 @@ import type { Secret } from "../../../src/common/keychain.js";
1212
1313describe ( "config" , ( ) => {
1414 describe ( "env var parsing" , ( ) => {
15+ describe ( "mongodb urls" , ( ) => {
16+ it ( "should not try to parse a multiple-host urls" , ( ) => {
17+ const actual = setupUserConfig ( {
18+ env : {
19+ MDB_MCP_CONNECTION_STRING : "mongodb://user:password@host1,host2,host3/" ,
20+ } ,
21+ cli : [ ] ,
22+ defaults : defaultUserConfig ,
23+ } ) ;
24+
25+ expect ( actual . connectionString ) . toEqual ( "mongodb://user:password@host1,host2,host3/" ) ;
26+ } ) ;
27+ } ) ;
28+
1529 describe ( "string cases" , ( ) => {
1630 const testCases = [
1731 { envVar : "MDB_MCP_API_BASE_URL" , property : "apiBaseUrl" , value : "http://test.com" } ,
@@ -67,6 +81,16 @@ describe("config", () => {
6781 } ) ;
6882
6983 describe ( "cli parsing" , ( ) => {
84+ it ( "should not try to parse a multiple-host urls" , ( ) => {
85+ const actual = setupUserConfig ( {
86+ cli : [ "myself" , "--" , "--connectionString" , "mongodb://user:password@host1,host2,host3/" ] ,
87+ env : { } ,
88+ defaults : defaultUserConfig ,
89+ } ) ;
90+
91+ expect ( actual . connectionString ) . toEqual ( "mongodb://user:password@host1,host2,host3/" ) ;
92+ } ) ;
93+
7094 describe ( "string use cases" , ( ) => {
7195 const testCases = [
7296 {
0 commit comments