MongoDB MCP Server vs PostgreSQL MCP Server
Updated June 2026Compare these two MCP servers to find which one fits your needs best.
Description
The official MongoDB MCP server, `mongodb-js/mongodb-mcp-server`, maintained by MongoDB. Searchers find it as the MongoDB MCP server or the Mongo MCP server; both names refer to this one project, and there is no separate short-form server. It is really two tool surfaces in one process. The database tools connect to any MongoDB deployment over a connection string in `MDB_MCP_CONNECTION_STRING` — `find`, `aggregate`, `explain`, `collection-schema`, `collection-indexes`, `create-index`, `count`, `export`, `mongodb-logs` and the write tools — or, if no connection string is set, the model calls the `connect` tool at runtime and passes the returned `connectionId` to later calls. The Atlas tools are a separate control plane: listing and creating clusters, database users, IP access-list entries, stream processing resources and the performance advisor. They authenticate with Atlas Service Account credentials (`MDB_MCP_API_CLIENT_ID` / `MDB_MCP_API_CLIENT_SECRET`), not with a connection string, and they simply do not register when those are unset — the usual cause of a 'the Atlas tools are missing' report. Two defaults are worth knowing before you point it at production. `readOnly` is false, so every write tool including `drop-database` is registered unless you pass `--readOnly`, which is why MongoDB's own README uses that flag in every example. And confirmation-required tools rely on MCP elicitation, so on a client that does not support elicitation they execute without prompting — `--readOnly` or `--disabledTools` is the actual boundary. Other guardrails: `indexCheck` rejects queries that would do a collection scan, server-side JavaScript (`$where`, `$function`, `$accumulator`) is disabled by default, results are capped at 100 documents and 16 MB per call, and `--dryRun` prints the resolved config and enabled tool list without starting the server. Requires Node 22.13.0 or later (Node 20 is deprecated); also published as the `mongodb/mongodb-mcp-server` Docker image. Runs over stdio by default, with an optional HTTP transport and a separate monitoring listener for `/health` and Prometheus `/metrics`.
The PostgreSQL MCP server was the Model Context Protocol reference server for Postgres, and it is retired: the source now sits in modelcontextprotocol/servers-archived — a repository GitHub reports as archived, described as "Reference MCP servers that are no longer maintained" — and the npm package @modelcontextprotocol/server-postgres carries a deprecation notice reading "Package no longer supported." It still installs and still runs, which is why most third-party setup articles have not caught up. What it provides is deliberately small: a single tool, query, which executes read-only SQL inside a READ ONLY transaction, plus per-table schema information exposed as MCP resources at postgres://<host>/<table>/schema, with column names and data types discovered from database metadata. There is no index advice, no health check, no separate schema-listing tool, and no write mode. Install is npx @modelcontextprotocol/server-postgres with a postgres:// connection string as the argument. For active work against Postgres, the maintained alternative is Postgres MCP Pro (crystaldba/postgres-mcp), which exposes nine tools including index tuning against hypothetical indexes and a database health check, and has an explicit restricted access mode; if your database is hosted on Supabase or Neon, their platform servers add branching and logs that a raw Postgres connection cannot see. Reach for this archived server only when you want the smallest possible surface — one process, one read-only query tool, nothing else.
Install Type
npm
npm
Categories
🗄️ database
🗄️ database
Integrations
🟣 claude-desktop⚡ cursor💙 vs-code🏄 windsurf🤖 cline
🟣 claude-desktop⚡ cursor💙 vs-code🏄 windsurf🤖 cline
Frequently Asked Questions
What is the difference between MongoDB MCP Server and PostgreSQL MCP Server?
MongoDB MCP Server and PostgreSQL MCP Server are both MCP servers but differ in their categories and capabilities. MongoDB MCP Server (database) is The official MongoDB MCP server, `mongodb-js/mongodb-mcp-server`, maintained by MongoDB. Searchers find it as the MongoDB MCP server or the Mongo MCP server; both names refer to this one project, and there is no separate short-form server. It is really two tool surfaces in one process. The database tools connect to any MongoDB deployment over a connection string in `MDB_MCP_CONNECTION_STRING` — `find`, `aggregate`, `explain`, `collection-schema`, `collection-indexes`, `create-index`, `count`, `export`, `mongodb-logs` and the write tools — or, if no connection string is set, the model calls the `connect` tool at runtime and passes the returned `connectionId` to later calls. The Atlas tools are a separate control plane: listing and creating clusters, database users, IP access-list entries, stream processing resources and the performance advisor. They authenticate with Atlas Service Account credentials (`MDB_MCP_API_CLIENT_ID` / `MDB_MCP_API_CLIENT_SECRET`), not with a connection string, and they simply do not register when those are unset — the usual cause of a 'the Atlas tools are missing' report. Two defaults are worth knowing before you point it at production. `readOnly` is false, so every write tool including `drop-database` is registered unless you pass `--readOnly`, which is why MongoDB's own README uses that flag in every example. And confirmation-required tools rely on MCP elicitation, so on a client that does not support elicitation they execute without prompting — `--readOnly` or `--disabledTools` is the actual boundary. Other guardrails: `indexCheck` rejects queries that would do a collection scan, server-side JavaScript (`$where`, `$function`, `$accumulator`) is disabled by default, results are capped at 100 documents and 16 MB per call, and `--dryRun` prints the resolved config and enabled tool list without starting the server. Requires Node 22.13.0 or later (Node 20 is deprecated); also published as the `mongodb/mongodb-mcp-server` Docker image. Runs over stdio by default, with an optional HTTP transport and a separate monitoring listener for `/health` and Prometheus `/metrics`. while PostgreSQL MCP Server (database) is The PostgreSQL MCP server was the Model Context Protocol reference server for Postgres, and it is retired: the source now sits in modelcontextprotocol/servers-archived — a repository GitHub reports as archived, described as "Reference MCP servers that are no longer maintained" — and the npm package @modelcontextprotocol/server-postgres carries a deprecation notice reading "Package no longer supported." It still installs and still runs, which is why most third-party setup articles have not caught up. What it provides is deliberately small: a single tool, query, which executes read-only SQL inside a READ ONLY transaction, plus per-table schema information exposed as MCP resources at postgres://<host>/<table>/schema, with column names and data types discovered from database metadata. There is no index advice, no health check, no separate schema-listing tool, and no write mode. Install is npx @modelcontextprotocol/server-postgres with a postgres:// connection string as the argument. For active work against Postgres, the maintained alternative is Postgres MCP Pro (crystaldba/postgres-mcp), which exposes nine tools including index tuning against hypothetical indexes and a database health check, and has an explicit restricted access mode; if your database is hosted on Supabase or Neon, their platform servers add branching and logs that a raw Postgres connection cannot see. Reach for this archived server only when you want the smallest possible surface — one process, one read-only query tool, nothing else..
Which MCP server should I choose: MongoDB MCP Server or PostgreSQL MCP Server?
Choose MongoDB MCP Server if you need database capabilities and prefer npm installation. Choose PostgreSQL MCP Server if you need database capabilities and prefer npm installation. Consider your specific use case and integration requirements.
Can I use both MongoDB MCP Server and PostgreSQL MCP Server together?
Yes, you can use multiple MCP servers together in Claude Desktop, Cursor, VS Code, and other MCP-compatible clients.MongoDB MCP Server and PostgreSQL MCP Servercan complement each other if their capabilities don't overlap.