The best MCP servers for connecting AI agents to SQL and NoSQL databases — query, inspect schemas, and safely read or write real records from Claude, Cursor, and other clients.
Browse all Databases servers →Start with the engine-specific page for your database (Postgres, MySQL, MongoDB, SQLite) rather than a generic multi-database server — a purpose-built server usually has better schema introspection and fewer surprises than a lowest-common-denominator wrapper.
The single biggest decision is read vs. write access. Most database MCP servers default to read-only, which is the right starting point: connect with a database role that can only SELECT, watch how the agent actually uses it for a while, and only grant write access to specific tables once you trust the workflow.
Never point one of these at a database credential with admin/superuser rights. Create a dedicated, least-privilege user for the MCP server — most engines support scoping a role to specific schemas or tables, which limits the blast radius if a prompt goes wrong.
It depends on your database. For Postgres, the official modelcontextprotocol/server-postgres and crystaldba/postgres-mcp are the most widely installed. The ranking on this page is ordered by real usage across the AllMCPs directory.
Most database MCP servers default to read-only access for safety; several offer an opt-in write mode. Always check the server’s README and connect with a least-privilege, scoped database credential.
Install a database MCP server in your client config (e.g. under mcpServers in claude_desktop_config.json), give it a connection string via environment variables, and restart the client. Each listing links to its setup instructions.