
Universal DB (read-only)
Read-only guarded SQL access to eight database engines for AI agents
- Pricing
- Open source
- Platforms
- CLI, self-hosted
- Runs
- Locally
- Version
- 0.2.0
- Listing updated
- 2 days ago
About Universal DB (read-only)
Universal DB (read-only) is an open-source MCP server for databases. It runs locally on your machine and is started by your AI client.
A write is refused rather than discouraged. Each statement is parsed into a syntax tree and walked before it runs: one statement per call, no DML, DDL, SELECT INTO or locking hints even inside a CTE, only allowlisted functions, and schema-qualified tables inside your allowlist. If it cannot be parsed, it is refused.
Sessions are pinned read-only on PostgreSQL, MySQL, MariaDB, ClickHouse and SQLite, Db2 runs at UR and SQL Server at READ UNCOMMITTED, and the connection fails closed if the server refuses. Results are capped by rows, bytes and cells, sensitive-looking columns are masked, and every call is audited.
Beyond querying, 29 tools cover catalog browsing, profiling, value search across connections, schema review, a Markdown data dictionary and federated reads or joins across connections. It is Apache-2.0, ships as an OCI image over stdio, and never calls an LLM.
Install
Run in a terminal
claude mcp add universal-db-mcp -- docker run -i --rm ghcr.io/alghanim/universal-db-mcp:0.2.0Add to claude_desktop_config.json
{
"mcpServers": {
"universal-db-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/alghanim/universal-db-mcp:0.2.0"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"universal-db-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/alghanim/universal-db-mcp:0.2.0"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"universal-db-mcp": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/alghanim/universal-db-mcp:0.2.0"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"universal-db-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/alghanim/universal-db-mcp:0.2.0"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"universal-db-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/alghanim/universal-db-mcp:0.2.0"
]
}
}
}Tools this server provides (11)
Taken from the project documentation; the running server may differ.
- db_query
- Runs a validated, bounded read-only query.
- db_validate_query
- Checks a statement against the guard without running it.
- db_list_tables
- Lists tables in a schema.
- db_get_table
- Returns details of one table.
- db_explain
- Shows query plans without executing them.
- db_profile_table
- Profiles a table on a bounded sample.
- db_search_values
- Finds a value across tables and connections without writing SQL.
- db_review_schema
- Returns prioritized optimization findings.
- db_document_schema
- Produces a Markdown data dictionary.
- db_federated_query
- Runs one statement, or one per connection, and merges results.
- db_federated_join
- Runs a bounded hash join across two connections.
What it does
- Parsed SQL guard
- Walks a full syntax tree and refuses anything that is not a single read.
- Read-only sessions
- Pins sessions to read-only or non-locking isolation and fails closed otherwise.
- Masked, bounded output
- Caps rows, bytes and cells and masks passwords, tokens and card-like values.
- Audit trail
- Logs every call with a SQL fingerprint.
- Schema discovery tools
- Lists tables, columns, indexes and relationships, and profiles tables on a sample.
- Federated queries
- Runs one question across several connections or joins results from two.
- Generated documentation
- Produces a Markdown data dictionary from catalog metadata without row values.
Good for
- Let a coding agent inspect a production schema safely
- Find which tables across databases hold a given value
- Generate a data dictionary for an undocumented database
- Review a schema for optimization findings
- Reconcile results from two different database engines
Pricing
Open source
Apache-2.0
Prices change. Check alghanim.github.io before you buy.
Universal DB (read-only) FAQ
Which databases are supported?
PostgreSQL, MySQL, MariaDB, ClickHouse, Oracle, SQL Server, Db2 and SQLite.
Can it write data?
No. There is no write mode, and configuration that enables writes is rejected when it loads.
Does it call an LLM or send telemetry?
The README says it never calls an LLM, sends no telemetry and installs nothing at runtime.
Is the guard the only protection?
No. The README names the database login as the primary control, so give each connection a SELECT-only login limited to listed schemas.
What licence is it under?
Apache-2.0.
Is Universal DB (read-only) free?
Yes. Universal DB (read-only) is open source, so you can use and self-host it for free.
How do I add Universal DB (read-only) to Claude Code?
Run this command in your terminal: claude mcp add universal-db-mcp -- docker run -i --rm ghcr.io/alghanim/universal-db-mcp:0.2.0
What are the best alternatives to Universal DB (read-only)?
The closest alternatives to Universal DB (read-only) are REA, Agent Roast, Midplane, Leash and Tinplate Edge AI Safety, Security & EU Compliance.
Alternatives to Universal DB (read-only)

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools
Agent Roast
MCP serverOffline review that flags agent changes which weaken tests, assertions or CI
Runs locally- Open source
- 4 Hacker News points
- Developer tools

Midplane
MCP serverPostgres gateway for AI agents with table grants, column masking and approval for writes
Runs locally- Open source
- 5 GitHub stars
- Databases

Leash
MCP serverReview what your AI touched, approve risky actions and undo supported changes
- 1 tool
- Remote
- Free
- 1 GitHub star
- Security
Zero-log MCP server with 49 tools for AI guardrails, secret scanning and EU compliance
- 49 tools
- Remote
- Freemium
- Security

SecureCloud
MCP serverSentinelOne and IT security catalog, prices, quotes and checkout links for Israel
- 7 tools
- Remote
- Free
- Security