Use the information on this page to help troubleshoot issues with the MongoDB MCP Server.
Log Files
If you have issues with the MCP Server, examine the MCP Server logs for information that can help troubleshoot the problem.
By default, the MCP Server writes the logs to disk and also sends the
logs to the MCP client. You can change the loggers
option to specify
where the logs are sent. For details about the MCP Server options, see
MongoDB MCP Server Configuration Options.
The following table shows the default directories where the MCP Server stores the log files:
Operating System | Default Log Directory |
---|---|
Windows |
|
macOS and Linux |
|
To change the log path, set one of these:
logPath
option in a JSON configuration file or on a command line when you start the MCP ServerMDB_MCP_LOG_PATH
environment variable
Connection String Issues
Ensure that your configuration file is correct and that you're using a valid connection string for your MongoDB deployment.
For connection string formatting and examples, see connections-connection-examples.
HTTP Transport Issues
If you're using HTTP transport and experiencing connection issues:
Verify that your client connection URL includes the
/mcp
endpoint path:http://<server-address>:3000/mcp If connecting to a remote server (different computer, container, or cloud instance), ensure the server is started with
--httpHost=0.0.0.0
to accept remote connections:npx -y mongodb-mcp-server@latest --transport http --httpHost=0.0.0.0 --readOnly Ensure that the specified port is open and accessible from your client computer.