You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: don't use config opts for further connections
This commit adds a test to assert that we don't use the driver options
derived from the CLI arguments -> userConfig for further connections
(other than the first connection) such as switch-connection tool.
The problem earlier was that MCPConnectionManager was accepting a
driverOptions object which it was then using in conjunction with
userConfig to construct a fresh set of driver options for all the
connections established by the MCP server. Now this was particularly
problematic because the driver options for the configured connection
might not be compatible with the new connection attempts being made in
the MCP server. Take for example - MCP server configured to connect with
an OIDC enabled MongoDB server and later switch-connection tool using
the same driver options to connect to a locally running mongodb server
without any auth.
To fix that we've removed DriverOptions object from the interface of
MCPConnectionManager and instead put it on the connect method. It is the
responsibility of the caller to provide a correct ConnectionInfo object.
For pre-configured connections server constructs the ConnectionInfo
object using user config and passes it down to the
MCPConnectionManager.connect and for the rest usage, they simply pass
the connection string that they want to connect to.
? "set; access to MongoDB tools are currently available to use"
40
41
: "not set; before using any MongoDB tool, you need to configure a connection string, alternatively you can setup MongoDB Atlas access, more info at 'https://github.com/mongodb-js/mongodb-mcp-server'.",
0 commit comments