Vscode
Connect to MongoDB and Atlas and directly from your VS Code environment, navigate your databases and collections, inspect your schema and use playgrounds to prototype queries and aggregations.
Install / Use
/learn @mongodb-js/VscodeQuality Score
Category
Development & EngineeringSupported Platforms
README
MongoDB for VS Code
MongoDB for VS Code makes it easy to work with your data in MongoDB directly from your VS Code environment. MongoDB for VS Code is the perfect companion for MongoDB Atlas, but you can also use it with your self-managed MongoDB instances.
<p align="center"> <a title="Watch the MongoDB for VS Code demo video" href="https://mdb.link/vs-code-demo-video"> <img src="https://github.com/mongodb-js/vscode/raw/main/resources/screenshots/get-started.png" width="700" alt="MongoDB for VS Code demo video call to action"> </a> </p>Features
Navigate your MongoDB Data
- Navigate your databases, collections, and read-only views
- See the documents in your collections
- Edit documents and save changes to the database
- Get a quick overview of your schema and your indexes
Read more about this functionality in the online documentation.

MongoDB Playgrounds
MongoDB Playgrounds are the most convenient way to prototype and execute CRUD operations and other MongoDB commands directly inside VS Code.
- Prototype your queries, aggregations, and MongoDB commands with convenient syntax highlighting and intelligent autocomplete for MongoDB Shell API, BSON types, MongoDB Query API, system variables, and for database, collection, and field names.
- Run your playgrounds and see the results instantly. Click the play button in the tab bar to see the output.
- Edit documents returned by your playground.
- Save your playground together with your application code to always have a place where all your queries are documented and can be tested just with one click.

Note: Make sure you are connected to a server or cluster before using a playground. You can't run a playground and you won't get intelligent completions if you are not connected.
From Query API to your favorite language
Select queries and aggregations within your Playground files and translate them into your favorite programming language. Supported languages are:
- Java
- Node.js
- C#
- Python 3
- Ruby
- Go
- Rust
- PHP

Document Editing
Editing documents with MongoDB for VS Code is as natural as editing any file in the code editor. Open a document in an editor tab, edit it, and save the changes back to MongoDB.

Quick access to the MongoDB Shell
Launch the MongoDB Shell from the command palette to quickly connect to the same cluster you have active in VS Code.

Note: The mongosh binary needs to be in your $PATH. You can download the mongosh from the MongoDB Download Center.
Terraform snippet for MongoDB Atlas
If you use Terraform to manage your infrastructure, MongoDB for VS Code helps you get started with the MongoDB Atlas Provider. Just open a Terraform file, type atlas and you are good to go.

Atlas Stream Processing
Connect to Atlas Stream Processing instances and develop stream processors using playgrounds.

MongoDB Copilot Participant
Use natural language to interact with your clusters and generate MongoDB-related code with GitHub Copilot Chat in VS Code.
Note: To use the MongoDB Participant, you must have the GitHub Copilot extension. By using Copilot Chat you agree to GitHub Copilot chat preview terms. Find more details about the MongoDB GenAI Features in the FAQ.
How to use the MongoDB Participant
- Enter
@MongoDBin the chat input field to start a conversation with the MongoDB Participant.

- Start typing
/in the chat window to get the list of available chat participant commands.

/docsis a participant command that finds answers to coding-related questions in the MongoDB documentation./queryis a participant command that generates MongoDB queries from natural language to be used with a connected MongoDB cluster. It generates both queries and aggregations depending on the complexity of the request. It utilizes schema to reduce model hallucinations. It provides a code action to open generated code in a playground and an action to directly run the code from the Copilot chat interface./schemais a participant command that analyzes and returns information about a collection's schema.
Extension Settings
| Setting | Description | Default |
| - | - | - |
| mdb.shell | The MongoDB shell to use ( mongosh or the legacy mongo ). | mongosh |
| mdb.defaultDocumentDisplayName | The field to use for file names when displaying a document. This is an ordered array, if the field is not found, it falls back to using the next field. | ["name","title","_id"] |
| mdb.showMongoDBConnectionExplorer | Show or hide the MongoDB Connection explorer. | true |
| mdb.showMongoDBPlaygrounds | Show or hide the MongoDB Playgrounds explorer. | true |
| mdb.showMongoDBHelpExplorer | Show or hide the MongoDB Help panel. | true |
| mdb.defaultLimit | The number of documents to fetch when viewing documents from a collection. | 10 |
| mdb.documentViewAndEditFormat | The format in which documents and playground results are shown. | shell |
| mdb.confirmRunAll | Show a confirmation message before running commands in a playground. | true |
| mdb.confirmRunCopilotCode | Show a confirmation message before running code generated by the MongoDB participant. | true |
| mdb.useSampleDocsInCopilot | Enable sending sample field values with the VSCode copilot chat @MongoDB participant /query command. | false |
| mdb.confirmDeleteDocument | Show a confirmation message before deleting a document in the tree view. | true |
| mdb.persistOIDCTokens | Remain logged in when using the MONGODB-OIDC authentication mechanism for MongoDB server connection. Access tokens are encrypted using the system keychain before being stored. | true |
| mdb.showOIDCDeviceAuthFlow | Opt-in and opt-out for diagnostic and telemetry collection. | true |
| mdb.browserCommandForOIDCAuth | Command to be used as browser for facilitating OIDC auth redirects | "" |
| mdb.excludeFromPlaygroundsSearch | Exclude files and folders while searching for playground files in the current workspace. | Refer to package.json |
| mdb.connectionSaving. defaultConnectionSavingLocation | When the setting that hides the option to choose where to save new connections is checked, this setting sets if and where new connections are saved. | Global |
| mdb.useDefaultTemplateForPlayground | Choose whether to use the default template for playground files or to start with an empty playground editor. | true |
| mdb.uniqueObjectIdPerCursor | The default behavior is to generate a single ObjectId and insert it on all cursors. Set to true to generate a unique ObjectId per cursor instead. | false |
| mdb.sendTelemetry | Opt-in and opt-out for diagnostic and telemetry collection. | true |
| mdb.useSampleDocsInCopilot | Enable sending sample field values with the VSCode copilot chat @MongoDB participant /query command. | false |
Additional Settings
Autocomplete
Note: these global settings affect how MongoDB for VS Code provides intelligent autocomplete inside snippets and string literals (off by default). Changing the default configuration may affect the behavior and performance of other extensions and of VS Code itself. If you do not change the default settings, you can still trigger intelligent autocomplete inside a snippet or string literal with Ctrl+Space.
editor.suggest.snippetsPreventQuickSuggestions: By default, VS Code prevents code completion in snippet mode (editing placeholders in inserted code). Setting this tofalseallows snippet (eg.$match,$addFields) and field completion based on the document schema for thedb.collection.aggregate()expressions.editor.quickSuggestions: By default, VS Code prevents code completion inside string literals. To enable database names completions foruse('dbName')expression use this configuration:
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
}
Syntax Highlighting
MongoDB playgrounds are JavaScript files, which causes JavaScript syntax highlighting to override any customizations made to the MongoDB syntax colors.
Currently, there is no way to resolve this except for turning off semantic highlighting for a current workspace, or for all themes that are being used by setting editor.semanticHighlighting.enabled to false.
Telemetry
MongoDB for VS Code collec
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
notion
347.0kNotion API for creating and managing pages, databases, and blocks.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
