mit einem Klick
configure-mongodb-mcp
// Guide users through configuring key MongoDB MCP server options. Use this skill when a user wants to set up or modify their MongoDB MCP server configuration.
// Guide users through configuring key MongoDB MCP server options. Use this skill when a user wants to set up or modify their MongoDB MCP server configuration.
| name | configure-mongodb-mcp |
| description | Guide users through configuring key MongoDB MCP server options. Use this skill when a user wants to set up or modify their MongoDB MCP server configuration. |
This skill guides users through configuring the MongoDB MCP server for use with an agentic client.
The MongoDB MCP Server is embedded within the VSCode extension. It uses the active connection the VSCode extension is connected to, but there are other configuration options that users may want to set up, such as:
The first step is to determine the current configuration - the final config is the merged result from the user config and the workspace config. The user config is located at:
%APPDATA%\Code\User\settings.json on Windows~/Library/Application Support/Code/User/settings.json on macOS~/.config/Code/User/settings.json on LinuxThe workspace config is located at .vscode/settings.json within the current workspace.
The MCP configuration options are prefixed with mdb.mcp - for example, mdb.mcp.apiClientId. Settings in the workspace config take priority over the user config settings.
Additionally, review the environment variables for MCP server config - those variables should start with MDB_MCP_ - for example, MDB_MCP_API_CLIENT_ID. Environment variables are not used for configuration, but if they are set, offer to migrate them into the settings file and confirm with the user before writing.
The next step is to guide the user through the various configuration options. First, remind them that the VSCode extension and the Agent will share the connection, so if they need to connect to specific Atlas cluster, they can do it from the VSCode extension itself. For each option, provide a brief description and ask the user if they want to configure it. If they say yes, prompt them for the necessary information. Make sure to prompt the user if they want to update the user config or the workspace config.
mdb.mcp.apiClientId + mdb.mcp.apiClientSecret)Type: string (both) | Default: "" (disabled) | Corresponding environment variables: MDB_MCP_API_CLIENT_ID, MDB_MCP_API_CLIENT_SECRET
When both mdb.mcp.apiClientId and mdb.mcp.apiClientSecret are set, the MCP server authenticates against the Atlas Admin API and unlocks Atlas-specific tools — such as retrieving performance metrics, managing database users, listing clusters, and other Atlas administration operations.
How to obtain credentials:
Follow the official MongoDB MCP Server prerequisites guide: https://www.mongodb.com/docs/mcp-server/prerequisites/
Key steps:
Organization Read Only for read-only Atlas tools).How to set it up:
Add both values to your settings file:
"mdb.mcp.apiClientId": "<your-client-id>",
"mdb.mcp.apiClientSecret": "<your-client-secret>"
Security: Never commit these values to version control. Store them in your user-level settings (
~/Library/Application Support/Code/User/settings.jsonon macOS) rather than the workspace.vscode/settings.jsonto avoid accidentally exposing them. Don't ask the user for the precise values - instead, guide them through the process of obtaining the credentials from Atlas and instruct them to paste the values into their settings file themselves.
mdb.mcp.readOnlyType: boolean | Default: true | Corresponding environment variable: MDB_MCP_READ_ONLY
Controls whether the MCP server exposes write operations to the connected agent. When true (the default), only read, and metadata operation types are available — create, update, and delete operations are disabled. Set to false to allow the agent to perform write operations against the database.
How to set it up:
"mdb.mcp.readOnly": true
"mdb.mcp.readOnly": false
Recommendation: Keep
readOnly: truein shared or production-facing workspace settings. Only disable it in workspace settings when you explicitly need the agent to write data, and use a workspace config rather than user-level config so the permission is project-scoped.
mdb.mcp.serverType: string (enum) | Default: "prompt" | Corresponding environment variable: none - this is a vscode-only setting
Controls whether the MongoDB MCP server starts automatically when the VS Code extension loads, or requires manual startup. The server connects to whichever connection is currently active in the MongoDB VS Code extension.
Accepted values:
| Value | Label | Behavior |
|---|---|---|
"prompt" | Ask | Asks the user on first use whether to enable automatic startup. |
"autoStartEnabled" | Auto Start Enabled | The MCP server starts automatically when the extension loads. |
"autoStartDisabled" | Auto Start Disabled | The MCP server does not start automatically; use the MongoDB: Start MCP Server command to start it manually. |
How to set it up:
"mdb.mcp.server": "autoStartEnabled"
Tip:
"autoStartEnabled"is the most convenient option if you use the MongoDB MCP server regularly. Use"autoStartDisabled"if you only need the server occasionally and prefer to avoid it consuming resources on every VS Code launch.
Once you know which settings the user wants to change, offer to apply them directly on their behalf.
Security reminder: If
mdb.mcp.apiClientIdormdb.mcp.apiClientSecretare being written, warn the user not to commit the file to version control if it is the workspace.vscode/settings.json. Suggest adding.vscode/settings.jsonto.gitignoreif it isn't already.
Ask the user: "Would you like me to update the settings file for you?"
When writing the file:
{
"mdb.mcp.apiClientId": "<client-id>",
"mdb.mcp.apiClientSecret": "<client-secret>",
"mdb.mcp.readOnly": false,
"mdb.mcp.server": "autoStartEnabled"
}
If the user prefers to make the changes themselves, provide a ready-to-paste JSON snippet containing only the settings they want to configure, and tell them exactly which file to open:
%APPDATA%\Code\User\settings.json~/Library/Application Support/Code/User/settings.json~/.config/Code/User/settings.json.vscode/settings.jsonExample snippet to paste inside the top-level {} of the chosen file:
"mdb.mcp.apiClientId": "<client-id>",
"mdb.mcp.apiClientSecret": "<client-secret>",
"mdb.mcp.readOnly": false,
"mdb.mcp.server": "autoStartEnabled"
Remind them to reload the VS Code window (or restart the MCP server via MongoDB: Start MCP Server) for the changes to take effect.