Skip to content
VS Code

MongoDB Read-Only MCP for VS Code

io.github.fean-developer/mongodb-readonly-mcp

Read-only MongoDB queries with database, collection and field policies.

client:VS Code transport:stdio runtime:npm

Install MongoDB Read-Only MCP in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "mongodb-mcp-profile",
      "description": "MONGODB_MCP_PROFILE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mongodb-uri",
      "description": "MONGODB_URI",
      "password": true
    }
  ],
  "servers": {
    "mongodb-readonly-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@fean-developer/mongodb-readonly-mcp"
      ],
      "env": {
        "MONGODB_MCP_PROFILE": "${input:mongodb-mcp-profile}",
        "MONGODB_URI": "${input:mongodb-uri}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

MongoDB Read-Only MCP in other clients