Skip to content

Commit 1a8c937

Browse files
committed
fix: config resource
1 parent 308b348 commit 1a8c937

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

src/server.ts

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,14 @@ export class Server {
149149
const result = {
150150
telemetry: this.userConfig.telemetry,
151151
logPath: this.userConfig.logPath,
152-
connectionString: this.userConfig.connectionString
153-
? "set; no explicit connect needed, use switch-connection tool to connect to a different connection if necessary"
154-
: "not set; before using any mongodb tool, you need to call the connect tool with a connection string",
152+
mode: this.userConfig.connectionString
153+
? "MongoDB; access to MongoDB tools is available"
154+
: "not set; before using any MongoDB tool, you need to configure a connection string, more info at 'https://github.com/mongodb-js/mongodb-mcp-server', alternatively you man setup MongoDB Atlas access.",
155155
connectOptions: this.userConfig.connectOptions,
156+
atlas:
157+
this.userConfig.apiClientId && this.userConfig.apiClientSecret
158+
? "set; MongoDB Atlas tools are currently available to use"
159+
: "not set; MongoDB Atlas tools are currently unavailable, to have access to MongoDB Atlas tools like creating clusters or connecting to clusters make sure to setup credentials, more info at 'https://github.com/mongodb-js/mongodb-mcp-server'.",
156160
};
157161
return {
158162
contents: [
@@ -164,25 +168,6 @@ export class Server {
164168
};
165169
}
166170
);
167-
if (this.userConfig.connectionString) {
168-
this.mcpServer.resource(
169-
"connection-string",
170-
"config://connection-string",
171-
{
172-
description: "Preconfigured connection string that will be used as a default in the `connect` tool",
173-
},
174-
(uri) => {
175-
return {
176-
contents: [
177-
{
178-
text: `Preconfigured connection string: ${this.userConfig.connectionString}`,
179-
uri: uri.href,
180-
},
181-
],
182-
};
183-
}
184-
);
185-
}
186171
}
187172

188173
private async validateConfig(): Promise<void> {

0 commit comments

Comments
 (0)