Skip to content

Commit c1d0117

Browse files
chore: detect local run use-case better
1 parent 50f9122 commit c1d0117

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tools/mongodb/read/export.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class ExportTool extends MongoDBToolBase {
7373
// This special case is to make it easier to work with exported data for
7474
// clients that still cannot reference resources (Cursor).
7575
// More information here: https://jira.mongodb.org/browse/MCP-104
76-
if (this.config.transport === "stdio") {
76+
if (this.isServerRunningLocally()) {
7777
toolCallContent.push({
7878
type: "text",
7979
text: `Optionally, when the export is finished, the exported data can also be accessed under path - "${exportPath}"`,
@@ -84,4 +84,8 @@ export class ExportTool extends MongoDBToolBase {
8484
content: toolCallContent,
8585
};
8686
}
87+
88+
private isServerRunningLocally(): boolean {
89+
return this.config.transport === "stdio" || ["127.0.0.1", "localhost"].includes(this.config.httpHost);
90+
}
8791
}

0 commit comments

Comments
 (0)