Skip to content

Conversation

himanshusinghs
Copy link
Contributor

Description

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

LogPayload,
UserConfig,
ConnectionManagerFactoryFn,
} from '@himanshusinghs/mongodb-mcp-server';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is temporary until we release the mongodb-mcp-server with injectable connection manager work.

try {
const serviceProvider = await NodeDriverServiceProvider.connect(
connectParams.connectionString,
connectParams.connectOptions,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's one thing that is bothering me here about connectOptions and that's the appName attribute. In MCP server, we go a stretch to ensure the appName but we don't do that here. That means the appName will be how VSCode extension sets it, in here.

Should we instead set the appName to something like vscode-mcp-xxx?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is relevant for analytics

@himanshusinghs himanshusinghs marked this pull request as ready for review August 29, 2025 11:02
@himanshusinghs himanshusinghs requested a review from a team as a code owner August 29, 2025 11:02
Copy link
Contributor

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

I went through the implementation and it seems mostly okay - I have mostly design suggestions.

One thing that might be curious to test out in the real world is how the LLM behaves when we switch connections - I've seen sometimes LLMs will pull certain results out of the context instead of invoking the tool again. For example, if you ask "what are my databases", then switch the connection, then ask again, the model might decide to just regurgitate the previous response until you actively ask it to fetch them again. We should see if that's a real problem and if it is, explore if exposing a resource for the current connection, that we update and send update notifications for, might solve it.

Base automatically changed from ni/start-mcp-server to feat/mcp-integration August 29, 2025 11:44
@himanshusinghs himanshusinghs force-pushed the chore/MCP-131-vscode-connection-manager branch from e2fcdf9 to c3f72cb Compare August 29, 2025 11:58
@himanshusinghs
Copy link
Contributor Author

himanshusinghs commented Aug 29, 2025

One thing that might be curious to test out in the real world is how the LLM behaves when we switch connections - I've seen sometimes LLMs will pull certain results out of the context instead of invoking the tool again.

Yea I have seen this as well! I don't think having resources are going to help in this case because resources are application controlled. Until user decide to put resource in context, LLM won't know if something is happening with the resources. The resource notifications are limited to the MCP client and wouldn't expect MCP client to pass the updated resource (even notification) to LLM without explicit user action.

@himanshusinghs
Copy link
Contributor Author

himanshusinghs commented Aug 29, 2025

I would like to correct myself. From the docs on Resources, it seems applications are allowed to decide if they want to automatically include the resource in the context.

In that case, we should certainly try if having resource changes the situation by any means. I will set up a follow up for this, if that sounds alright?

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