Skip to content

Conversation

@cveticm
Copy link
Collaborator

@cveticm cveticm commented Oct 21, 2025

Proposed changes

Adds new optional input for atlas-connect-cluster connectionType. This allows users to connect via standard, private, or private endpoint connection strings.

Manual Testing

Although I was unable to successfully set up a PE to test the connection in a timely manner, I have verified that the PE connection string obtained in this tool matches that which is provided when connection via the Atlas UI.
mongodb+srv://<user>:<password>@<cluster-name>-pl-<...>.mongodb-dev.net/?authSource=admin

JIRA ticket: MCP-259

Checklist

@cveticm cveticm force-pushed the mc/MCP-259_atlas_private_connStr_and_privateEndpoint branch from 4f8f307 to 80b353f Compare October 23, 2025 08:32
@cveticm cveticm marked this pull request as ready for review October 23, 2025 08:39
@cveticm cveticm requested a review from a team as a code owner October 23, 2025 08:39
Copilot AI review requested due to automatic review settings October 23, 2025 08:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for connecting to MongoDB Atlas clusters using private and private endpoint connection strings, in addition to the existing standard connection string option.

Key changes:

  • Introduces a connectionType parameter to the connect-cluster tool, allowing users to specify "standard", "private", or "privateEndpoint" connection types
  • Refactors the cluster data model to store all connection string types instead of just a single connection string
  • Updates cluster listing and inspection tools to display the appropriate connection string based on availability

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/tools/atlas/connect/connectCluster.ts Adds connectionType parameter to support private/privateEndpoint connections and updates connection preparation logic
src/tools/args.ts Defines new connectionType Zod schema with enum validation for the three connection types
src/common/atlas/cluster.ts Adds getConnectionString helper function and refactors Cluster interface to store all connection strings instead of a single string
src/tools/atlas/read/listClusters.ts Updates cluster listing to use new connection strings structure
src/tools/atlas/read/inspectCluster.ts Updates cluster inspection to use new connection strings structure

@cveticm cveticm changed the title MCP-259: Support atlas connect via private and private endpoint connection strings chore: Support atlas connect via private and private endpoint connection strings Oct 23, 2025
Copy link
Collaborator

@gagik gagik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some questions

}
const connectionString = getConnectionString(cluster.connectionStrings, connectionType);
if (connectionString === undefined) {
throw new Error(`Connection string for connection type "${connectionType}" not available`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there something we could instruct or recommend them / the model to do in this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll expand the error message to point to atlas docs on connecting to clusters

@cveticm cveticm merged commit 567d497 into main Oct 23, 2025
19 checks passed
@cveticm cveticm deleted the mc/MCP-259_atlas_private_connStr_and_privateEndpoint branch October 23, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants