
Universal Db Mcp
io.github.Fashad-AhmedPublished by GitHub account Fashad-Ahmedv1.1.2Updated Oct 24, 2026
Security-first MCP server for PostgreSQL, SQLite, MySQL, DuckDB with SQL injection prevention.
Overview
A local, read-only-by-default MCP server that lets an assistant inspect schemas and run guarded SQL against PostgreSQL, MySQL, SQLite and DuckDB.
- What you can do
- Run SQL queries against configured databases, read-only by default with injection checks and row limits, and optionally dry-run or explain a query plan without executing it. Inspect tables and columns, list configured databases and check connection health and version. Review the last 100 executed queries and capture schema snapshots to compare for drift. Query local SQLite files and in-process DuckDB, including in-memory analytics.
- When to use it
- Useful when you want an assistant to explore or query relational and analytical databases in plain language, especially local SQLite or DuckDB files with no server to set up, while keeping writes blocked by default.
- Requirements
- Runs locally as a Python package (uvx or pip). Needs at least one connection setting: POSTGRES_URI, MYSQL_URI, SQLITE_PATH or DUCKDB_PATH. Optional settings include ALLOW_DESTRUCTIVE, MAX_RESULT_ROWS and read-only flags. Network access is needed only for remote PostgreSQL or MySQL servers.
Installation
In SourceWeft
- Open Universal Db Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Universal Database MCP Server
The security-first, Python-native MCP server for database access from AI agents.
[CI] [PyPI] [Python 3.10+] [FastMCP] [License: MIT]
[Demo: schema discovery, a real query, a blocked DROP, and dry-run mode]
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:
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):
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.
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:
Then in Claude Code:
Natural Language → SQL
No separate NL-to-SQL tool needed — Claude already does this. Give it the
schema tool and ask in plain English:
Pair with dry_run: true (DRYRUN=true) while prototyping — Claude gets the
query plan back without anything executing.
Docker
See examples/docker_mcp_config.json for
wiring this into an MCP client.
All Databases
MCP Tools
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
Secure Database Users
Always use a dedicated read-only account. Never give the MCP server credentials that can modify data.
PostgreSQL:
MySQL:
Development
Architecture
vs. Google MCP Toolbox
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.
Source: README.md at commit 7581347
Tools
0Version history
1- v1.1.2LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.