MCP server

MongoDB

Query MongoDB databases and manage Atlas clusters from AI agents

MongoDB's official MCP server lets agents query and modify MongoDB databases and manage Atlas clusters, users and access lists. It runs locally via npx or Docker using a connection string and/or Atlas service account credentials, with a read-only mode available. An Atlas-managed OAuth remote server is also offered through client plugin marketplaces.

Also available as

Connect

  1. 1Add the server to Codex
    codex mcp add mongodb --env MDB_MCP_CONNECTION_STRING=YOUR_MDB_MCP_CONNECTION_STRING --env MDB_MCP_API_CLIENT_ID=YOUR_MDB_MCP_API_CLIENT_ID --env MDB_MCP_API_CLIENT_SECRET=YOUR_MDB_MCP_API_CLIENT_SECRET -- npx -y mongodb-mcp-server@latest --readOnly

Configs are generated from the publisher's documented endpoint. Check their docs for plan requirements and scopes. New to this? Read the step-by-step tutorial.

Tools 12

findaggregateinsert-manyupdate-manydelete-manylist-databaseslist-collectionscreate-indexdb-statsatlas-list-clustersatlas-create-clusteratlas-create-db-user

Things to ask

  • “List the collections in the shop database”
  • “Find the 10 most recent orders over $500”
  • “Create an index on users.email”
  • “List my Atlas clusters”

Related