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:
logPathoption in a JSON configuration file or on a command line when you start the MCP ServerMDB_MCP_LOG_PATHenvironment 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 Connection Strings.
HTTP Transport Issues
If you're using HTTP transport and experiencing connection issues:
Verify that your client connection URL includes the
/mcpendpoint 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.0to 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.
Atlas Tools vs Database Tools Configuration Guide
Overview
The MongoDB MCP Server provides three main categories of tools: Atlas tools for managing Atlas infrastructure, Local Atlas tools for managing local deployments similarly to what the Atlas CLI offers, and Database tools for data operations. The following table compares the configuration of each tool.
Configuration Comparison Table
Configuration Aspect | Atlas Tools | Local Atlas Tools | Database Tools |
|---|---|---|---|
Authentication Requirements | Required: Atlas API credentials | Required: Docker runtime | Optional: Multiple connection methods |
Connection Method | API-based connection to Atlas Management API | Local deployment management | Direct connection to MongoDB database. Multiple options available: |
Permission Requirements | Service Account Roles (Atlas project-level): | System Requirements: | Database User Roles (when applicable): |
Configuration Options | Environment Variables: | Environment Variables: | Environment Variables (optional): |
Read-Only Mode Impact | • Read operations: ✅ Available | • Local deployment creation: ✅ Available | • Read operations: ✅ Available |
Tool Categories | Can be disabled with: | Can be disabled with: | Can be disabled with: |
Network Requirements | Outbound HTTPS to Atlas API: | Local Docker Network: | Connection to MongoDB cluster (when applicable): |
Available Operations | • Organization management | • Local deployment creation and management | • CRUD operations (find, insert, update, delete) |
Error Scenarios | Missing API Credentials: | Docker Unavailable: | Connection Failures (when configured): |
Temporary Credentials | Not applicable: | Not applicable: | Auto-generated database users (when applicable): |
Database Connection Methods
The Database tools support multiple connection methods to accommodate different use cases and security requirements:
Pre-configured Connection String: Configure
connectionStringvia CLI, environment variable, or configuration file for persistent database access.Atlas Cluster Connect: Use
atlas-connect-clustertool with Atlas API credentials to automatically discover and connect to Atlas clusters.Runtime Connection: Use the
connecttool to provide connection strings interactively during LLM conversations - no pre-configuration required.Local Deployment Connection: Use
atlas-local-connect-deploymentwith Docker to create and connect to local Atlas deployments - requires Docker but no configuration.
Security Recommendations:
Production databases: Use pre-configured connection strings via environment variables or Atlas API credentials for secure, automated connections.
Development/testing: Runtime connection or local deployments provide flexibility without persistent configuration.
Chat security: Avoid runtime connection methods unless you're confident chat history won't be stored or shared with third parties.