Docs Menu
Docs Home
/
VS Code Extension
/

Visual Studio Code Settings

This document lists the configurable settings for VS Code Extension.

To configure VS Code Extension settings:

1
Operating System
Method
Actions

Any

Visual Studio Code Menu

File / Code > Preferences > Settings

MacOS

Keyboard Shortcut

Press Command + ,

Windows and Linux

Keyboard Shortcut

Press Ctrl + ,

2

VS Code Extension extension settings are displayed. Changes you make are saved automatically.

The following table lists the available settings for VS Code Extension:

Setting
Description
Default

Shell

MongoDB shell to use. Choose either:

  • mongo (the legacy MongoDB shell), or

  • mongosh (the new MongoDB shell)

To launch your selected MongoDB shell, you must:

  • Install the shell you want to use, and

  • Configure your machine's PATH environment variable to include the filepath to your shell binary.

If you install a new version of your MongoDB shell, you will need to update your PATH variable to reference the new version.

  • To install the legacy mongo shell, see The mongo Shell.

  • To install the mongosh shell and for instructions on configuring your PATH variable, see Install the MongoDB Shell.

mongosh

Show

If enabled, shows the MongoDB view in the Visual Studio Code left navigation panel.

Enabled

Max Number of Problems

The maximum number of problems VS Code Extension will generate in the Visual Studio Code Problems view.

100

Trace: Server

MongoDB language server logging settings.

Edit this setting through the mongodbLanguageServer.trace.server property in your project's settings.json file.

Within the mongodbLanguageServer.trace.server object, you can specify:

  • format, and

  • verbosity

Output logs are viewable by selecting MongoDB Language Server from the dropdown in the Output view, or with the Language Server Protocol Inspector.

{
"format": "json",
"verbosity": "verbose"
}

Confirm Run All

If enabled, shows a confirmation message before running commands in a playground.

Enabled

Default Connection Saving Location

Sets if and where new connections are saved.

You can select:

Setting
Description

Global

Save your connection globally in VS Code, so it can be accessed from any workspace.

Workspace

Save your connection in your workspace. You cannot access the connection from a different workspace.

Session

Save the connection for only this VS Code session. The connection is lost when you close VS Code.

Global

Hide Option To Choose Where To Save New Connections

If disabled, you are prompted to choose where to save each new connection.

If enabled, new connections are automatically saved to the Default Connection Saving Location without prompt.

Enabled

Default Limit

Number of documents to fetch when viewing documents from a collection. Does not affect playground operations.

10

Preset Connections

Specifies a preset list of connections. Use this setting to share connection configurations in a workspace or global scope.

Edit the mdb.presetConnection property in your project's settings.json file.

Within the mdb.presetConnections object, you can specify:

  • A name for the connection.

  • A connectionString for your deployment.

WARNING: Do not store sensitive credentials in this setting. Connection strings are stored in plain text, so they can be easily accessed.

[
{
"name": "Preset Connection",
"connectionString": "mongodb://localhost:27017"
}
]

Send Telemetry

If enabled, allows the collection of anonymous diagnostic and usage telemetry data to help improve VS Code Extension.

Enabled

Use Default Template For Playground

If enabled, playground files load with a template containing sample commands.

If disabled, playground files load with an empty playground editor.

Enabled

MCP: Server

Controls whether the MongoDB MCP server starts automatically when VS Code opens and connects to the active connection.

  • If set to ask, the extension starts the MCP server automatically and then asks if you want to keep this behavior. If the setting remains as ask, this notification appears each time you start VS Code.

  • If enabled, the server starts automatically when VS Code opens.

  • If disabled, the server does not start automatically and you must start the server manually by using the Start MCP Server command.

Note

The first time the server starts automatically, VS Code displays a notification asking if you want to keep this behavior. Your choice automatically updates this setting.

When the MCP server is not running, use the MongoDB: Start MCP Server command to start the MCP server immediately.

ask

MCP: Api Base URL

If you're using a custom Atlas deployment, specify the API URL used by the MongoDB MCP server that enables Atlas MCP tools.

https://cloud.mongodb.com/

MCP: Api Client ID

Atlas API client ID for authenticating against the Atlas API. Use a Service Account for programmatic access to Atlas APIs. Required for enabling Atlas tools in MongoDB MCP server. Store your ID securely and do not commit it to version control.

To learn more, see Connecting with Atlas API Credentials.

Empty

MCP: Api Client Secret

Atlas API client secret for authenticating against the Atlas API. Use a Service Account for programmatic access to Atlas APIs. Required for enabling Atlas tools in MongoDB MCP server. Store this securely and do not commit to version control.

To learn more, see Connecting with Atlas API Credentials.

Empty

MCP: Disabled Tools

Tool names, operation types (create, update, delete, read, metadata), or categories (atlas, mongodb) to disable when using the MongoDB MCP server.

Empty

MCP Export Cleanup Interval Ms

How often (in milliseconds) the MongoDB MCP server runs the export cleanup process to remove expired files. Default is 2 minutes (120000ms).

120000

MCP Exports Path

The directory where the MongoDB MCP server exports data when using the export tool. Ensure that the path is available for writes or leave this setting empty to use the default path based on your operating system.

Default paths:

  • Windows: %LOCALAPPDATA%\mongodb\mongodb-mcp\exports

  • macOS and Linux: ~/.mongodb/mongodb-mcp/exports

Empty

MCP Export Timeout Ms

The maximum time in milliseconds an export operation can run before MongoDB MCP server terminates it. Default is 5 minutes (300000ms).

300000

MCP Index Check

When enabled, the MongoDB MCP server enforces that query operations must use an index, and rejects queries that perform a collection scan. This helps prevent performance issues in production environments.

Disabled

MCP: Read Only

When enabled, the MongoDB MCP server only allows read, connect, and metadata operation types. Create, update, and delete operations are disabled.

Disabled

Back

Commands

Next

Changelog

On this page