Skip to content

feat: add atlas-create-free-cluster atlas-inspect-cluster tools #29

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 7 commits into from
Apr 9, 2025

Conversation

fmenezes
Copy link
Collaborator

@fmenezes fmenezes commented Apr 9, 2025

  • add atlas-create-free-cluster tool
  • add atlas-inspect-cluster tool
  • rename auth tool to atlas-auth tool
  • rename listClusters tool to atlas-list-clusters tool
  • rename listProjects tool to atlas-list-projects tool
  • add npm run generate to auto generate required API types from openapi spec

@fmenezes fmenezes marked this pull request as ready for review April 9, 2025 14:04
@blva blva requested a review from Copilot April 9, 2025 14:30
Copy link
Contributor

@Copilot 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

nirinchev
nirinchev previously approved these changes Apr 9, 2025
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.

Looks good, just a few minor notes.

package.json Outdated
Comment on lines 31 to 35
"generate:download": "curl -Lo ./scripts/spec.json https://github.com/mongodb/openapi/raw/refs/heads/main/openapi/v2/openapi-2025-03-12.json",
"generate:filter": "tsx ./scripts/filter.ts > ./scripts/filteredSpec.json < ./scripts/spec.json",
"generate:bundle": "redocly bundle --ext json --remove-unused-components ./scripts/filteredSpec.json --output ./scripts/bundledSpec.json",
"generate:openapi": "openapi-typescript ./scripts/bundledSpec.json --root-types-no-schema-prefix --root-types --output ./src/common/atlas/openapi.d.ts",
"generate:clear": "rm -rf ./scripts/bundledSpec.json ./scripts/filteredSpec.json ./scripts/spec.json",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Super nit, but these seem to be very dependent on the order of execution, so not sure if it's that useful to have them as separate scripts - it doesn't seem like they'd be really useful on their own.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the only reason they are separated is that it was challenging to implement in one go, we could move it to bash but it also felt a bit weird to do so

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

replaced with a bash

@@ -24,24 +24,35 @@
"build": "npm run build:clean && npm run build:compile && npm run build:addshebang && npm run build:chmod",
"inspect": "npm run build && mcp-inspector -- dist/index.js",
"prettier": "prettier",
"check": "npm run check:lint && npm run check:format",
"check": "npm run build && npm run check:lint && npm run check:format",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nirinchev I'm adding build here, I've seen some weird bug where the source was not compiling but the styles were passing 🤷‍♂️

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, sounds good. I was thinking of adding a build step on CI anyway, but that's also fine. Our project builds fairly quickly still, so I'm not really worried about the extra couple of seconds it adds.

Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can be a follow-up PR- we should update our readme with the right commands to run

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right now npm run check should check everything

package.json Outdated
"generate:download": "curl -Lo ./scripts/spec.json https://github.com/mongodb/openapi/raw/refs/heads/main/openapi/v2/openapi-2025-03-12.json",
"generate:filter": "tsx ./scripts/filter.ts > ./scripts/filteredSpec.json < ./scripts/spec.json",
"generate:bundle": "redocly bundle --ext json --remove-unused-components ./scripts/filteredSpec.json --output ./scripts/bundledSpec.json",
"generate:openapi": "openapi-typescript ./scripts/bundledSpec.json --root-types-no-schema-prefix --root-types --output ./src/common/atlas/openapi.d.ts",
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can create an issue if it requires more changes - can we have per-path or per operationID files?

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 don't think the tool supports it

blva
blva previously approved these changes Apr 9, 2025
@fmenezes fmenezes dismissed stale reviews from blva and nirinchev via 10dd98b April 9, 2025 14:52
@fmenezes fmenezes merged commit aad8b01 into main Apr 9, 2025
1 check passed
@fmenezes fmenezes deleted the fmenezes/create_cluster_tool branch April 9, 2025 14:53
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.

3 participants