Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words

Universal Db MCP

by Fashad-Ahmedversion 1.1.2i★ 1iRuns on your computerRepository ↗
Registry nameio.github.Fashad-Ahmed/universal-db-mcp

How to install

What it does

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

  • Connects Runs on your computer
  • Account or key Needs POSTGRES_URI, MYSQL_URI
  • Category Databases & datasets

Use together with

Skills that teach the AI this kind of work; they work alongside this one

timesfm

TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.

by google-research★ 35,6291 skills

Skill · How-to guide

Shadowbroker

Open-source intelligence for the global theater. Track everything from the corporate/private jets of the wealthy, and spy satellites, to seismic events in one unified interface. Hook an AI agent up to have it parse through data and find previously unseen correlations. The knowledge is available to…

by BigBodyCobain★ 11,6021 skills

Skill · How-to guide

google-maps-scraper

scrape data from Google Maps. Extracts data such as the name, address, phone number, website URL, rating, reviews number, latitude and longitude, reviews,email and more for each place

by gosom★ 8,2091 skills

Skill · How-to guide

Why it ranks here

Lists are ordered by a usage score (out of 100) built from these parts

Popularity4/80GitHub stars or weekly downloads: the larger counts 60, the smaller 20
Freshness3/12Full marks for a release or code change within 30 days
Still answering0/8The cloud endpoint answered at the last check
Usage score7/100

Quality: Passed 2/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)

Install

Pick the AI app you use, then copy the settings.

Let your AI install it with one sentence

Please install Universal Db MCP. Follow https://mcp.popnx.com/i/fashad-ahmed-universal-db-mcp.md, show me the commands and wait for my OK before running them.

Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads

Passed 2/3 checks · Runs on your computer · ✓ Commands checked Nov 14, 2026

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude, with some setup first

You need a Universal Db MCP key (create it on the maker’s site) · Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone

