home / mcp / universal db mcp server
Provides natural-language access to multiple databases by querying and exploring schemas, enabling safe read-only analysis and cross-database operations via Claude Desktop.
Configuration
View docs{
"mcpServers": {
"anarkh-lee-universal-db-mcp": {
"command": "npx",
"args": [
"universal-db-mcp",
"--type",
"mysql",
"--host",
"localhost",
"--port",
"3306",
"--user",
"root",
"--password",
"your_password",
"--database",
"your_database"
]
}
}
}You can connect Claude Desktop to your databases through the MCP framework, enabling natural language queries and on-demand data analysis across multiple database systems with safe, read-only defaults.
Start Claude Desktop and let it connect to your databases via the MCP server you configure. Then you can ask questions in natural language, such as asking for the structure of a table, counting recent orders, or identifying high-value customers. Claude will translate your requests into SQL (or the appropriate query for the connected database), execute it, and present the results. The system understands your database schema, so your queries stay accurate and you get immediate insights without writing SQL yourself.
Prerequisites you need before installation:
• Node.js version 20 or newer
• Claude Desktop application
• At least one database instance to connect to (such as MySQL, PostgreSQL, Redis, Oracle, DM, SQL Server, or MongoDB)
npm install -g universal-db-mcpnpx universal-db-mcpEdit Claude Desktop's configuration to add a new MCP server. Use the following example configuration to connect to a MySQL instance running on localhost with a read-only MCP setup.
{
"mcpServers": {
"universal-db": {
"command": "npx",
"args": [
"universal-db-mcp",
"--type", "mysql",
"--host", "localhost",
"--port", "3306",
"--user", "root",
"--password", "your_password",
"--database", "your_database"
]
}
}
}1. Restart Claude Desktop after adding the new MCP server entry.
2. Open a chat and ask questions like: - “Help me view the structure of the users table” - “Count orders from the last 7 days” - “Find the top 10 customers by spend”
By default, the MCP server operates in read-only mode. It will reject write operations such as DELETE, UPDATE, DROP, or TRUNCATE. If you explicitly need to enable write privileges, you must provide a special flag in the MCP configuration.
The MCP server supports multiple database types. For each type, the MCP flag is passed to select the right adapter when starting the server.
The MCP server accepts a set of CLI options to specify the database type and connection details. Examples shown here illustrate the typical flags you will configure when launching the server.
universal-db-mcp [options]
Options:
--type <db> Database type (mysql|postgres|redis|oracle|dm|sqlserver|mssql|mongodb)
--host <host> Database host (default: localhost)
--port <port> Database port
--user <user> Username
--password <password> Password
--database <database> Database name
--danger-allow-write Enable write mode (dangerous!)
--help Show help informationThe system uses a modular adapter approach to support different databases. It loads the appropriate adapter based on the type you specify and then handles natural language requests by translating them into database queries. This design makes it straightforward to add new database drivers in the future.
Because the default is safe, avoid enabling write access on production data unless you fully understand the implications. Always test queries in a development environment before running them against live data.
If Claude cannot access your database, verify the host, port, and credentials in the MCP configuration. Ensure the database user has the necessary permissions for read operations and that network access is allowed from the machine running Claude Desktop.