Skip to content

chore: default examples with --readOnly #347

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
Jul 9, 2025
Merged

chore: default examples with --readOnly #347

merged 7 commits into from
Jul 9, 2025

Conversation

blva
Copy link
Collaborator

@blva blva commented Jul 9, 2025

Proposed changes

  • updates all examples to use --readOnly
  • updates badges to use --readOnly

Checklist

@blva blva marked this pull request as ready for review July 9, 2025 14:11
@Copilot Copilot AI review requested due to automatic review settings July 9, 2025 14:11
@blva blva requested a review from a team as a code owner July 9, 2025 14:11
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.

Pull Request Overview

This PR updates all Quick Start examples and badges in README.md to include the --readOnly flag by default, ensuring safer, read-only access.

  • Added --readOnly to all npx, JSON config, and Docker examples.
  • Introduced a Default Safety Notice about read-only mode.
  • Updated VS Code and Cursor install badges to pass the new flag.
Comments suppressed due to low confidence (2)

README.md:45

  • [nitpick] This note is missing the > markdown blockquote marker, making its formatting inconsistent with other callouts in the document. Consider adding > before it for consistency.
**Note:** When using Atlas API credentials, be sure to assign only the minimum required permissions to your service account. See [Atlas API Permissions](#atlas-api-permissions) for details.

README.md:2

  • The Cursor install badge config URL parameter uses a different encoding format and may not decode correctly. Consider encoding the updated JSON config as Base64 or ensuring consistency with the original format.
[![Install in Cursor](https://img.shields.io/badge/Cursor-Install_Server-1e1e1e?logo=data:image/svg%2bxml;base64,PHN2ZyBoZWlnaHQ9IjFlbSIgc3R5bGU9ImZsZXg6bm9uZTtsaW5lLWhlaWdodDoxIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxZW0iCiAgICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHRpdGxlPkN1cnNvcjwvdGl0bGU+CiAgICA8cGF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kaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9ImxvYmUtaWNvbnMtY3Vyc29ydW5kZWZpbmVkLWZpbGwtMSIKICAgICAgICAgICAgeDE9IjIyLjM1IiB4Mj0iMTEuOTI1IiB5MT0iNi4wMzciIHkyPSIxMi4xNSI+CiAgICAgICAgICAgIDxzdG9wIG9mZnNldD0iLjE4MiIgc3RvcC1jb2xvcj0iI2ZmZiIgc3RvcC1vcGFjaXR5PSIuMzEiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agb2Zmc2V0PSIuNzE1IiBzdG9wLWNvbG9yPSIjZmZmIiBzdG9wLW9wYWNpdHk9IjAiPjwvc3RvcD4KICAgICAgICA8L2xpbmVhckdyYWRpZW50PgogICAgICAgIDxsaW5lYXJHcmFkaWVudCBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaWQ9ImxvYmUtaWNvbnMtY3Vyc29ydW5kZWZpbmVkLWZpbGwtMiIKICAgICAgICAgICAgeDE9IjExLjkyNSIgeDI9IjEuNSIgeTE9IjAiIHkyPSIxOCI+CiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNmZmYiIHN0b3Atb3BhY2l0eT0iLjYiPjwvc3RvcD4KICAgICAgICAgICAgPHN0b3Agb2Zmc2V0PSIuNjY3IiBzdG9wLWNvbG9yPSIjZmZmIiBzdG9wLW9wYWNpdHk9Ii4yMiI+PC9zdG9wPgogICAgICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8L2RlZnM+Cjwvc3ZnPgo=)](https://cursor.com/install-mcp?name=MongoDB&config=JTdCJTIyY29tbWFuZCUyMiUzQSUyMm5weCUyMC15JTIwbW9uZ29kYi1tY3Atc2VydmVyJTIwLS1yZWFkT25seSUyMiU3RA%3D%3D)

README.md Outdated
@@ -131,15 +135,15 @@ You may provide either a MongoDB connection string OR Atlas API credentials:

```shell
docker run --rm -i \
mongodb/mongodb-mcp-server:latest
mongodb/mongodb-mcp-server:latest --readOnly
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we sure this is passing the args correctly to the server or do we need a -- first? I'm a docker noob, so sorry if it's a stupid question 🫣

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nope! It was my auto-complete everywhere, let me fix to follow the pattern of using env variables

@@ -179,7 +189,8 @@ With connection string:
"-i",
"-e",
"MDB_MCP_CONNECTION_STRING=mongodb+srv://username:[email protected]/myDatabase",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems to be passing the config parameters via env variables - I think we should consistently use the same patterns (i.e. either command-line args or env variables).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nice catch! thx updating

@blva blva requested a review from nirinchev July 9, 2025 16:51
@blva blva enabled auto-merge (squash) July 9, 2025 16:56
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.

One missed update, otherwise, seems good from my side

@@ -148,7 +153,7 @@ docker run --rm -i \
docker run --rm -i \
-e MDB_MCP_API_CLIENT_ID="your-atlas-service-accounts-client-id" \
-e MDB_MCP_API_CLIENT_SECRET="your-atlas-service-accounts-client-secret" \
mongodb/mongodb-mcp-server:latest
mongodb/mongodb-mcp-server:latest --readOnly
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
mongodb/mongodb-mcp-server:latest --readOnly
-e MDB_MCP_READ_ONLY="true" \
mongodb/mongodb-mcp-server:latest

@blva blva merged commit 3cd798b into main Jul 9, 2025
17 checks passed
@blva blva deleted the default-read-only branch July 9, 2025 17:45
@nirinchev nirinchev mentioned this pull request Jul 9, 2025
1 task
nirinchev added a commit that referenced this pull request Jul 10, 2025
* main:
  chore: bump dependencies (#346)
  chore: fix cursor link (#351)
  chore: move --readOnly to env var (#350)
  chore: default examples with --readOnly (#347)
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