File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ export class ConnectTool extends MongoDBToolBase {
4242 ) {
4343 connectionString = connectionStringOrClusterName ;
4444 } else {
45- // TODO:
45+ // TODO: https://github.com/mongodb-js/mongodb-mcp-server/issues/19
46+ // We don't support connecting via cluster name since we'd need to obtain the user credentials
47+ // and fill in the connection string.
4648 return {
4749 content : [
4850 {
Original file line number Diff line number Diff line change @@ -19,17 +19,15 @@ export abstract class MongoDBToolBase extends ToolBase {
1919 protected category : ToolCategory = "mongodb" ;
2020
2121 protected async ensureConnected ( ) : Promise < NodeDriverServiceProvider > {
22- let provider = this . session . serviceProvider ;
23- if ( ! provider && config . connectionString ) {
22+ if ( ! this . session . serviceProvider && config . connectionString ) {
2423 await this . connectToMongoDB ( config . connectionString ) ;
25- provider = this . session . serviceProvider ;
2624 }
2725
28- if ( ! provider ) {
26+ if ( ! this . session . serviceProvider ) {
2927 throw new MongoDBError ( ErrorCodes . NotConnectedToMongoDB , "Not connected to MongoDB" ) ;
3028 }
3129
32- return provider ;
30+ return this . session . serviceProvider ;
3331 }
3432
3533 protected handleError ( error : unknown ) : Promise < CallToolResult > | CallToolResult {
You can’t perform that action at this time.
0 commit comments