Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
aea317c
chore: disable MCP auto start and instead request
himanshusinghs Sep 23, 2025
f2364e1
fix: bind DataService.disconnect to correct instance
himanshusinghs Sep 23, 2025
6c48e71
chore: enable readOnly mode by default
himanshusinghs Sep 23, 2025
aea2eaa
chore: remove unused type
himanshusinghs Sep 23, 2025
c5a65da
chore: fix tests with correct expectations
himanshusinghs Sep 23, 2025
f6b6b00
Update src/test/suite/mcp/mcpController.test.ts
himanshusinghs Sep 23, 2025
c94498f
chore: apply copilot suggestions
himanshusinghs Sep 23, 2025
adcab74
chore: no exclusive tests
himanshusinghs Sep 23, 2025
df9c0f3
chore: add missing hosting_mode for telemetry data
himanshusinghs Sep 23, 2025
e4be477
chore: remove unused async wrapper
himanshusinghs Sep 23, 2025
1b14b66
chore: avoid relying on internals for tests
himanshusinghs Sep 25, 2025
58c880f
chore: use pre-build logger
himanshusinghs Sep 25, 2025
ee2e851
chore: clarify the comment
himanshusinghs Sep 25, 2025
5e23a07
chore: disable eslint just for the lines
himanshusinghs Sep 25, 2025
f03b737
chore: type the returned value of getMCPAutoStartConfig
himanshusinghs Sep 25, 2025
13cbb37
Merge remote-tracking branch 'origin/main' into fix/VSCODE-704-flip-m…
himanshusinghs Sep 25, 2025
a0cc53e
chore: coerce unknown stored values to known value
himanshusinghs Sep 25, 2025
fedd5d1
chore: handle multiple mcp client connections
himanshusinghs Sep 26, 2025
03957d1
chore: remove unused imports
himanshusinghs Sep 26, 2025
0cff996
Merge remote-tracking branch 'origin/main' into fix/VSCODE-704-flip-m…
himanshusinghs Sep 26, 2025
98a4187
chore: bump mongodb-mcp-server
himanshusinghs Sep 26, 2025
f638bc6
chore: add tests to verify multi client handling
himanshusinghs Sep 26, 2025
d3d6448
chore: disable eslint just for the lines
himanshusinghs Sep 26, 2025
90be6f3
chore: rename clientConnectionManager to mcpConnectionManager
himanshusinghs Sep 29, 2025
955a371
chore: add test for separate client states
himanshusinghs Sep 30, 2025
0a4f818
chore: add test validating that MCP server shutdown closes Connection…
himanshusinghs Sep 30, 2025
5f77f59
chore: log when prompted and remove one line func
himanshusinghs Sep 30, 2025
5a4e165
Merge remote-tracking branch 'origin/main' into fix/VSCODE-704-flip-m…
himanshusinghs Sep 30, 2025
1613071
chore: use typed autoStartConfig retriever
himanshusinghs Oct 1, 2025
6f161a8
chore: update test to reflect non-coercion
himanshusinghs Oct 1, 2025
8f8606f
chore: do not show popup on extension activate
himanshusinghs Oct 1, 2025
a1954c8
chore: correctly place the log
himanshusinghs Oct 1, 2025
2786c47
chore: refactor log placement a little
himanshusinghs Oct 1, 2025
d09a052
chore: remove super long timeout
himanshusinghs Oct 2, 2025
d2187f3
chore: add clarifying comments and use debug notifications
himanshusinghs Oct 2, 2025
4f39d31
chore: make createConnectionManager a static func
himanshusinghs Oct 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ constants.json
.eslintcache
.sbom
src/test/ai-accuracy-tests/test-results.html
.yalc
yalc.lock
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@
},
"mdb.mcp.readOnly": {
"type": "boolean",
"default": false,
"default": true,
"description": "When set to true, MongoDB MCP server will only allow read, connect, and metadata operation types, disabling create/update/delete operations."
},
"mdb.mcp.indexCheck": {
Expand All @@ -1331,11 +1331,16 @@
"mdb.mcp.server": {
"type": "string",
"enum": [
"ask",
"enabled",
"disabled"
"prompt",
"autoStartEnabled",
"autoStartDisabled"
],
"enumItemLabels": [
"Ask",
"Auto Start Enabled",
"Auto Start Disabled"
],
"default": "ask",
"default": "prompt",
"description": "Controls whether MongoDB MCP server starts automatically with the extension and connects to the active connection. If automatic startup is disabled, the server can still be started using the 'MongoDB: Start MCP Server' command."
},
"mdb.mcp.exportsPath": {
Expand Down Expand Up @@ -1418,7 +1423,7 @@
"mongodb-connection-string-url": "^3.0.2",
"mongodb-data-service": "^22.30.1",
"mongodb-log-writer": "^2.4.1",
"mongodb-mcp-server": "^1.0.2-prerelease.1",
"mongodb-mcp-server": "^1.0.2-prerelease.2",
"mongodb-query-parser": "^4.4.2",
"mongodb-schema": "^12.6.2",
"node-machine-id": "1.1.12",
Expand All @@ -1435,6 +1440,7 @@
"devDependencies": {
"@babel/preset-typescript": "^7.25.7",
"@babel/types": "^7.25.8",
"@modelcontextprotocol/sdk": "^1.18.2",
"@mongodb-js/oidc-mock-provider": "^0.11.4",
"@mongodb-js/oidc-plugin": "^2.0.3",
"@mongodb-js/prettier-config-devtools": "^1.0.2",
Expand Down
4 changes: 3 additions & 1 deletion src/connectionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,9 @@ export default class ConnectionController {
return false;
}

const originalDisconnect = this._activeDataService.disconnect.bind(this);
const originalDisconnect = this._activeDataService.disconnect.bind(
this._activeDataService,
);
this._activeDataService = null;

try {
Expand Down
9 changes: 7 additions & 2 deletions src/mcp/mcpConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class MCPConnectionManager extends ConnectionManager {
this.getTelemetryAnonymousId = getTelemetryAnonymousId;
}

connect(): Promise<AnyConnectionState> {
override connect(): Promise<AnyConnectionState> {
return Promise.reject(
new Error(
// eslint-disable-next-line no-multi-str
Expand Down Expand Up @@ -83,7 +83,7 @@ To connect, choose a connection from MongoDB VSCode extensions's sidepanel - htt
}
}

async disconnect(): Promise<ConnectionStateDisconnected> {
override async disconnect(): Promise<ConnectionStateDisconnected> {
try {
await this.activeConnection?.provider?.close();
} catch (error) {
Expand All @@ -100,6 +100,11 @@ To connect, choose a connection from MongoDB VSCode extensions's sidepanel - htt
});
}

override async close(): Promise<void> {
await this.disconnect();
this._events.emit('close', this.currentConnectionState);
}

async updateConnection(
connectParams: MCPConnectParams | undefined,
): Promise<void> {
Expand Down
Loading