# OmniSQL MCP

> Give AI coding clients access to your existing databases through native drivers.

- **URL**: https://followmcp.com/en/servers/omnisql-mcp
- **Category**: Database
- **Origin**: Community
- **Stars**: 94
- **FMRS Score**: 61/100 (Grade C)
- **Source**: https://github.com/srthkdev/omnisql-mcp
- **Transports**: stdio (local process)
- **Runtimes**: Node.js 22.15+ within 22.x,, Bun 1.4.3+
- **Auth**: No credential needed

## Overview
OmniSQL MCP is an MCP server for managing database connections and querying, exporting, and inspecting database structures. It can reuse saved connections from DBeaver-compatible workspaces or use JSON configuration for multiple instances. Supported engines include PostgreSQL, MySQL/MariaDB, SQL Server, SQLite, Oracle, DuckDB, and ClickHouse; some PostgreSQL-compatible databases route through the pg driver. Read-only mode is enabled by default, with controls such as connection allowlists, tool disabling, and table access policies.

## Best for
- Developers who need to access their own databases from a local AI coding client.
- Teams that want to reuse DBeaver-compatible connections and control access with read-only mode or connection allowlists.

## Not for
- Users who need an unlisted database engine or external GUI/CLI query fallback.
- Workflows requiring explicit multi-call Oracle transactions.
- Environments that cannot allow the AI client process to access local connection configuration or the configured database permissions.

## Required permissions
- The server needs access to its configuration file or discovered DBeaver-compatible workspace, plus credentials and network access required to reach the configured databases.
- Writes and schema changes require the relevant write capability to be enabled and authorization from the database account; a database-level read-only account is recommended for production.
- SSH tunnels require a trusted known_hosts entry by default; RDS IAM connections require the AWS CLI and a valid session.

## Risks
- Read-only SQL checks are safeguards, not a full SQL sandbox; use database-level read-only permissions as an additional boundary.
- An AI client with unrestricted file access can still read local configuration files.
- Enabling writes, schema changes, or drop tools expands the possible impact; database grants and operator policy still apply.
- Disabling strict SSH host-key checks allows unknown hosts; the server does not fall back to a direct database connection if a tunnel fails.

## Client config (JSON)
```json
{"mcpServers":{"omnisql":{"command":"npx","args":["-y","omnisql-mcp@latest"],"env":{"OMNISQL_CONFIG_FILE":"/absolute/path/connections.json"}}}}
```

## Tools (26)
- `list_connections`: List available database connections.
- `list_databases`: Discover databases accessible on a server.
- `get_connection_info`: Get connection details.
- `test_connection`: Test database connectivity.
- `execute_query`: Run read-only queries; documented accepted statements include SELECT, EXPLAIN, SHOW, DESCRIBE, and PRAGMA.
- `write_query`: Run INSERT, UPDATE, or DELETE queries.
- `export_data`: Export data as CSV or JSON, optionally compressed.
- `read_result`: Read rows and columns from a stored result page by page.
- `read_result_cell`: Read a long cell in chunks.
- `read_export`: Read a stored export in bounded chunks.
- `list_tables`: List tables and views.
- `get_table_schema`: Inspect columns, indexes, and constraints.
- `get_table_stats`: View catalog row estimates and data and index storage.
- `create_table`: Create tables.
- `alter_table`: Modify table structure.
- `drop_table`: Drop tables; confirmation is required.
- `begin_transaction`: Start a transaction.
- `execute_in_transaction`: Execute a query within a transaction.
- `commit_transaction`: Commit a transaction.
- `rollback_transaction`: Roll back a transaction.
- `explain_query`: Analyze a query execution plan.
- `compare_schemas`: Compare schemas between two connections.
- `get_pool_stats`: View connection pool statistics.
- `get_database_stats`: View database statistics.
- `append_insight`: Store analysis notes.
- `list_insights`: Retrieve stored analysis notes.
