Skip to content

chore: Improve access list and connect experienece [MCP-5] #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 17, 2025
Merged

Conversation

blva
Copy link
Collaborator

@blva blva commented Jul 15, 2025

Proposed changes

  • Updated all tools and helpers to use the shared function for adding the current IP.

Checklist

@coveralls
Copy link
Collaborator

coveralls commented Jul 15, 2025

Pull Request Test Coverage Report for Build 16350134895

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 61 of 64 (95.31%) changed or added relevant lines in 6 files are covered.
  • 8 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 77.592%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/common/atlas/accessListUtils.ts 40 43 93.02%
Files with Coverage Reduction New Missed Lines %
src/tools/atlas/connect/connectCluster.ts 8 70.82%
Totals Coverage Status
Change from base Build 16294764740: 0.01%
Covered Lines: 2879
Relevant Lines: 3665

💛 - Coveralls

@blva blva marked this pull request as ready for review July 15, 2025 13:44
@blva blva requested a review from a team as a code owner July 15, 2025 13:44
Copy link
Collaborator

@nirinchev nirinchev left a comment

Choose a reason for hiding this comment

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

Mostly nits/questions, but nothing blocking from me.

*/
export async function ensureCurrentIpInAccessList(apiClient: ApiClient, projectId: string): Promise<void> {
// Get the current public IP
const entry = await makeCurrentIpAccessListEntry(apiClient, projectId, "Added by MCP pre-run access list helper");
Copy link
Collaborator

Choose a reason for hiding this comment

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

[nit] Is that comment helpful externally? If I was a user and saw that, I wouldn't know what it means.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I updated a bit more, but I think it's helpful to know where the new access list entry came from

@@ -2,6 +2,7 @@ import { z } from "zod";
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
import { AtlasToolBase } from "../atlasTool.js";
import { ToolArgs, OperationType } from "../../tool.js";
import { makeCurrentIpAccessListEntry } from "../../../common/atlas/accessListUtils.js";

const DEFAULT_COMMENT = "Added by Atlas MCP";
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is duplicated now - should we move it to accessListUtils?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, updated!

// 409 Conflict: entry already exists, ignore
return;
}
logger.debug(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is silently ignoring the error - does it make sense that we do that? I assume that this could give users the false impression everything is working and then hit an issue with the IP address config at a later point?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes for now, there are different configurations where user does not have access to add access list but has accsess to proceed with the tool call, I'd like to avoid causing errors and having the logs to troubleshoot for now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To be clear - I'm not sure about those scenarios but was trying to avoid causing disruption. If you think the risk is too low I can throw the error back. Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, not sure either, just not ideal that this function seems like a prerequisite for many features, but we're not communicating to the user that something might have gone wrong. I would say this PR is a clear improvement to the status quo, and the worst case of this failing and us logging it is no worse than what we currently have, so fine with keeping it as is. I guess we can at least bump the log level to warn so that it's a bit more prominent.

@blva blva requested a review from nirinchev July 15, 2025 15:11
// 409 Conflict: entry already exists, ignore
return;
}
logger.debug(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, not sure either, just not ideal that this function seems like a prerequisite for many features, but we're not communicating to the user that something might have gone wrong. I would say this PR is a clear improvement to the status quo, and the worst case of this failing and us logging it is no worse than what we currently have, so fine with keeping it as is. I guess we can at least bump the log level to warn so that it's a bit more prominent.

@fmenezes fmenezes enabled auto-merge (squash) July 17, 2025 16:05
@fmenezes fmenezes merged commit 2941dde into main Jul 17, 2025
16 checks passed
@fmenezes fmenezes deleted the MCP-5 branch July 17, 2025 16:10
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.

4 participants