Let AI install it

Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Universal Db MCP for Claude on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "universal-db": { "command": "uvx", "args": [ "universal-db-mcp" ], "env": { "POSTGRES_URI": "your-value", "MYSQL_URI": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For POSTGRES_URI, MYSQL_URI, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Universal Db MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Sign up and create a Universal Db MCP key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    How to get a key is in the maker’s README below

  3. Open the Claude desktop app’s settings file

    SettingsDeveloperEdit Config

  4. Paste these settings and save the file

    {
      "mcpServers": {
        "universal-db": {
          "command": "uvx",
          "args": [
            "universal-db-mcp"
          ],
          "env": {
            "POSTGRES_URI": "your-value",
            "MYSQL_URI": "your-value"
          }
        }
      }
    }

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Quit Claude and open it again

  6. Try it

    Use Universal Db MCP and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using Universal Db MCP or shows a Universal Db MCP tool in the answer, you are connected

4 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • SQLITE_PATH Path to a SQLite database file
  • DUCKDB_PATH Path to a DuckDB file, or :memory:
  • ALLOW_DESTRUCTIVE Set to true to allow INSERT/UPDATE/DELETE/DDL (default: false) · default false
  • MAX_RESULT_ROWS Maximum rows returned per query (default: 1000) · default 1000

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

ChatGPT cannot connect Universal Db MCP yet

Universal Db MCP runs on your computer, but ChatGPT can only connect servers that run on the web

What you can do instead

A · Use an app that can connect Universal Db MCP

  • You need a Universal Db MCP key (create it on the maker’s site) · Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
  • You need a Universal Db MCP key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
  • You need a Universal Db MCP key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
  • You need a Universal Db MCP key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)

B · Others in Databases & datasets that work with ChatGPT

Picked from the most used in the same category, only ones that connect by address with no key

Works with Claude Code, with some setup first

You need a Universal Db MCP key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Universal Db MCP for Claude Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user universal-db --env POSTGRES_URI=your-value --env MYSQL_URI=your-value -- uvx universal-db-mcp 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For POSTGRES_URI, MYSQL_URI, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Universal Db MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Sign up and create a Universal Db MCP key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    How to get a key is in the maker’s README below

  3. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  4. Paste this command and press Enter

    claude mcp add --scope user universal-db --env POSTGRES_URI=your-value --env MYSQL_URI=your-value -- uvx universal-db-mcp

    Replace “your-value” with your key before pressing Enter

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Type /mcp in Claude Code

    You should see Universal Db MCP listed as connected

  6. Try it

    Use Universal Db MCP and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using Universal Db MCP or shows a Universal Db MCP tool in the answer, you are connected

4 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • SQLITE_PATH Path to a SQLite database file
  • DUCKDB_PATH Path to a DuckDB file, or :memory:
  • ALLOW_DESTRUCTIVE Set to true to allow INSERT/UPDATE/DELETE/DDL (default: false) · default false
  • MAX_RESULT_ROWS Maximum rows returned per query (default: 1000) · default 1000

Descriptions are as written by the maker.

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor, with some setup first

You need a Universal Db MCP key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Universal Db MCP for Cursor on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "universal-db": { "command": "uvx", "args": [ "universal-db-mcp" ], "env": { "POSTGRES_URI": "your-value", "MYSQL_URI": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For POSTGRES_URI, MYSQL_URI, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Universal Db MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Sign up and create a Universal Db MCP key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    How to get a key is in the maker’s README below

  3. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  4. Fill in your key

    In the Universal Db MCP settings, POSTGRES_URI, MYSQL_URI is empty; add your key and save

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Open the AI chat in Cursor in Agent mode

  6. Try it

    Use Universal Db MCP and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using Universal Db MCP or shows a Universal Db MCP tool in the answer, you are connected

4 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • SQLITE_PATH Path to a SQLite database file
  • DUCKDB_PATH Path to a DuckDB file, or :memory:
  • ALLOW_DESTRUCTIVE Set to true to allow INSERT/UPDATE/DELETE/DDL (default: false) · default false
  • MAX_RESULT_ROWS Maximum rows returned per query (default: 1000) · default 1000

Descriptions are as written by the maker.

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code, with some setup first

You need a Universal Db MCP key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Universal Db MCP for VS Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "universal-db": { "type": "stdio", "command": "uvx", "args": [ "universal-db-mcp" ], "env": { "POSTGRES_URI": "your-value", "MYSQL_URI": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For POSTGRES_URI, MYSQL_URI, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the Universal Db MCP tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Sign up and create a Universal Db MCP key

    Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.

    How to get a key is in the maker’s README below

  3. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  4. Fill in your key

    In the Universal Db MCP settings, POSTGRES_URI, MYSQL_URI is empty; add your key and save

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Open the AI chat in VS Code in Agent mode

  6. Try it

    Use Universal Db MCP and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using Universal Db MCP or shows a Universal Db MCP tool in the answer, you are connected

4 optional setting(s) (works without them)

The command above works without these. Add them only if you want to change something, following the maker’s description.

  • SQLITE_PATH Path to a SQLite database file
  • DUCKDB_PATH Path to a DuckDB file, or :memory:
  • ALLOW_DESTRUCTIVE Set to true to allow INSERT/UPDATE/DELETE/DDL (default: false) · default false
  • MAX_RESULT_ROWS Maximum rows returned per query (default: 1000) · default 1000

Descriptions are as written by the maker.

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

JSON settings are under “For developers” below

Stuck? Ask people who use Universal Db MCP💬 Discussion →
For developers: Terminal commands and JSON settings

Installed on your computer

Claude Code

claude mcp add --scope user universal-db --env POSTGRES_URI=your-value --env MYSQL_URI=your-value -- uvx universal-db-mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "universal-db": {
      "command": "uvx",
      "args": [
        "universal-db-mcp"
      ],
      "env": {
        "POSTGRES_URI": "your-value",
        "MYSQL_URI": "your-value"
      }
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "universal-db": {
      "command": "uvx",
      "args": [
        "universal-db-mcp"
      ],
      "env": {
        "POSTGRES_URI": "your-value",
        "MYSQL_URI": "your-value"
      }
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "universal-db": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "universal-db-mcp"
      ],
      "env": {
        "POSTGRES_URI": "your-value",
        "MYSQL_URI": "your-value"
      }
    }
  }
}

Values you fill in

  • POSTGRES_URI secret required env
    PostgreSQL connection string (read-only user recommended)
  • SQLITE_PATH env
    Path to a SQLite database file
  • MYSQL_URI secret required env
    MySQL connection string (read-only user recommended)
  • DUCKDB_PATH env
    Path to a DuckDB file, or :memory:
  • ALLOW_DESTRUCTIVE env
    Set to true to allow INSERT/UPDATE/DELETE/DDL (default: false)
  • MAX_RESULT_ROWS env
    Maximum rows returned per query (default: 1000)

Descriptions are as written by the maker.

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

Downloads per weeki
42/wk
Licencei
No licence stated
Connection
Runs on your computer
Latest versioni
1.1.2
Published to registryi
Jun 11, 2026
Code last changedi
Jun 12, 2026
Maker
Fashad-Ahmed
Packages
pypi: universal-db-mcp
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Run on your computer in

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

All apps, with pros and cons →

Related guides

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 19, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account Fashad-Ahmed, which owns the repo

  • ✓ Pass

    Still maintained

    Code last changed 5 months ago

  • ✕ Fail

    Has a licence

    No licence file found in the repo

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Published vulnerabilities (OSV.dev)

No entries on OSV.dev for universal-db-mcp@1.1.2

Checks only this package version, not every dependency · checked Nov 16, 2026

What we check → · JSON

Makers: ask for a re-check or report wrong info
For makers: add a badge to your README

If you made this, paste this code into your README. The badge links back to this page.

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/fashad-ahmed-universal-db-mcp.svg)](https://mcp.popnx.com/en/servers/fashad-ahmed-universal-db-mcp)

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in to post

User reviews

No reviews yet

Sign in to write a review

Compared with others in Databases & datasetsi

  • More stars than 79% of the other 1233 servers in this category
  • Published to the registry more recently than 12% of the other 1233 servers in this category
  • Basic checks equal to or better than 50% of the other 1233 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is Universal Db MCP safe?

It passed 2 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

You need to fill in: POSTGRES_URI, MYSQL_URI

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed 5 months ago, and the latest version (1.1.2) reached the registry 5 months ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv) on your computer.

What can I use instead?

In the same category: QueryWeaver, Supabase, Neon, DBCode, Keboola MCP

Similar alternatives

Same category, other makers, commands already checked. Official ones first, then by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

QueryWeaver

An MCP server for Text2SQL: transforms natural language into SQL using graph schema understanding.

by FalkorDBGrowing★ 1.1KUpdated 14 months ago

Runs on your computer✓ falkordb.com

Supabase

Supabase’s official server lets AI create tables, query data and review project settings in your Supabase database.

by supabaseWidely used↓ 245.5K/wk★ 3K Stars for the whole repoUpdated yesterday

Computer or cloud✓ service owner · supabase.com

Neon

Official Neon MCP server for managing Neon projects and Lakebase Postgres databases.

by neondatabaseGrowing★ 666Updated 13 days ago

Runs in the cloud✓ service owner · neon.com

DBCode

Query and explore 100+ databases through your DBCode connections.

by dbcodeioEarly↓ 118/wk★ 367 Stars for the whole repoUpdated 2 months ago

Runs on your computer✓ service owner · dbcode.io

Keboola MCP

Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...

by keboolaGrowing↓ 1.4K/wk★ 84Updated 3 days ago

Computer or cloud✓ service owner · keboola.com
Compared with similar ones
This one
Universal Db MCP
QueryWeaverSupabaseNeonDBCodeKeboola MCP
Runs whereInstalls on your computerInstalls on your computerCloud or install on your computerRuns in the cloud, nothing to installInstalls on your computerCloud or install on your computer
Needs a keyYesNoYesNoNoNo
Add with + in ClaudeNoNoYesYesNoNo
Basic checks2/33/35/55/52/35/5
License–AGPL-3.0Apache-2.0MITNOASSERTIONMIT
PriceNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registry

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

Universal Database MCP Server

The security-first, Python-native MCP server for database access from AI agents.


Why This Exists

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.

Supports: PostgreSQL · SQLite · MySQL · DuckDB (columnar analytics)


Zero Setup: Works on Your Laptop Right Now

No Docker. No cloud account. No database server to install. DuckDB and SQLite run in-process:

# Query a local SQLite database — one command, zero infra

SQLITE_PATH=./myapp.db uvx universal-db-mcp

Query a local DuckDB file or parquet files

DUCKDB_PATH=./analytics.duckdb uvx universal-db-mcp

In-memory DuckDB for throwaway analysis

DUCKDB_PATH=:memory: uvx universal-db-mcp

Add to Claude Code in ~/.claude/mcp_servers.json, or to Claude Desktop in ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) / %APPDATA%\Claude\claude_desktop_config.json (Windows):

