
Universal DB MCP Server by Anarkh-Lee: Setup for Claude, Cursor and Other Apps
Lets Claude, Cursor and other assistants query MySQL, PostgreSQL, MongoDB, Redis, Oracle, SQL Server and 11 more databases in plain language.
Universal DB MCP connects an assistant to one database that you configure in the install command. It can read the structure, show masked sample rows and run queries. It starts in read-only mode.
It is a community project by Anarkh-Lee that runs on your computer. The assistant can also open a new connection and ask for write access through a tool call, so use a database account that only has the rights you want it to have.
Good for
- Analysts who want answers from a database without writing SQL
- Developers who want to explore a schema from their editor
- Teams on Chinese domestic databases such as DM, Kingbase or GaussDB
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install Universal DB MCP
Claude Code
- 1
Copy this prompt.
Add the Universal DB MCP server to Claude Code. Run this command: claude mcp add universal-db -- npx -y universal-db-mcp --type mysql --host localhost --port 3306 --user readonly_user --password YOUR_PASSWORD --database YOUR_DATABASE Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js, Node.js 20+, A database account.
Read-only mode: Read-only is the default. Leave --permission-mode at its default (safe) and use a database user with read rights only.
The server needs connection flags, so the config includes example MySQL values: change --type (for example postgres, mongodb, sqlite) and the host, user, password and database to yours. Use a read-only database account. The README shows the Claude Desktop config with npx and these flags; the other apps use the same arguments, adapted by us.
Built from the package data we hold. Not yet tested by us.
Tools
Runs a SQL query or database command
Runs the SQL or database command you give it, with optional parameters. In the default safe mode only SELECT-style reads pass. Other permission modes also allow inserts, updates, deletes or schema changes.
Try: “Show the top 10 customers by order value this month.”
Delete ·
execute_queryLists tables, columns, keys and indexes
Returns the structure of every schema your user can see, including table and column names, data types, primary keys and indexes. Results are cached unless you ask for a refresh.
Try: “What tables does this database have?”
Read ·
get_schemaShows one table's columns, indexes and row estimate
Gives the detailed definition of a single table, such as columns, indexes and estimated row count. You can name a schema as schema.table.
Try: “Describe the orders table.”
Read ·
get_table_infoLists the distinct values in a column
Returns the unique values of a column, up to 100, with optional counts. Useful for columns like status or category before writing a filter.
Try: “What values does orders.status take, and how often?”
Read ·
get_enum_valuesShows a few example rows, with sensitive data masked
Returns up to 10 rows (3 by default) from a table so the assistant can see data formats. The description says phone numbers, emails and similar fields are masked automatically.
Try: “Show me 3 sample rows from the users table.”
Read ·
get_sample_dataClears the cached database structure
Throws away the cached schema so the next lookup reads it fresh. Use it after you change tables.
Try: “I added a table. Refresh the schema.”
Write ·
clear_cacheConnects to a database you name, at any time
Opens a new connection from the host, user, password and database the assistant passes in, replacing any current one. The call can also set write permissions, including full control.
Try: “Connect to the analytics PostgreSQL database on db.example.com.”
Write ·
connect_databaseCloses the current database connection
Disconnects and clears the cache. Queries need a new connection afterwards.
Try: “Disconnect from the database.”
Network ·
disconnect_databaseShows what you are connected to and in which mode
Reports whether a connection is open, the database type, address, database name and permission mode.
Try: “Which database am I connected to, and is it read-only?”
Read ·
get_connection_status
Read from the source code
Permissions
high risk · 5 things to watch
High risk
The assistant can read your database and, if write mode is on or it asks for it through the connection tool, change or delete data. Connect with a read-only database account so the database itself blocks writes.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only modeHow to turn it on
Watch out for
The assistant can switch on write access itself
connect_database accepts allowWrite and a permission mode of full, so a connection opened by the assistant is not bound by the read-only flag in your config. Use a database account that only has read rights. github.com
Full mode can delete data and change tables
In full mode execute_query can run DELETE, TRUNCATE, DROP and other schema changes. Never enable it on production data. github.com
The database password sits in your config file
The README's setup puts --password in the client's JSON args, and connect_database takes a password in chat. Use a dedicated account and avoid reusing a personal password. github.com
Query results go to the AI provider
Rows the assistant reads become part of the conversation. Sample data is masked by the server, but results from execute_query are not described as masked. github.com
The optional HTTP mode listens on every interface
If you start the HTTP mode, the default bind address is 0.0.0.0, and authentication is skipped when no API keys are configured. The stdio setup in the install box does not use it. github.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | Read-only is the default (--permission-mode safe). Other modes are readwrite, full and a custom --permissions list. The connect_database tool can set a different mode at call time. |
|---|---|
| Talks to | The database host you connect to |
| Sign-in and keys | Database user and password are passed as command-line arguments in your MCP client config, or as arguments to connect_database. |
Questions
Is the Universal DB MCP server official?
No. It is a community project by Anarkh-Lee (MIT license), not made by MySQL, PostgreSQL or any database vendor.
Is it read-only?
By default, yes. It starts in a safe mode that allows only reads. You can pick read and write, full control or a custom list with a flag, and the connect tool can ask for write access too.
Which databases does it support?
17 types: MySQL, PostgreSQL, Redis, Oracle, SQL Server, MongoDB, SQLite, ClickHouse, TiDB and several Chinese databases such as DM, Kingbase and GaussDB. Pick one with the type flag.
Does it need an API key?
No key for the stdio setup. It needs your database host, user, password and database name in the install command. The optional HTTP mode can use API keys.
Does it hide sensitive data?
Sample rows are masked for items like phone numbers and emails. The README does not say the same for results of free queries, so assume those come back as they are.
Can I connect to more than one database?
One at a time. The assistant can call the connect tool to switch to a different database, which closes the current connection.
How do I add it to Claude Desktop or Cursor?
Use the matching tab in the install box above, then edit the database flags in the config before you restart the app.
Information
updated Nov 2, 2026
- Publisher
- Community
- Package
universal-db-mcp- Registry
- npm
- Transport
- stdio
- Auth
- token in env
- License
- MIT
- Last commit
- Mar 17, 2026
- Open issues
- 10
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 3Hide
- README · github.com
- mcp-server.ts · github.com
- safety.ts · github.com