Skip to content

Connection string is not retained when LLM tries to reconnect #92

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

Closed
GaurabAryal opened this issue Apr 23, 2025 · 5 comments · Fixed by #118
Closed

Connection string is not retained when LLM tries to reconnect #92

GaurabAryal opened this issue Apr 23, 2025 · 5 comments · Fixed by #118
Assignees

Comments

@GaurabAryal
Copy link

If I pass connection string in the launch command or define it in an env var, when Cursor calls the Connect tool the second time (with some amount of delay between the first successful connection attempt), sometimes MCP doesn't appear to know what the connection string is.

@nirinchev
Copy link
Collaborator

We recently resolved #80, which appears to be somewhat related here. Do you think you can test with latest main and confirm you're still seeing this problem?

@GaurabAryal
Copy link
Author

@nirinchev – Pulled main and tested again - it does appear to be better for sure!

Though I'm wondering why the LLM cannot fetch this from the launch command on the first attempt to connect?

Image
Image

@nirinchev
Copy link
Collaborator

This is not the correct syntax for providing a connection string. Right now we don't take in positional arguments, so you'll need to pass in the arg name like --connectionString mongodb://localhost:58321

@gagik
Copy link
Collaborator

gagik commented Apr 24, 2025

By the way the npx -y /..../dist/index.js seems incorrect and not sure how that works out but you're probably looking for this
in Cursor:

 "MongoDB": {
      "command": "< your full path >/dist/index.js --connectionString mongodb://localhost:58321",
    }

and in VSCode:

 "MongoDB": {
      "type": "stdio",
      "command": "< your full path >/dist/index.js",
      "args": ["--connectionString", "mongodb://localhost:58321"]
    }

@nirinchev
Copy link
Collaborator

I think the args in vscode should be separate, no? Like "args": [ "--connectionString", "mongodb://localhost:58321" ]

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 a pull request may close this issue.

4 participants