MongoDB and MCP server tools not connecting via Chainlit application
Closed this issue · 4 comments
Description:
I am able to run the MongoDB MCP server tools and connect to MongoDB successfully in standalone mode via port forwarding. However, when I try to query the database through the Chainlit application, neither the database nor the MCP server tools are connecting.
Steps to Reproduce:
1.Start MongoDB MCP server tools using the standard commands.
2. Confirm that tools load correctly and list available functions.
- Connect to MongoDB using mongosh CLI:npx -y mongosh "mongodb://:@:/?authSource=admin"
- Connection succeeds, MongoDB is accessible via CLI.
- Attempt to query the same database via the Chainlit application.
- The application fails to connect to MongoDB and MCP server tools.
Expected Behavior:
The Chainlit application should be able to connect to MongoDB and the MCP server tools just like in standalone mode.
Actual Behavior:
Connection fails when using the Chainlit application.
Thanks for opening this issue. The ticket MCP-253 was created for internal tracking.
Hi @Pradhisha-289248 ,
Can you provide the MCP Server configuration with the anonymised connection string that you are using? From the list of tools you are providing, there is a "connect" tool, which leads to a possible misconfiguration. In the situation that the MCP is connected, the "connect" tool does not exist, and there is a new tool named "switch-connection".
And for some extra context - connecting to a database via mongosh would not make the mcp server connect to it - those are two separate tools that do not share state.
The corresponding JIRA ticket has been automatically closed.