{

"mcpServers": { "mydb": { "command": "uvx", "args": ["universal-db-mcp"], "env": { "SQLITE_PATH": "/Users/you/projects/myapp/db.sqlite3", "ALLOW_DESTRUCTIVE": "false" } } } }

Restart Claude Desktop / Claude Code after saving — that's it.

That's it. Claude Code discovers the tools automatically.

More client configs (Claude Desktop, Cursor, Windsurf, Docker) in examples/.


Security Model: 8 Layers

Read-only by default. Defense-in-depth. Every query validated before it

touches the driver.

LayerWhat it does
1Driver-level read-only — PostgreSQL session flag, SQLite mode=ro URI, DuckDB read_only=True. Write rejected before SQL parsing.
2Keyword blocking — DROP, DELETE, TRUNCATE, ALTER, INSERT, UPDATE, GRANT, EXEC blocked in read-only mode
3Injection pattern detection — UNION SELECT, stacked statements, SQL comments (--, /*), xp_, SLEEP(), WAITFOR, BENCHMARK()
4Multiple statement rejection — ; separating statements always blocked
5Parameter type enforcement — only str, int, float, bool, null accepted as parameters
6Result size limits — truncated at MAX_RESULT_ROWS (default 1000) to prevent memory exhaustion
7Identifier sanitization — table/column names stripped of metacharacters in internally-generated SQL
8DuckDB filesystem blocklist — read_csv(), read_parquet(), glob(), LOAD, INSTALL, httpfs, COPY blocked at adapter level; read_only=True only blocks writes, not file reads

Full threat model: docs/SECURITY.md


DuckDB: Analytics Without Infrastructure

DuckDB runs in-process (no server) and reads Parquet, CSV, JSON natively. Connect AI agents to your analytics data without spinning up a warehouse:

# Query parquet files directly

DUCKDB_PATH=:memory: uvx universal-db-mcp

Then in Claude Code:

You: "Load sales.parquet and show me monthly revenue by region"

Claude: [uses query tool → SELECT region, strftime('%Y-%m', date) AS month, SUM(revenue) ...]


Natural Language → SQL

No separate NL-to-SQL tool needed — Claude already does this. Give it the schema tool and ask in plain English:

You: "Which customers placed more than 5 orders last month?"

Claude: [calls schema() to see table structure, then query() with the generated SQL — every query still passes through all 8 security layers before touching your database]

Pair with dry_run: true (DRYRUN=true) while prototyping — Claude gets the query plan back without anything executing.


Docker

docker build -t universal-db-mcp .

docker run -i --rm \ -e POSTGRES_URI=postgresql://readonly:pass@host.docker.internal:5432/mydb \ -e ALLOW_DESTRUCTIVE=false \ universal-db-mcp

See examples/docker_mcp_config.json for wiring this into an MCP client.


All Databases

# PostgreSQL

POSTGRES_URI=postgresql://readonly:pass@localhost/mydb uvx universal-db-mcp

SQLite (local file, zero infra)

SQLITE_PATH=./db.sqlite3 uvx universal-db-mcp

MySQL

MYSQL_URI=mysql://readonly:pass@localhost/mydb uvx universal-db-mcp

DuckDB (columnar, in-process analytics)

DUCKDB_PATH=./analytics.duckdb uvx universal-db-mcp

Multiple databases simultaneously

POSTGRES_URI=... SQLITE_PATH=... uvx universal-db-mcp


MCP Tools

ToolDescription
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

v1.1.0: dry-run mode (DRYRUN=true), table allowlists (WHITELISTED_TABLES), query complexity warnings, structured audit logs, and a --check CLI flag for connectivity validation. See CHANGELOG.md.


Configuration

# ── PostgreSQL ─────────────────────────────────────

POSTGRES_URI=postgresql://user:pass@host:5432/db POSTGRES_READONLY=true # default: true

── SQLite ─────────────────────────────────────────

SQLITE_PATH=/path/to/database.db SQLITE_READONLY=true # default: true

── MySQL ──────────────────────────────────────────

MYSQL_URI=mysql://user:pass@host:3306/db MYSQL_READONLY=true # default: true

── DuckDB ─────────────────────────────────────────

DUCKDB_PATH=/path/to/analytics.duckdb # or :memory: DUCKDB_READONLY=true # default: true

── Security ───────────────────────────────────────

ALLOW_DESTRUCTIVE=false # default: false — blocks INSERT/UPDATE/DELETE/DROP MAX_RESULT_ROWS=1000 # truncate large results ENABLE_LOGGING=true # log queries to stderr QUERY_TIMEOUT=30 # seconds RATE_LIMIT_RPM=60 # requests per minute


Secure Database Users

Always use a dedicated read-only account. Never give the MCP server credentials that can modify data.

PostgreSQL:

CREATE USER mcp_agent WITH PASSWORD 'strong_random_password';

GRANT CONNECT ON DATABASE mydb TO mcp_agent; GRANT USAGE ON SCHEMA public TO mcp_agent; GRANT SELECT ON ALL TABLES IN SCHEMA public TO mcp_agent;

MySQL:

CREATE USER 'mcp_agent'@'localhost' IDENTIFIED BY 'strong_random_password';

GRANT SELECT ON mydb.* TO 'mcp_agent'@'localhost'; FLUSH PRIVILEGES;


Development

git clone <repo-url>

cd universal-db-mcp python -m venv .venv && source .venv/bin/activate pip install -e ".[dev]"

Run tests (67+ passing, no external DB required for SQLite + DuckDB)

pytest

Security tests only

pytest tests/test_security.py -v

With coverage

pytest --cov=src/universal_db_mcp --cov-report=term-missing


Architecture

src/universal_db_mcp/

├── server.py # FastMCP server — 5 tools ├── config.py # Env-var config via Pydantic ├── adapters/ │ ├── base.py # Abstract adapter + result dataclasses │ ├── postgresql.py # asyncpg, connection pool, read-only via init callback │ ├── sqlite.py # aiosqlite, read-only via file URI mode=ro │ ├── mysql.py # aiomysql, DictCursor │ └── duckdb.py # duckdb, thread-pool executor, lock-guarded └── security/ └── sanitizer.py # SQLSanitizer — 8-layer injection prevention

docs/ └── SECURITY.md # Full security architecture and threat model


vs. Google MCP Toolbox

This projectGoogle MCP Toolbox
RuntimePython — pip install / uvxGo binary / Docker
Local DBsSQLite + DuckDB zero-infraNo SQLite
AnalyticsDuckDB in-processNo columnar adapter
Auth modelRead-only by default + env varsIAM / GCP-native
SQL injection8-layer sanitizer + parameterizedAuth-focused
ExtendPython ecosystem, any pip packageGo plugins
VendorNeutralGoogle Cloud funnel

Different tools for different jobs. Use this when you want Python-native, local-first, security-hardened access without cloud dependencies.


License

MIT — LICENSE


Security Notice: This server provides AI agents with database access. Always use read-only credentials, review docs/SECURITY.md before production deployment, and never commit .env files.