← Back to directory
U

Universal DB MCP

Community
Connect AI to Your Database with Natural Language
GitHub source repository ↗
★ 919 Stars Category · Database Popular Source revision dc338cd7740c
49FMRS · D
Reliability
5/20
Security and permissions
9/20
Maintenance
10/20
Documentation
13/20
Setup experience
12/20

Universal DB MCP is a powerful database MCP connector supporting a wide range of databases and platforms, offering flexible architecture and multiple permission controls, but users must pay attention to security configuration and permission management.

Read the FMRS scoring method →

Universal DB MCP is a universal database connector implementing the Model Context Protocol (MCP) and HTTP API, enabling AI assistants to query and analyze databases using natural language. It supports 17 databases including MySQL, PostgreSQL, Oracle, MongoDB, and 10 Chinese domestic databases. It offers 2 startup modes (stdio/http) with 4 access methods: MCP stdio, MCP SSE, MCP Streamable HTTP, and REST API. It works with 50+ platforms such as Claude Desktop, Cursor, Windsurf, VS Code, and ChatGPT. Features include read-only mode by default, flexible permission modes, intelligent caching, batch query optimization, multi-schema support, and data masking.

Tools

execute_query
Execute a read-only SQL query and return the results.
get_schema
Get the database schema including tables, columns, indexes, etc.
get_table_info
Get detailed information about a specific table, such as columns, types, and comments.
clear_cache
Clear the cached database schema information.
get_enum_values
Get the allowed values for an enum column.
get_sample_data
Get sample data from a specific table.
connect_database
Connect to a new database instance.
disconnect_database
Disconnect from the current database.
get_connection_status
Check the status of the current database connection.

Setup

Install globally: npm install -g universal-db-mcp

For Claude Desktop, edit the configuration file (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json; Windows: %APPDATA%\Claude\claude_desktop_config.json) and add the mcpServers configuration, then restart Claude Desktop.

For HTTP mode: set environment variables MODE=http, HTTP_PORT=3000, API_KEYS=your-secret-key, then run npx universal-db-mcp.

claude_desktop_config.json
{
  "mcpServers": {
    "my-database": {
      "command": "npx",
      "args": [
        "universal-db-mcp",
        "--type", "mysql",
        "--host", "localhost",
        "--port", "3306",
        "--user", "root",
        "--password", "your_password",
        "--database", "your_database"
      ]
    }
  }
}

Fit and risk

Best for

  • Developers and data analysts who need to access databases from multiple AI platforms and IDEs using natural language
  • Scenarios requiring connection to diverse databases including Chinese domestic databases
  • Environments that need read-only safe access to prevent accidental modifications

Not for

  • Scenarios that require write operations (INSERT, UPDATE, DELETE) without permission restrictions (read-only by default)
  • Environments with strict security policies that cannot rely on third-party connectors

Required permissions

  • Read database connection configuration information
  • Execute SQL queries (read-only by default, can be extended to write with configuration)
  • Access database schema and metadata

Risks and side effects

  • Enabling full write mode could lead to data corruption or loss
  • Database credentials may be stored in plaintext in config files; handle with care
  • Remote access (HTTP) may face unauthorized access risk; use API keys and network security measures

Troubleshooting

  1. Ensure Node.js version >= 20.0.0
  2. Check that database connection parameters in the MCP config are correct
  3. If connection fails, check if the database allows remote connections and firewall ports are open
  4. View logs (via --debug or environment variables) for more error information

Use cases

Ask AI assistants database questions like 'Show me the top 10 customers by order value this month'
Query and analyze database data via natural language in IDEs like Claude Desktop, Cursor, Windsurf, and VS Code
Integrate with automation platforms like Coze and n8n via REST API

Supported clients

Claude DesktopFull support
CursorFull support
WindsurfFull support
VS CodeFull support
ChatGPTPartial support