Universal MCP Server

Security-first MCP server for PostgreSQL, SQLite, MySQL, DuckDB with SQL injection prevention.

Local serverstdioPython

What is the Universal MCP server?

If you already use Universal, the universal mcp server is the piece that lets your assistant work with it directly. Security-first MCP server for PostgreSQL, SQLite, MySQL, DuckDB with SQL injection prevention.

What the server does

Most database MCP servers give AI agents raw SQL access and hope for the best. This server assumes the LLM is untrusted input and applies 8 layers of injection prevention before any query reaches your database — including blocking UNION attacks, stacked statements, time-based injection, and comment bypasses.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • query — Execute SQL — read-only by default, all 8 security layers apply
  • schema — Inspect tables and columns — no config needed
  • explain — Get query execution plan without running the query
  • health — Check connection status, DB version, and pool metrics
  • list_databases — Show all configured databases and connection state
  • query_history — Inspect the last 100 executed queries
  • snapshot_schema — Capture current schema for drift detection
  • schema_diff — Compare current schema against the last snapshot

Installation

Installation goes through your MCP client rather than a global install: point it at universal-db-mcp on PyPI and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

Credentials and setup notes

Configuration is passed through the environment: SQLITE_PATH, ALLOW_DESTRUCTIVE, DUCKDB_PATH. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Where it fits

Among the database access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Universal's toolset — query, schema, explain and 5 more — is a fair guide to whether it matches your workflow. It is maintained by Fashad-Ahmed; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
queryExecute SQL — read-only by default, all 8 security layers apply
schemaInspect tables and columns — no config needed
explainGet query execution plan without running the query
healthCheck connection status, DB version, and pool metrics
list_databasesShow all configured databases and connection state
query_historyInspect the last 100 executed queries
snapshot_schemaCapture current schema for drift detection
schema_diffCompare current schema against the last snapshot

How to install the Universal MCP server

{
  "mcpServers": {
    "universal-db": {
      "command": "uvx",
      "args": ["universal-db-mcp"],
      "env": {
        "SQLITE_PATH": "your-value",
        "ALLOW_DESTRUCTIVE": "your-value",
        "DUCKDB_PATH": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
SQLITE_PATHFilesystem location the server is allowed to use.Optional
ALLOW_DESTRUCTIVEConfiguration value read at startup.Optional
DUCKDB_PATHFilesystem location the server is allowed to use.Optional

Example prompts to try

  • Use Universal to query.
  • Use Universal to schema.
  • Use Universal to explain.

Frequently asked questions

It connects Universal to MCP-compatible AI assistants such as Claude and Cursor, exposing 8 tools (query, schema, explain, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Universal directly.