Best MCP Servers for Databases

An MCP server for a database lets an assistant such as Claude or Cursor list tables, read schemas and run queries in plain language. The choice that matters most is how much the server is allowed to do: some are read-only by design, others will happily run any SQL you give them.

The tools below cover vendor-backed servers (Google, MongoDB), multi-engine gateways and small single-engine servers. Compare the engines each one supports, whether it has a read-only mode, and who maintains it.

AgentIndex · Updated 2026-10-14

Quick picks

  • mcp-toolbox — Google's server for databases, covering Google Cloud sources such as AlloyDB, BigQuery, Cloud SQL and Spanner plus others like Postgres; you can also define restricted custom tools for production agents.
  • dbhub — one zero-dependency server for PostgreSQL, MySQL, SQL Server, MariaDB and SQLite; pick it if you run more than one engine.
  • mongodb-mcp-server — MongoDB's own server for databases and Atlas, with a read-only mode and per-tool disabling.
  • mysql_mcp_server — small MySQL-only server that is quick to set up; use a restricted MySQL user because it can run arbitrary SQL.
  • pg-aiguide — not a query server: PostgreSQL docs and best-practice skills that help assistants write better schemas and SQL.

Side-by-side comparison

ToolWhat it isStarsLicenseLast pushInstall
mcp-toolboxGoogle's open-source MCP server for databases16.7kApache-2.02026-10-13brew install mcp-toolbox
dbhubZero-dependency MCP database gateway for PostgreSQL, MySQL, SQL Server, MariaDB and SQLite3.6kMIT2026-10-13docker run --rm --init --name dbhub --publish 8080:8080 bytebase/dbhub --tran…
mongodb-mcp-serverMongoDB's MCP server for databases and Atlas, with a read-only mode and per-tool disabling1.1kApache-2.02026-10-13npx -y mongodb-mcp-server@latest --readOnly
mysql_mcp_serverMIT MCP server that lists MySQL tables, reads them and runs SQL for Claude Desktop and other AI apps1.4kMIT2026-08-02pip install mysql-mcp-server
pg-aiguidePostgreSQL docs and best-practice skills for AI coding assistants1.9kApache-2.02026-10-07claude plugin marketplace add timescale/pg-aiguide
tabularisOpen-source database client with SQL notebooks, visual EXPLAIN, AI and MCP5.2kApache-2.02026-10-13brew tap TabularisDB/tabularis
data-api-builderMicrosoft's free MIT no-code engine that exposes databases as REST and GraphQL endpoints, with MCP support listed as coming soon1.5kMIT2026-10-12dotnet tool install microsoft.dataapibuilder -g

Tools in this list with an in-depth AgentIndex review: 7/7

How to choose

  • Start read-only. Prefer a server with a read-only mode or tool filtering, and connect it with a database user that only has SELECT rights.
  • Check which engines you need. Multi-engine servers save setup if you run Postgres and MySQL; single-engine servers are simpler and often deeper.
  • Prefer vendor-maintained servers for managed databases such as MongoDB Atlas or Google Cloud databases.
  • Remember that query results are sent to the model provider. Keep sensitive tables out of reach.
  • Check the last-push date: a database server that is not updated can fall behind driver and protocol changes.

FAQ

Which MCP server should I use for PostgreSQL?

DBHub supports PostgreSQL along with MySQL, SQL Server, MariaDB and SQLite, and Google's MCP Toolbox for Databases is a vendor-backed option. For help writing better PostgreSQL schemas and queries rather than running them, pg-aiguide provides docs and skills.

Is it safe to give an AI assistant access to my database?

Only with limits. Connect with a read-only database user, avoid production data, and prefer servers with a read-only mode or tool filtering. A model can misread a prompt and run a destructive statement if the account allows it.

Do I need an MCP server, or is a SQL client enough?

If you only want to run queries yourself, a SQL client is enough. An MCP server is for letting an AI assistant explore the schema and write and run queries for you inside your editor or chat.

How we compiled this list

Tools are chosen by hand from the projects in our index, favouring those we have reviewed in depth. Stars, licence, last-push date and install command come from each repository and are refreshed with the site data. We read each project's README and docs; we have not run every tool ourselves, so test before you depend on one.

More lists