MCP database guide
MCP Database: Pick the Database MCP Server for Postgres, MySQL or SQLite
An MCP database lets Claude or Cursor query your data through tools. Pick the MCP server for Postgres, MySQL, SQLite or MongoDB and connect it read-only.
Updated November 3, 2026
The short answer
An MCP database is a database your AI agent can use through the Model Context Protocol: Claude, Cursor or Claude Code read the schema and query the data by calling tools, instead of you pasting SQL into chat. For data you already have, install the database MCP server for your engine and connect it with a read-only user. For a new app with no database yet, use an agent-managed backend that creates the database for you. In short:
- Data already lives in Postgres, MySQL, SQL Server, SQLite or MongoDB? Use a database MCP server for that engine. It connects with a connection string and gives the agent tools to list tables and run queries. Start it read-only.
- Building a new app and need a backend? Use an agent-managed database such as MCPBackend. The agent creates the project, tables, sign-up and row policies through MCP, and your app talks to a generated REST API.
Which database MCP server do you need?
Match the server to where the data is and what the agent should be allowed to do. The table describes the common setups rather than ranking specific projects; check each server’s README for its exact tools and whether it supports a read-only mode.
| Your situation | Use | Typical tools | Watch out for |
|---|---|---|---|
| Existing Postgres (including Neon, RDS, Supabase) | A Postgres MCP server, or the platform’s own MCP server | List schemas and tables, describe columns, run SQL, sometimes explain plans | Connect with a read-only database role; production credentials end up in the client config |
| Existing MySQL or MariaDB | A MySQL MCP server | List tables, describe, run queries | Same as Postgres: a least-privilege user and a non-production replica where possible |
| SQL Server or Azure SQL | A SQL Server MCP server | Schema discovery and T-SQL queries | Network access from the machine running the server, and Windows vs SQL logins |
| A local SQLite file | A local SQLite MCP server over stdio | Create tables, run SQL against the file | Only your machine can see it; a deployed app cannot reach the file |
| MongoDB | A MongoDB MCP server | List collections, find, aggregate | Large result sets can flood the agent’s context; limit queries |
| No database yet: a new web app | An agent-managed backend (MCPBackend) | Create project, tables, auth, row policies, scoped keys, webhooks | No arbitrary SQL and no connection to an existing database |
Comparing Supabase’s MCP server with a plain Postgres MCP server? The Supabase server manages a Supabase project (its database plus platform settings), while a generic Postgres server only sees the database its connection string points at. The Supabase comparison covers how MCPBackend differs from both.
Database MCP servers worth knowing
These are widely used starting points, grouped by engine. We do not maintain or test them, and tools and maintenance status change quickly, so read each project’s README for its current tools, read-only options and install steps.
- Postgres: the platform’s own server if you host on Supabase or Neon (both publish one that also manages the project), or a maintained Postgres MCP server for any other Postgres. The original reference Postgres and SQLite servers from the MCP project have been moved to an archive, so prefer an actively maintained one.
- Several engines at once: Google’s MCP Toolbox for Databases and DBHub both connect to Postgres, MySQL, SQL Server and others through one server, which helps when an agent needs more than one database.
- MongoDB: MongoDB publishes an official MongoDB MCP Server for Atlas and self-hosted clusters.
- SQL Server and Azure SQL: Microsoft publishes an MSSQL MCP server sample, and the multi-engine servers above also support SQL Server.
- A local SQLite file: any SQLite MCP server that runs over stdio on your machine. Good for analysis, not for a deployed app.
- No database yet: MCPBackend. The agent creates a hosted SQLite database per project, plus sign-up, row policies and a REST API, through narrow MCP tools.
Before connecting any of them to real data, give the server its own read-only login. In Postgres:
CREATE ROLE mcp_readonly LOGIN PASSWORD 'use-a-long-random-password';
GRANT CONNECT ON DATABASE app TO mcp_readonly;
GRANT USAGE ON SCHEMA public TO mcp_readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO mcp_readonly;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO mcp_readonly;
ALTER ROLE mcp_readonly SET default_transaction_read_only = on;Two different things called an “MCP database”
The Model Context Protocol lets an AI application call tools on an external server. Search for “MCP database” and you will find two kinds of products that use it, and they solve different problems.
A database MCP server sits in front of a database you already have, such as Postgres, MySQL, SQL Server or a local SQLite file. The AI client gets tools to list tables and run queries, which is useful for analysis, debugging and asking questions about production data. You still own the database, its hosting, its users and its security.
An agent-managed database starts from nothing. The coding agent creates the project, defines tables, turns on sign-up and login, and decides who can read each row, all through MCP tools. Your app then talks to a generated REST API. This is what MCPBackend does: it is the backend for an app you are building with Claude Code or Cursor, not a window into an existing database.
MCP database options compared
The table compares the common ways to give an AI coding tool a database. It describes approaches rather than every vendor feature, so check each product’s current documentation before you commit.
| Approach | Where the data lives | What the agent does | Good for |
|---|---|---|---|
| Local SQLite MCP server | A file on your machine | Runs SQL against the file | Prototypes and local analysis; nothing is reachable by a deployed app |
| Postgres / MySQL MCP server | Your existing database server | Inspects tables and runs queries, often read-only | Querying and debugging data you already host |
| Platform MCP (for example Supabase) | The platform’s managed Postgres | Manages the platform project, including SQL and settings | Teams that want Postgres and a broad platform |
| MCPBackend | A hosted SQLite database per project | Creates projects, tables, auth, row policies, scoped keys and webhooks through narrow tools | New CRUD apps built by an agent that need auth and per-user data quickly |
If you are weighing MCPBackend against a Postgres platform specifically, the Supabase comparison goes through the tradeoffs in more detail.
Give your agent a database in five minutes
MCPBackend runs a hosted MCP server at https://mcp.mcpbackend.com/mcp. It uses Streamable HTTP and OAuth 2.1, so there is nothing to install and no token to paste into a config file.
Claude Code:
claude mcp add --transport http mcpbackend https://mcp.mcpbackend.com/mcpCursor, in ~/.cursor/mcp.json:
{
"mcpServers": {
"mcpbackend": { "url": "https://mcp.mcpbackend.com/mcp" }
}
}In Claude or Claude Desktop, open Settings → Connectors → Add custom connector and enter the same URL. The MCP config generator writes the snippet for other clients. Then ask for what you want:
- 1
Describe the app and who sees what
For example: “Add a backend for my recipe app. Users sign up with email, and each user only sees their own recipes.”
- 2
The agent creates the project and tables
It calls create_project, then create_table for recipes with the columns and an index on anything it will filter by.
- 3
It turns on auth and sets row policies
set_auth_enabled switches on email/password sign-up, and set_table_rls sets reads and writes to owner so each user only reaches their own rows.
- 4
It wires the app to the REST API
get_project_api returns the live routes and the OpenAPI contract, so the agent writes fetch calls against real endpoints instead of guessing.
- 5
You review it in the dashboard
Tables, policies, keys and usage are all visible, so you can check the agent’s work before real users arrive.
What the agent can and cannot do
The tools are deliberately small. A narrow tool such as “set this table to owner-only” is easier for an agent to call correctly, and easier for you to review, than a general SQL console.
Projects
list_projects, create_project (optionally with EU data residency) and get_project.
Schema
get_schema reads the live tables; create_table and add_column change them, including foreign keys and indexes.
Access
set_auth_enabled for end-user login and set_table_rls for public, authenticated or owner-only reads and writes.
Credentials
create_api_key mints a full-access or per-table scoped key. The secret is shown once and belongs on a server, not in the browser.
Events and usage
create_webhook subscribes a URL to row changes; get_usage shows the month’s usage against plan limits.
Not included
No arbitrary SQL, no dropping tables through MCP, and no access to databases hosted elsewhere.
Keeping an agent-managed database safe
An agent that can change your backend should work with the same care you would expect from a new teammate. A few habits cover most of the risk:
- Have the agent call
get_schemabefore it edits models or queries, so it works from the live database rather than its memory of the chat. - Use owner-only policies for anything personal, and test with two separate accounts. Machine API keys bypass row policies, so keep them server-side.
- Keep a separate project for experiments. The free plan’s single project is enough to try the workflow before anything important depends on it.
- Watch the caps. Write and storage limits block writes, the request limit blocks reads too, and there are no overage charges. The capacity calculator estimates which plan an app needs.
The developer library has short guides on the problems people hit most, such as unauthorized errors after connecting and an agent working in the wrong project.
When to use something else
Use a Postgres or MySQL MCP server when the data already exists and the job is to query it. MCPBackend cannot attach to your current database. Choose a Postgres platform when you need extensions, stored procedures, complex SQL or realtime subscriptions. And if you only need a scratch database for local analysis, a local SQLite MCP server is simpler and free.
MCPBackend fits best when you are building a new web app, internal tool, directory or small SaaS product with an AI editor and you want the database, sign-up, per-user data and API set up by the agent in one pass. For the bigger picture, read what an MCP backend is or how a remote MCP server connects to your client.
Frequently asked questions
What is an MCP database?+
People use the phrase for two things. Most often it means a database MCP server: a connector that lets an AI client such as Claude or Cursor query a database you already run. It can also mean a database built to be created and managed by an agent over MCP, where the agent provisions the project, defines tables and sets access rules. MCPBackend is the second kind.
What is the best MCP server for a database?+
The one built for your engine and maintained by its vendor or an active project. For Postgres, the platform's own server (Supabase, Neon) or a maintained Postgres server; for MongoDB, MongoDB's official server; for several engines at once, a multi-database server such as Google's MCP Toolbox for Databases or DBHub. Whichever you pick, connect it with a read-only user first.
What is the difference between an MCP database and a database MCP server?+
A database MCP server is a connector: it gives an AI client tools to query a database you already run, such as Postgres or MySQL. An agent-managed MCP database is the database itself, created and configured by the agent through MCP. Use the first to work with existing data and the second to build a new app's backend.
Is it safe to connect a database MCP server to production?+
Only with care. Use a read-only database user, or a replica, and keep write access for development databases. The agent can run any query the credentials allow, and the connection string sits in your MCP client config.
Supabase MCP vs a Postgres MCP server: which should I use?+
Use Supabase's MCP server if your project is on Supabase and you want the agent to manage the project as well as query it. Use a generic Postgres MCP server for any other Postgres database, or when you want the agent limited to queries over one connection string.
Is MCPBackend a Postgres or SQLite MCP server?+
Neither in the usual sense. MCPBackend does not connect to a database you already host. Each project gets its own hosted SQLite database, a generated REST API, email/password auth and row policies, and the remote MCP server exposes structured tools for managing those projects.
Can the agent run arbitrary SQL through MCP?+
No. The MCP tools are narrow: list and create projects, read the schema, create tables with columns, foreign keys and indexes, add columns, set row policies, enable auth, mint scoped API keys, create webhooks, read usage and manage team members. Application reads and writes go through the REST API.
Which AI tools can use it?+
Any MCP client that supports remote Streamable HTTP servers with OAuth. The setup guide has configuration for Cursor and Claude Code, and Claude and Claude Desktop can add it as a custom connector with the URL https://mcp.mcpbackend.com/mcp.
Is there a free plan?+
Yes. The free plan includes one project with 50 MB of storage, 5 tables, 10k rows written and 1M rows read per month, and every feature, including MCP, auth, row policies and webhooks. Paid plans raise the numbers rather than unlocking features.
Can I get my data out?+
Yes. A project is a standard SQLite database, and eject gives you a SQL export plus a compatible Node.js/SQLite runtime. The export does not include the hosted dashboard, the MCP server, webhooks, metering or managed backups.
Build the backend, skip the setup
Give your AI editora real backend
Start with a free project. Database, REST API, auth, permissions, webhooks, and MCP are included.