Skip to content

Commit d585baa

Browse files
authored
fix: config resource (#173)
1 parent 6bce4a3 commit d585baa

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

src/server.ts

+7-21
Original file line numberDiff line numberDiff line change
@@ -150,39 +150,25 @@ export class Server {
150150
telemetry: this.userConfig.telemetry,
151151
logPath: this.userConfig.logPath,
152152
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",
153+
? "set; access to MongoDB tools are currently available to use"
154+
: "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'.",
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: [
159163
{
160164
text: JSON.stringify(result),
165+
mimeType: "application/json",
161166
uri: uri.href,
162167
},
163168
],
164169
};
165170
}
166171
);
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-
}
186172
}
187173

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

0 commit comments

Comments
 (0)